/* ============================================================
   MedMockTest — Shared Stylesheet
   Palette: teal/emerald + deep blue. No external dependencies.
   Mobile-first, lightweight.
   ============================================================ */

:root {
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-50:  #f0fdfa;
  --emerald-600: #059669;
  --emerald-500: #10b981;
  --deepblue-900: #0b2540;
  --deepblue-800: #103254;
  --deepblue-700: #1a4570;
  --deepblue-600: #2563a3;
  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-900: #0f172a;
  --red-600: #dc2626;
  --red-50:  #fef2f2;
  --amber-500: #f59e0b;
  --amber-50:  #fffbeb;
  --green-600: #16a34a;
  --green-50:  #f0fdf4;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, .08);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .12);
  --maxw: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: var(--slate-900);
  background: var(--slate-50);
  line-height: 1.6;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

img, svg { max-width: 100%; display: block; }

a { color: var(--teal-700); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--deepblue-900); line-height: 1.25; font-weight: 700; }
h1 { font-size: 1.75rem; margin-bottom: .5rem; }
h2 { font-size: 1.4rem; margin-bottom: .75rem; }
h3 { font-size: 1.15rem; margin-bottom: .5rem; }
p  { margin-bottom: .75rem; color: var(--slate-700); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1rem; }

.section { padding: 2.5rem 0; }
.section-alt { background: #fff; border-top: 1px solid var(--slate-200); border-bottom: 1px solid var(--slate-200); }

.lead { font-size: 1.05rem; color: var(--slate-600); max-width: 640px; }

.muted { color: var(--slate-500); font-size: .9rem; }
.small { font-size: .85rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .65rem 1.25rem; border-radius: var(--radius);
  font-weight: 600; font-size: .95rem; border: 2px solid transparent;
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s;
  text-decoration: none; line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal-600); color: #fff; }
.btn-primary:hover { background: var(--teal-700); }
.btn-blue { background: var(--deepblue-700); color: #fff; }
.btn-blue:hover { background: var(--deepblue-800); }
.btn-outline { background: transparent; color: var(--teal-700); border-color: var(--teal-600); }
.btn-outline:hover { background: var(--teal-50); }
.btn-ghost { background: var(--slate-100); color: var(--slate-700); }
.btn-ghost:hover { background: var(--slate-200); }
.btn-sm { padding: .4rem .8rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Header / Nav ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--slate-200);
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1rem; max-width: var(--maxw); margin: 0 auto; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; color: var(--deepblue-900); font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--teal-600), var(--deepblue-700));
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.brand-tag { display: block; font-size: .68rem; font-weight: 500; color: var(--slate-500); letter-spacing: .02em; }

.nav-toggle {
  background: none; border: none; cursor: pointer; padding: .4rem;
  display: flex; align-items: center; color: var(--deepblue-800);
}
.main-nav { display: none; width: 100%; }
.main-nav.open { display: block; }
.main-nav ul { list-style: none; display: flex; flex-direction: column; gap: .15rem; padding: .5rem 0 1rem; }
.main-nav a {
  display: block; padding: .55rem .75rem; border-radius: 8px;
  color: var(--slate-700); font-weight: 600; font-size: .95rem;
}
.main-nav a:hover { background: var(--teal-50); color: var(--teal-700); text-decoration: none; }
.main-nav a.active { color: var(--teal-700); background: var(--teal-50); }
.nav-cta { background: var(--teal-600); color: #fff !important; text-align: center; }
.nav-cta:hover { background: var(--teal-700) !important; }

@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .main-nav { display: block !important; width: auto; }
  .main-nav ul { flex-direction: row; align-items: center; gap: .25rem; padding: 0; }
  .main-nav a { padding: .45rem .7rem; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--deepblue-900) 0%, var(--deepblue-700) 55%, var(--teal-700) 130%);
  color: #fff; padding: 3rem 0 3.5rem;
}
.hero h1 { color: #fff; font-size: 2rem; max-width: 640px; }
.hero p { color: rgba(255,255,255,.85); max-width: 600px; font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.hero .btn-primary { background: var(--emerald-500); }
.hero .btn-primary:hover { background: var(--emerald-600); }
.hero .btn-outline { color: #fff; border-color: rgba(255,255,255,.5); }
.hero .btn-outline:hover { background: rgba(255,255,255,.12); }
.hero-stats { display: flex; flex-wrap: wrap; gap: 2rem; margin-top: 2rem; }
.hero-stat strong { display: block; font-size: 1.6rem; color: #fff; }
.hero-stat span { color: rgba(255,255,255,.75); font-size: .85rem; }

/* ---------- Cards / Grid ---------- */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card h3 { display: flex; align-items: center; gap: .5rem; }
.card-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: var(--teal-50); color: var(--teal-700);
  display: flex; align-items: center; justify-content: center;
}
.card-icon.blue { background: #eef4fb; color: var(--deepblue-700); }
.card-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 .75rem; }
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600;
  background: var(--slate-100); color: var(--slate-600);
}
.badge-teal { background: var(--teal-50); color: var(--teal-700); }
.badge-blue { background: #eef4fb; color: var(--deepblue-700); }
.badge-amber { background: var(--amber-50); color: #92400e; }
.badge-green { background: var(--green-50); color: var(--green-600); }
.badge-red { background: var(--red-50); color: var(--red-600); }

/* ---------- Announcements ---------- */
.notice-list { list-style: none; }
.notice-list li {
  padding: .85rem 1rem; border-left: 3px solid var(--teal-500);
  background: #fff; border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: .6rem; box-shadow: var(--shadow-sm);
}
.notice-list .date { color: var(--slate-500); font-size: .8rem; margin-right: .5rem; }
.notice-list .tag { font-weight: 700; color: var(--teal-700); margin-right: .4rem; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: .35rem; color: var(--slate-700); font-size: .92rem; }
.form-control {
  width: 100%; padding: .65rem .8rem; border: 1px solid var(--slate-300);
  border-radius: 8px; font-size: .95rem; font-family: inherit; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(20,184,166,.18); }
textarea.form-control { min-height: 130px; resize: vertical; }
.field-error { color: var(--red-600); font-size: .82rem; margin-top: .25rem; display: none; }
.form-group.invalid .field-error { display: block; }
.form-group.invalid .form-control { border-color: var(--red-600); }
.form-status { padding: .8rem 1rem; border-radius: 8px; margin-top: 1rem; display: none; font-size: .92rem; }
.form-status.ok { display: block; background: var(--green-50); color: #166534; border: 1px solid #bbf7d0; }
.form-status.err { display: block; background: var(--red-50); color: var(--red-600); border: 1px solid #fecaca; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--deepblue-900); color: rgba(255,255,255,.75);
  padding: 2.5rem 0 1.25rem; margin-top: 2rem; font-size: .92rem;
}
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: .75rem; }
.site-footer a { color: rgba(255,255,255,.8); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 1.75rem; margin-bottom: 1.75rem; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: .45rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12); padding-top: 1.25rem;
  display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; font-size: .82rem; color: rgba(255,255,255,.55);
}
.footer-disclaimer { background: rgba(0,0,0,.18); padding: .75rem 1rem; border-radius: 8px; font-size: .8rem; margin-bottom: 1.25rem; }

/* ---------- Page header (sub-pages) ---------- */
.page-head {
  background: linear-gradient(135deg, var(--deepblue-800), var(--deepblue-600));
  color: #fff; padding: 2.25rem 0;
}
.page-head h1 { color: #fff; }
.page-head p { color: rgba(255,255,255,.85); }
.breadcrumb { font-size: .82rem; color: rgba(255,255,255,.7); margin-bottom: .5rem; }
.breadcrumb a { color: rgba(255,255,255,.85); }

/* ---------- Exam info page ---------- */
.info-list { list-style: none; }
.info-list li { padding: .4rem 0 .4rem 1.6rem; position: relative; color: var(--slate-700); }
.info-list li::before {
  content: ""; position: absolute; left: 0; top: .85rem;
  width: 8px; height: 8px; border-radius: 50%; background: var(--teal-500);
}
.steps { counter-reset: step; list-style: none; }
.steps li { counter-increment: step; padding: .6rem 0 .6rem 2.6rem; position: relative; color: var(--slate-700); }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: .55rem;
  width: 28px; height: 28px; border-radius: 50%; background: var(--teal-600); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem;
}

/* ---------- Mock test engine ---------- */
.test-selector .test-card { cursor: pointer; }
.test-selector .test-card:hover { border-color: var(--teal-500); transform: translateY(-2px); }
.test-card.selected { border-color: var(--teal-600); box-shadow: 0 0 0 3px rgba(20,184,166,.2); }

.quiz-topbar {
  position: sticky; top: 57px; z-index: 40; background: #fff;
  border-bottom: 1px solid var(--slate-200); padding: .6rem 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem;
}
.timer {
  display: inline-flex; align-items: center; gap: .4rem; font-weight: 700;
  font-variant-numeric: tabular-nums; padding: .35rem .8rem; border-radius: 8px;
  background: var(--teal-50); color: var(--teal-700); font-size: 1rem;
}
.timer.warning { background: var(--amber-50); color: #92400e; animation: pulse 1s infinite; }
.timer.danger { background: var(--red-50); color: var(--red-600); animation: pulse .6s infinite; }
@keyframes pulse { 50% { opacity: .65; } }

.progress-track { height: 6px; background: var(--slate-200); border-radius: 999px; overflow: hidden; margin: .5rem 0 1rem; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--teal-500), var(--emerald-500)); transition: width .25s; }

.question-card { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-sm); }
.q-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; font-size: .85rem; }
.q-text { font-size: 1.05rem; font-weight: 600; color: var(--slate-900); margin-bottom: 1rem; }

.options { display: flex; flex-direction: column; gap: .6rem; }
.option {
  display: flex; align-items: flex-start; gap: .7rem; padding: .75rem .9rem;
  border: 1.5px solid var(--slate-200); border-radius: 8px; cursor: pointer;
  background: #fff; transition: border-color .12s, background .12s; font-size: .95rem;
}
.option:hover { border-color: var(--teal-500); background: var(--teal-50); }
.option input { margin-top: .25rem; accent-color: var(--teal-600); flex-shrink: 0; }
.option.selected { border-color: var(--teal-600); background: var(--teal-50); }
.option-letter {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--slate-100); color: var(--slate-700); font-weight: 700; font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
}
.option.selected .option-letter { background: var(--teal-600); color: #fff; }

.quiz-nav { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: 1.25rem; flex-wrap: wrap; }
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: .4rem; margin-top: 1rem; }
.q-grid button {
  padding: .5rem 0; border-radius: 7px; border: 1.5px solid var(--slate-200);
  background: #fff; cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--slate-700);
}
.q-grid button.answered { background: var(--teal-600); border-color: var(--teal-600); color: #fff; }
.q-grid button.current { box-shadow: 0 0 0 2px var(--deepblue-700); }
.q-grid button.marked { border-color: var(--amber-500); border-style: dashed; }

.legend { display: flex; flex-wrap: wrap; gap: .9rem; font-size: .78rem; color: var(--slate-500); margin-top: .75rem; }
.legend span { display: inline-flex; align-items: center; gap: .3rem; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1.5px solid var(--slate-200); background: #fff; }
.legend i.ans { background: var(--teal-600); border-color: var(--teal-600); }
.legend i.cur { box-shadow: 0 0 0 2px var(--deepblue-700); }
.legend i.mk { border-color: var(--amber-500); border-style: dashed; }

/* Result screen */
.result-hero { text-align: center; padding: 2rem 1rem; background: #fff; border-radius: var(--radius); border: 1px solid var(--slate-200); margin-bottom: 1.5rem; }
.score-circle {
  width: 140px; height: 140px; border-radius: 50%; margin: 0 auto 1rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: conic-gradient(var(--teal-500) var(--pct, 0%), var(--slate-100) 0);
  position: relative;
}
.score-circle::before { content: ""; position: absolute; inset: 10px; background: #fff; border-radius: 50%; }
.score-circle > * { position: relative; z-index: 1; }
.score-pct { font-size: 2rem; font-weight: 800; color: var(--deepblue-800); }
.score-label { font-size: .78rem; color: var(--slate-500); }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; max-width: 480px; margin: 0 auto; }
.result-stat { padding: .8rem .5rem; border-radius: 8px; background: var(--slate-50); border: 1px solid var(--slate-200); }
.result-stat strong { display: block; font-size: 1.3rem; }
.result-stat span { font-size: .78rem; color: var(--slate-500); }
.result-stat.correct strong { color: var(--green-600); }
.result-stat.incorrect strong { color: var(--red-600); }
.result-stat.skipped strong { color: var(--slate-500); }

.subject-breakdown { margin-top: .5rem; }
.subject-row { margin-bottom: .7rem; }
.subject-row .sr-head { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: .25rem; }
.subject-row .bar { height: 8px; background: var(--slate-100); border-radius: 999px; overflow: hidden; }
.subject-row .bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal-500), var(--emerald-500)); }

/* Review */
.review-item { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 1.1rem; margin-bottom: .9rem; }
.review-item.correct { border-left: 4px solid var(--green-600); }
.review-item.incorrect { border-left: 4px solid var(--red-600); }
.review-item.skipped { border-left: 4px solid var(--slate-300); }
.review-q { font-weight: 600; margin-bottom: .6rem; }
.review-opt { padding: .35rem .6rem; border-radius: 6px; font-size: .9rem; margin-bottom: .25rem; color: var(--slate-600); }
.review-opt.is-correct { background: var(--green-50); color: #166534; font-weight: 600; }
.review-opt.is-user { background: var(--red-50); color: var(--red-600); font-weight: 600; }
.review-expl { margin-top: .6rem; padding: .7rem .85rem; background: var(--slate-50); border-radius: 8px; font-size: .9rem; border-left: 3px solid var(--deepblue-600); }
.review-expl strong { color: var(--deepblue-800); }

/* ---------- Dashboard ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1.5rem; }
@media (min-width: 720px) { .stat-cards { grid-template-columns: repeat(4, 1fr); } }
.stat-card { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow-sm); }
.stat-card strong { display: block; font-size: 1.5rem; color: var(--deepblue-800); }
.stat-card span { font-size: .82rem; color: var(--slate-500); }
.history-table { width: 100%; border-collapse: collapse; font-size: .9rem; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); display: block; overflow-x: auto; }
.history-table table { width: 100%; border-collapse: collapse; min-width: 560px; }
.history-table th, .history-table td { padding: .65rem .8rem; text-align: left; border-bottom: 1px solid var(--slate-100); }
.history-table th { background: var(--slate-50); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--slate-500); }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--slate-500); }
.empty-state svg { margin: 0 auto 1rem; color: var(--slate-300); }

/* ---------- Resources ---------- */
.resource-card .file-meta { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .82rem; color: var(--slate-500); margin: .5rem 0 .9rem; }
.resource-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.filter-btn {
  padding: .4rem .9rem; border-radius: 999px; border: 1.5px solid var(--slate-200);
  background: #fff; cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--slate-600);
}
.filter-btn.active { background: var(--teal-600); border-color: var(--teal-600); color: #fff; }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; } .flex-wrap { flex-wrap: wrap; } .gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--slate-200); margin: 1.5rem 0; border: none; }

@media (min-width: 640px) {
  h1 { font-size: 2.1rem; }
  .hero h1 { font-size: 2.4rem; }
  .section { padding: 3.5rem 0; }
}
