/* ── AWS Bag — Main Stylesheet ──────────────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --aws-orange:  #ff9900;
  --aws-dark:    #232f3e;
  --aws-blue:    #146eb4;
  --aws-light:   #0096c7;
  --ink:         #1a2332;
  --ink-muted:   #5a6a7a;
  --paper:       #f5f7fa;
  --white:       #ffffff;
  --border:      #dde4ed;
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   22px;
  --shadow-sm:   0 2px 8px rgba(26,35,50,.08);
  --shadow-md:   0 6px 24px rgba(26,35,50,.10);
  --shadow-lg:   0 12px 40px rgba(26,35,50,.12);
}

/* ── Reset & Base ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: Inter, -apple-system, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--aws-blue); }
a:hover { color: var(--aws-dark); }

h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.25; }

img { max-width: 100%; }

/* ── Skip link ───────────────────────────────────────────────────── */
.skip-link {
  position: absolute; left: -9999px; top: 1rem; z-index: 9999;
  background: var(--aws-orange); color: #000; padding: .4rem 1rem;
  border-radius: var(--radius-sm); font-weight: 600;
}
.skip-link:focus { left: 1rem; }

/* ── Navbar ──────────────────────────────────────────────────────── */
.site-header {
  background: var(--white);
  box-shadow: 0 1px 0 var(--border), var(--shadow-sm);
  z-index: 1000;
}
.navbar-brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--aws-dark) !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.navbar-brand img { width: 30px; height: 30px; border-radius: 6px; }
.navbar-brand strong { color: var(--aws-orange); }
.navbar .nav-link {
  color: var(--ink) !important;
  font-weight: 500;
  font-size: .9rem;
  padding: .45rem .7rem !important;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
  background: rgba(20,110,180,.08);
  color: var(--aws-blue) !important;
}
.navbar .nav-link.active { font-weight: 600; }
.navbar-toggler { border: 1px solid var(--border); padding: .3rem .5rem; }
.dropdown-menu { border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.dropdown-item { font-size: .88rem; padding: .45rem 1rem; }
.dropdown-item:hover { background: var(--paper); color: var(--aws-blue); }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn-aws {
  background: var(--aws-orange);
  border: 0;
  color: #111;
  font-weight: 700;
  padding: .65rem 1.35rem;
  border-radius: var(--radius-md);
  transition: filter .15s, transform .1s;
}
.btn-aws:hover { filter: brightness(1.08); color: #111; transform: translateY(-1px); }
.btn-aws.btn-lg { padding: .8rem 1.8rem; font-size: 1rem; }

.btn-glass {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.45);
  color: #fff;
  font-weight: 600;
  padding: .65rem 1.35rem;
  border-radius: var(--radius-md);
  backdrop-filter: blur(4px);
  transition: background .15s;
}
.btn-glass:hover { background: rgba(255,255,255,.28); color: #fff; }
.btn-glass.btn-lg { padding: .8rem 1.8rem; font-size: 1rem; }

/* ── Hero Section ────────────────────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, #0a2540 0%, #146eb4 55%, #0096c7 100%);
  color: #fff;
  padding: 4rem 0 4.5rem;
}
.hero-eyebrow {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.7);
  margin-bottom: .5rem;
}
.hero-title {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: .75rem;
  color: #fff;
}
.hero-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,.85);
  max-width: 560px;
}
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* Hero stats card */
.hero-stats-card {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
  padding: 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 200px;
}
.hsc-item { text-align: center; }
.hsc-num { display: block; font-size: 2.2rem; font-weight: 800; color: var(--aws-orange); line-height: 1; }
.hsc-label { font-size: .8rem; color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: .05em; }

/* ── Section titles ──────────────────────────────────────────────── */
.section-title { font-size: 1.55rem; font-weight: 800; }
.section-sub   { color: var(--ink-muted); }
.bg-light-subtle { background: var(--white) !important; }
.link-muted { color: var(--ink-muted); text-decoration: none; font-weight: 500; }
.link-muted:hover { color: var(--aws-blue); }

/* ── Exam Cards (homepage listing) ──────────────────────────────── */
.exam-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  color: var(--ink);
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.exam-card:hover {
  border-color: var(--aws-blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  color: var(--ink);
}
.exam-card-provider {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-muted);
  margin-bottom: .4rem;
}
.exam-card-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .4rem;
  line-height: 1.3;
}
.exam-card-desc { font-size: .85rem; color: var(--ink-muted); }
.exam-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  margin-top: .75rem;
}
.exam-badge {
  background: var(--aws-orange);
  color: #111;
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 999px;
}
.exam-qcount { font-size: .8rem; color: var(--ink-muted); font-weight: 500; }

/* ── Topic Cards ─────────────────────────────────────────────────── */
.topic-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  color: var(--ink);
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.topic-card:hover {
  border-color: var(--aws-blue);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
  color: var(--ink);
}
.tc-name  { font-size: .95rem; font-weight: 700; margin-bottom: .25rem; }
.tc-desc  { font-size: .8rem; color: var(--ink-muted); margin-bottom: .3rem; }
.tc-count { font-size: .78rem; color: var(--ink-muted); font-weight: 500; }

.topics-category-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--aws-orange);
  display: inline-block;
}

/* ── Why section ─────────────────────────────────────────────────── */
.why-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  height: 100%;
  transition: box-shadow .2s;
}
.why-card:hover { box-shadow: var(--shadow-md); }
.why-icon { font-size: 2.2rem; margin-bottom: .75rem; }
.why-card h3 { font-size: 1rem; }
.why-card p  { font-size: .9rem; color: var(--ink-muted); margin: 0; }

/* ── Breadcrumbs ─────────────────────────────────────────────────── */
.breadcrumb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: center;
  font-size: .82rem;
  color: var(--ink-muted);
}
.breadcrumb-list a { color: var(--aws-blue); text-decoration: none; }
.breadcrumb-list a:hover { text-decoration: underline; }
.breadcrumb-list [aria-current="page"] { color: var(--ink-muted); }

/* ── Question Cards ──────────────────────────────────────────────── */
.question-card {
  background: var(--white);
  border: 1px solid var(--border);
  padding: clamp(1rem, 3vw, 1.75rem);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.question-card h2 { font-size: 1rem; font-weight: 600; }

/* Options — single answer */
.option {
  width: 100%;
  text-align: left;
  margin: .35rem 0;
  padding: .75rem 1rem;
  border: 1.5px solid var(--border);
  background: var(--white);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color .13s, background .13s;
  font-size: .92rem;
}
button.option { border: 1.5px solid var(--border); }
.option:hover  { border-color: var(--aws-blue); background: #eef6ff; }
.option.selected { border-color: var(--aws-blue); background: #ddeeff; }

/* Options — multi answer checkboxes */
label.option { display: flex; align-items: flex-start; gap: .65rem; }
label.option input[type=checkbox] {
  margin-top: .22rem;
  accent-color: var(--aws-blue);
  width: 1.1rem; height: 1.1rem;
  flex-shrink: 0; cursor: pointer; pointer-events: none;
}

/* Answer reveal */
.answer {
  border-left: 5px solid #28a745;
  background: #f0fbf3;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-top: .75rem;
}
.answer-official {
  background: #f0fbf3;
  border-left: 5px solid #28a745;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
}
.reveal {
  margin-top: .75rem;
  font-size: .88rem;
}

/* ── Community Answers Panel ─────────────────────────────────────── */
.ca-panel { background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.25rem; margin-top: 1rem; }
.ca-panel-header { border-bottom: 1px solid var(--border); padding-bottom: .6rem; margin-bottom: 1rem; }
.ca-vote-row { padding: .7rem .9rem; margin-bottom: .5rem; background: var(--white); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.ca-admin-row { border-color: #0d6efd; background: #f0f5ff; }
.ca-choice-label { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.ca-progress { height: 8px; border-radius: 999px; background: #e9ecef; }
.ca-explanation { font-size: .83rem; color: #444; margin: .4rem 0 .2rem; line-height: 1.5; }
.ca-authors { font-size: .75rem; opacity: .65; }
.ca-badge { display: inline-block; font-size: .68rem; font-weight: 700; padding: .15rem .45rem; border-radius: 4px; text-transform: uppercase; letter-spacing: .03em; }
.ca-admin   { background: #0d6efd; color: #fff; }
.ca-correct { background: #198754; color: #fff; }
.ca-official{ background: #6c757d; color: #fff; }
.ca-opt-btn { min-width: 36px; border: 2px solid #adb5bd; background: #fff; border-radius: var(--radius-sm); font-weight: 700; transition: .12s; color: #333; }
.ca-opt-btn.active { border-color: #0d6efd; background: #0d6efd; color: #fff; }
.ca-opt-btn:hover:not(.active) { border-color: #0d6efd; color: #0d6efd; }
.ca-submit-form { border-top: 1px solid var(--border); padding-top: .9rem; margin-top: .9rem; }
.ca-load-btn { font-size: .82rem; }

/* ── Bookmark button ─────────────────────────────────────────────── */
.mark {
  background: none !important;
  border: 1px solid var(--border) !important;
  color: var(--ink-muted) !important;
  font-size: 1rem;
  width: 32px; height: 32px;
  padding: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.mark:hover { border-color: var(--aws-orange) !important; color: var(--aws-orange) !important; }

/* ── Search ──────────────────────────────────────────────────────── */
.search-wrap { position: relative; max-width: 600px; }
.search-wrap .form-control { border-radius: var(--radius-md); border: 1.5px solid var(--border); padding: .75rem 1rem; }
.search-wrap .form-control:focus { border-color: var(--aws-blue); box-shadow: 0 0 0 3px rgba(20,110,180,.12); }

/* ── Timer ───────────────────────────────────────────────────────── */
#timer { font-weight: 800; font-size: 1.1rem; color: var(--aws-dark); }

/* ── Pagination ──────────────────────────────────────────────────── */
.page-link { border-radius: var(--radius-sm) !important; font-size: .85rem; }

/* ── Footer ──────────────────────────────────────────────────────── */
.site-footer {
  background: var(--aws-dark);
  color: rgba(255,255,255,.75);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}
.footer-brand {
  display: flex; align-items: center; gap: .5rem;
  font-size: 1.1rem; font-weight: 700; color: #fff; text-decoration: none;
}
.footer-brand strong { color: var(--aws-orange); }
.footer-tagline { font-size: .83rem; color: rgba(255,255,255,.55); max-width: 280px; }
.footer-heading { color: rgba(255,255,255,.4); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; margin-bottom: .75rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .35rem; }
.footer-links a { color: rgba(255,255,255,.7); text-decoration: none; font-size: .88rem; transition: color .15s; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 1rem; font-size: .78rem; color: rgba(255,255,255,.4); }

/* ── Utility ─────────────────────────────────────────────────────── */
.badge { font-size: .72rem; }
.badge.bg-warning { font-size: .72rem; }
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; }

/* ── Legal pages ─────────────────────────────────────────────────── */
.legal-content h1 { font-size: 2rem; margin-bottom: .5rem; }
.legal-content h2 { font-size: 1.25rem; margin-top: 2rem; }
.legal-content p, .legal-content li { line-height: 1.8; color: var(--ink); }
.legal-content a { color: var(--aws-blue); }
.legal-content code { background: #f0f4f8; padding: .1em .35em; border-radius: 4px; font-size: .88em; }

/* ── AdSense blocks ──────────────────────────────────────────────── */
.ad-block { text-align: center; overflow: hidden; }
.ad-header-banner { background: #f8f9fa; padding: .25rem 0; border-bottom: 1px solid var(--border); }
.ad-footer { max-width: 970px; margin: 0 auto; }
.ad-block--ad_slot_in_question { margin: 1.5rem 0; }
.ad-block--ad_slot_before_pagination { margin: 1.5rem 0; }

/* ── Provider pills (homepage filter) ───────────────────────── */
.provider-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .85rem; border-radius: 999px;
  font-size: .8rem; font-weight: 600;
  background: rgba(255,255,255,.15); color: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.25); text-decoration: none;
  transition: background .15s, color .15s;
}
.provider-pill:hover, .provider-pill.active {
  background: rgba(255,255,255,.35); color: #fff;
}
.provider-pill-count {
  background: rgba(255,255,255,.25); border-radius: 999px;
  font-size: .7rem; padding: .05rem .35rem; font-weight: 700;
}

/* ── btn-outline-light fix ───────────────────────────────────── */
.btn-outline-light {
  border: 2px solid rgba(255,255,255,.7);
  color: #fff; background: transparent;
  font-weight: 600; padding: .65rem 1.35rem; border-radius: var(--radius-md);
  transition: background .15s, color .15s;
}
.btn-outline-light:hover { background: rgba(255,255,255,.15); color: #fff; }
.btn-outline-light.btn-lg { padding: .8rem 1.8rem; font-size: 1rem; }

/* ── Explanation rich text rendering ─────────────────────────── */
.explanation-text {
  font-size: .9rem;
  line-height: 1.7;
  color: #1a2030;
}
.explanation-text p  { margin-bottom: .6rem; }
.explanation-text ul,
.explanation-text ol { padding-left: 1.4rem; margin-bottom: .6rem; }
.explanation-text li { margin-bottom: .25rem; }
.explanation-text code {
  background: #f1f3f5;
  padding: .1em .35em;
  border-radius: 3px;
  font-size: .85em;
}
.explanation-text strong { color: #0f1c2e; }
.explanation-text a { color: var(--aws-blue, #146eb4); }

/* ── Reference images ────────────────────────────────────────── */
.explanation-image,
.ca-answer-image {
  margin-top: .75rem;
}
.explanation-image img,
.ca-answer-image img {
  display: block;
  max-width: 100%;
  transition: max-height .25s ease;
}
.explanation-image p,
.ca-answer-image p {
  font-size: .75rem;
  color: #888;
  margin-top: .25rem;
  margin-bottom: 0;
}

/* ══════════════════════════════════════════════════════════════
   EXAM MODE — Timed Mock Test
══════════════════════════════════════════════════════════════ */

/* ── Setup screen ─────────────────────────────────────────── */
.exam-setup-screen {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.exam-setup-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.exam-setup-header {
  background: linear-gradient(135deg, #0a2540 0%, #146eb4 100%);
  color: #fff;
  padding: 2rem 2rem 1.5rem;
  text-align: center;
}
.exam-setup-badge {
  display: inline-block;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  padding: .2rem .8rem;
  letter-spacing: .05em;
  margin-bottom: .75rem;
}
.exam-setup-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: .4rem;
  line-height: 1.2;
}
.exam-setup-sub {
  font-size: .9rem;
  opacity: .8;
  margin: 0;
}
.exam-setup-body { padding: 1.75rem 2rem 2rem; }
.exam-config-row { display: flex; gap: 1rem; margin-bottom: 1rem; }
.exam-config-item { flex: 1; }
.exam-config-item label { font-weight: 600; font-size: .85rem; margin-bottom: .35rem; display: block; }
.exam-rules {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: .25rem;
}
.exam-rule-item {
  font-size: .85rem;
  color: var(--ink-muted);
  padding: .3rem 0;
  border-bottom: 1px solid var(--border);
}
.exam-rule-item:last-child { border-bottom: 0; }

/* ── Top bar ──────────────────────────────────────────────── */
.exam-topbar {
  background: #0a2540;
  color: #fff;
  z-index: 1030;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.exam-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem 1rem;
  gap: .75rem;
}
.exam-topbar-left  { display: flex; flex-direction: column; min-width: 0; }
.exam-topbar-title { font-weight: 800; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exam-topbar-meta  { font-size: .75rem; color: rgba(255,255,255,.6); }
.exam-topbar-center { flex-shrink: 0; }
.exam-topbar-right  { display: flex; align-items: center; flex-shrink: 0; }
.exam-answered-count { font-size: .8rem; color: rgba(255,255,255,.7); }

/* Timer */
.exam-timer {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-md);
  padding: .35rem .9rem;
  font-size: 1.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: .4rem;
  transition: background .3s, border-color .3s;
}
.exam-timer.exam-timer-warn     { background: rgba(255,193,7,.2);  border-color: rgba(255,193,7,.5); color: #ffc107; }
.exam-timer.exam-timer-critical { background: rgba(220,53,69,.25); border-color: rgba(220,53,69,.6); color: #ff6b6b; animation: timerPulse 1s infinite; }
@keyframes timerPulse { 0%,100%{opacity:1} 50%{opacity:.65} }

/* ── Question card (exam mode) ────────────────────────────── */
.exam-question-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--shadow-sm);
}
.exam-q-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
.exam-q-num  { font-size: .82rem; color: var(--ink-muted); font-weight: 600; }
.exam-q-text { font-size: 1rem; font-weight: 600; line-height: 1.6; margin-bottom: 1rem; }

/* Exam options (no hover reveal — just selection) */
.exam-options { display: flex; flex-direction: column; gap: .4rem; }
.exam-option {
  width: 100%;
  text-align: left;
  padding: .75rem 1rem;
  border: 1.5px solid var(--border);
  background: var(--white);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: .93rem;
  transition: border-color .12s, background .12s;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  color: var(--ink);
}
.exam-option:hover  { border-color: var(--aws-blue); background: #eef6ff; }
.exam-option.selected { border-color: var(--aws-blue); background: #ddeeff; font-weight: 600; }
label.exam-option input[type=checkbox] {
  margin-top: .2rem;
  accent-color: var(--aws-blue);
  flex-shrink: 0;
  pointer-events: none;
}

/* ── Nav grid ─────────────────────────────────────────────── */
.exam-nav-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.exam-nav-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  flex: 1;
  justify-content: center;
}
.exam-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: .12s;
  color: var(--ink-muted);
}
.exam-nav-btn.answered { background: #d1fae5; border-color: #10b981; color: #065f46; }
.exam-nav-btn.current  { background: var(--aws-blue); border-color: var(--aws-blue); color: #fff; }

/* ── Overlay ──────────────────────────────────────────────── */
.exam-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,37,64,.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.exam-overlay-box { text-align: center; }

/* ══════════════════════════════════════════════════════════════
   RESULT PAGE — Performance Report
══════════════════════════════════════════════════════════════ */

/* ── Hero card ────────────────────────────────────────────── */
.result-hero {
  display: flex;
  gap: 2rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
  align-items: center;
}
.result-pass { border-left: 6px solid #10b981; }
.result-fail { border-left: 6px solid #ef4444; }

/* Score ring */
.result-score-ring {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}
.result-ring-svg { transform: rotate(-90deg); }
.result-ring-bg   { fill: none; stroke: #e9ecef; stroke-width: 10; }
.result-ring-fill {
  fill: none;
  stroke: var(--aws-orange);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dasharray .8s ease;
}
.result-pass .result-ring-fill { stroke: #10b981; }
.result-fail .result-ring-fill { stroke: #ef4444; }
.result-score-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.result-pct      { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.result-score-sub{ font-size: .72rem; color: var(--ink-muted); }

/* Right side */
.result-hero-right { flex: 1; min-width: 220px; }
.result-verdict {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  padding: .25rem .7rem;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: .5rem;
}
.result-verdict-pass { background: #d1fae5; color: #065f46; }
.result-verdict-fail { background: #fee2e2; color: #991b1b; }
.result-exam-name { font-size: 1.25rem; font-weight: 800; margin-bottom: .25rem; }
.result-meta { font-size: .83rem; color: var(--ink-muted); margin-bottom: .5rem; }

.result-stats-row { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: .75rem; }
.result-stat { text-align: center; }
.result-stat-num { display: block; font-size: 1.4rem; font-weight: 800; line-height: 1; }
.result-stat-lbl { font-size: .72rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .04em; }
.result-stat-correct .result-stat-num { color: #10b981; }
.result-stat-wrong   .result-stat-num { color: #ef4444; }

/* ── Section ──────────────────────────────────────────────── */
.result-section-title { font-size: 1.15rem; font-weight: 800; }

/* ── Topic breakdown grid ─────────────────────────────────── */
.result-topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem;
}
.topic-perf-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: .9rem 1rem;
}
.topic-perf-good { border-top: 3px solid #10b981; }
.topic-perf-ok   { border-top: 3px solid #f59e0b; }
.topic-perf-bad  { border-top: 3px solid #ef4444; }
.topic-perf-name  { font-size: .82rem; font-weight: 700; margin-bottom: .25rem; }
.topic-perf-score { font-size: 1.1rem; font-weight: 800; }
.topic-perf-bar-wrap { height: 6px; background: #e9ecef; border-radius: 999px; margin: .4rem 0; overflow: hidden; }
.topic-perf-bar { height: 100%; border-radius: 999px; background: #10b981; transition: width .6s ease; }
.topic-perf-bad  .topic-perf-bar { background: #ef4444; }
.topic-perf-ok   .topic-perf-bar { background: #f59e0b; }
.topic-perf-pct  { font-size: .78rem; color: var(--ink-muted); font-weight: 600; }

/* ── Question review cards ────────────────────────────────── */
.result-q-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: .75rem;
  border-left: 4px solid var(--border);
}
.result-q-correct { border-left-color: #10b981; }
.result-q-wrong   { border-left-color: #ef4444; }
.result-q-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .6rem;
  flex-wrap: wrap;
}
.result-q-num  { font-weight: 700; font-size: .82rem; color: var(--ink-muted); }
.result-q-text { font-size: .95rem; font-weight: 600; margin-bottom: .75rem; line-height: 1.55; }

.result-q-options { display: flex; flex-direction: column; gap: .35rem; }
.result-opt {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .55rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  background: var(--white);
}
.result-opt-correct { background: #f0fdf4; border-color: #10b981; }
.result-opt-wrong   { background: #fef2f2; border-color: #ef4444; }
.result-opt-key  { font-weight: 800; min-width: 1.2rem; flex-shrink: 0; }
.result-opt-text { flex: 1; }
.result-opt-badge {
  font-size: .68rem;
  font-weight: 700;
  padding: .1rem .45rem;
  border-radius: 999px;
  flex-shrink: 0;
  white-space: nowrap;
}
.result-opt-badge-correct { background: #10b981; color: #fff; }
.result-opt-badge-wrong   { background: #ef4444; color: #fff; }

.result-explanation {
  margin-top: .9rem;
  padding: .9rem 1rem;
  background: #f8fafc;
  border-left: 4px solid var(--aws-blue);
  border-radius: var(--radius-sm);
  font-size: .87rem;
}
.result-explanation-label { font-weight: 700; margin-bottom: .4rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--aws-blue); }
.result-explanation-text  { color: var(--ink); line-height: 1.65; }
.result-explanation-text p { margin-bottom: .4rem; }

/* ── CTA ──────────────────────────────────────────────────── */
.result-cta {
  text-align: center;
  padding: 2.5rem 1rem;
  border-top: 1px solid var(--border);
}
.result-cta h3 { font-weight: 800; margin-bottom: .5rem; }

/* ── Mock Test button (used on topic + mock-exam pages) ────── */
.btn-mocktest {
  background: linear-gradient(135deg, #0a2540, #146eb4);
  color: #fff;
  border: 0;
  font-weight: 700;
  padding: .65rem 1.35rem;
  border-radius: var(--radius-md);
  transition: filter .15s, transform .1s;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.btn-mocktest:hover { filter: brightness(1.12); color: #fff; transform: translateY(-1px); }
.btn-mocktest.btn-lg { padding: .8rem 1.8rem; font-size: 1rem; }
.btn-mocktest.btn-sm { padding: .4rem .9rem; font-size: .82rem; }

/* Responsive */
@media (max-width: 640px) {
  .exam-config-row { flex-direction: column; }
  .result-hero { flex-direction: column; gap: 1.25rem; padding: 1.5rem; }
  .exam-topbar-inner { flex-wrap: wrap; gap: .4rem; }
  .exam-nav-bar { flex-direction: column; }
}

/* ── Exam setup: auto time display + presets ──────────────── */
.exam-time-display {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: .55rem 1rem;
  font-weight: 700;
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--ink);
  min-height: 42px;
}
.exam-time-sub {
  font-size: .73rem;
  font-weight: 400;
  color: var(--ink-muted);
  margin-left: auto;
}
.exam-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
}
.exam-presets-label {
  font-size: .76rem;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
}
.exam-preset-btn {
  font-size: .76rem;
  font-weight: 600;
  padding: .25rem .7rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--ink-muted);
  cursor: pointer;
  transition: .12s;
  white-space: nowrap;
}
.exam-preset-btn:hover { border-color: var(--aws-blue); color: var(--aws-blue); }
.exam-preset-btn.active {
  border-color: var(--aws-orange);
  background: var(--aws-orange);
  color: #111;
}

/* ══════════════════════════════════════════════════════════════
   EXAM DETAIL PAGE — Landing page for each exam
══════════════════════════════════════════════════════════════ */
.exam-detail-hero {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.exam-detail-hero-body {
  background: linear-gradient(135deg, #0a2540 0%, #146eb4 100%);
  color: #fff;
  padding: 2.5rem 2rem 2rem;
}
.exam-detail-provider {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.6);
  margin-bottom: .4rem;
}
.exam-detail-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: .5rem;
  line-height: 1.2;
}
.exam-detail-desc {
  font-size: .92rem;
  color: rgba(255,255,255,.8);
  margin-bottom: 1.5rem;
  max-width: 600px;
}
.exam-detail-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.exam-detail-stat { text-align: center; }
.exam-detail-stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--aws-orange);
  line-height: 1;
}
.exam-detail-stat-lbl {
  font-size: .72rem;
  color: rgba(255,255,255,.65);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Action cards grid */
.exam-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.exam-action-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-decoration: none;
  color: var(--ink);
  transition: background .15s;
  background: var(--white);
}
.exam-action-card:nth-child(even) { border-right: 0; }
.exam-action-card:hover { background: #f0f7ff; color: var(--ink); }
.exam-action-primary { background: #f0f7ff; }
.exam-action-primary:hover { background: #ddeeff; }
.exam-action-icon { font-size: 1.6rem; flex-shrink: 0; }
.exam-action-body { flex: 1; min-width: 0; }
.exam-action-title { font-weight: 700; font-size: .95rem; margin-bottom: .15rem; }
.exam-action-sub   { font-size: .78rem; color: var(--ink-muted); }
.exam-action-arrow { font-size: 1.1rem; color: var(--aws-blue); font-weight: 700; flex-shrink: 0; }

@media (max-width: 560px) {
  .exam-action-grid { grid-template-columns: 1fr; }
  .exam-action-card { border-right: 0; }
  .exam-detail-hero-body { padding: 1.5rem; }
}
