/* ==========================================================================
   Attento Tutoring Diagnostic — theme
   Navy / Cream / Gold, clean editorial typography.
   ========================================================================== */

:root {
  --navy-950: #0a1930;
  --navy-900: #0f2340;
  --navy-800: #16304f;
  --navy-700: #1f3d61;
  --navy-600: #2c4f78;
  --cream-50: #fffdf8;
  --cream-100: #faf6ec;
  --cream-200: #f3ecda;
  --cream-300: #e9dfc4;
  --gold-400: #d9b76a;
  --gold-500: #c9a227;
  --gold-600: #a9821a;
  --ink: #16233a;
  --ink-soft: #4c5a72;
  --success: #2f7a4f;
  --danger: #b3452f;
  --shadow-lg: 0 24px 48px -20px rgba(10, 25, 48, 0.35);
  --shadow-sm: 0 2px 8px rgba(10, 25, 48, 0.08);
  --radius: 14px;
  --radius-sm: 8px;
  --font-serif: "Playfair Display", "Georgia", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--cream-100);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  color: var(--navy-950);
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--navy-700);
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header / Nav ---------- */

.site-header {
  background: var(--navy-950);
  border-bottom: 3px solid var(--gold-500);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cream-100);
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand .mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-950);
  font-weight: 800;
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.site-nav {
  display: flex;
  gap: 28px;
  align-items: center;
}

@media (max-width: 640px) {
  .site-header .container {
    flex-wrap: nowrap;
  }
  .brand {
    font-size: 1.05rem;
  }
  .brand .mark {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }
  .site-nav {
    gap: 12px;
  }
  .site-nav a:not(.btn) {
    display: none;
  }
  .site-nav .btn {
    padding: 9px 16px !important;
    font-size: 0.9rem;
    white-space: nowrap;
  }
}

.site-nav a {
  color: var(--cream-200);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--gold-400);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  font-family: var(--font-sans);
}

.btn:active {
  transform: translateY(1px);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: var(--navy-950);
  box-shadow: var(--shadow-sm);
}

.btn-gold:hover {
  box-shadow: 0 10px 24px -8px rgba(201, 162, 39, 0.55);
}

.btn-navy {
  background: var(--navy-900);
  color: var(--cream-50);
}

.btn-navy:hover {
  background: var(--navy-800);
}

.btn-outline {
  background: transparent;
  color: var(--navy-900);
  border: 1.5px solid var(--navy-900);
}

.btn-outline:hover {
  background: var(--navy-950);
  color: var(--cream-50);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 18px 36px;
  font-size: 1.1rem;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Hero ---------- */

.hero {
  background:
    radial-gradient(1200px 500px at 20% -10%, rgba(217, 183, 106, 0.18), transparent 60%),
    linear-gradient(180deg, var(--navy-950), var(--navy-900) 60%, var(--navy-800));
  color: var(--cream-100);
  padding: 88px 0 96px;
  position: relative;
}

.hero .eyebrow {
  color: var(--gold-400);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.hero h1 {
  color: var(--cream-50);
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  max-width: 16ch;
}

.hero p.lead {
  color: var(--cream-200);
  font-size: 1.15rem;
  max-width: 56ch;
  margin-bottom: 32px;
}

.hero .actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Sections & Cards ---------- */

section {
  padding: 72px 0;
}

.section-title {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}

.section-title .eyebrow {
  color: var(--gold-600);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.card {
  background: var(--cream-50);
  border: 1px solid var(--cream-300);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.grid {
  display: grid;
  gap: 24px;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 860px) {
  .grid-3,
  .grid-4,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--navy-950);
  color: var(--gold-400);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--navy-950);
  color: var(--cream-100);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
}

.pill-gold {
  background: var(--gold-500);
  color: var(--navy-950);
}

.band-cream {
  background: var(--cream-100);
}

.band-navy {
  background: var(--navy-950);
  color: var(--cream-100);
}

.band-navy h2,
.band-navy h3 {
  color: var(--cream-50);
}

.divider {
  height: 1px;
  background: var(--cream-300);
  margin: 48px 0;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--navy-950);
  color: var(--cream-200);
  padding: 40px 0;
  font-size: 0.9rem;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer a {
  color: var(--cream-200);
}

/* ---------- Forms ---------- */

.form-card {
  background: var(--cream-50);
  border: 1px solid var(--cream-300);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.form-row {
  margin-bottom: 22px;
}

.form-row label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--navy-900);
  margin-bottom: 8px;
}

.form-row .hint {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 6px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

@media (max-width: 640px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--cream-300);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font-sans);
  background: var(--cream-50);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
}

.field-error {
  color: var(--danger);
  font-size: 0.82rem;
  margin-top: 6px;
  display: none;
}

.form-row.invalid input,
.form-row.invalid select {
  border-color: var(--danger);
}

.form-row.invalid .field-error {
  display: block;
}

/* ---------- Diagnostic selection ---------- */

.test-choice {
  display: block;
  text-align: left;
  background: var(--cream-50);
  border: 2px solid var(--cream-300);
  border-radius: var(--radius);
  padding: 28px;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.15s ease, transform 0.15s ease;
  font-family: var(--font-sans);
  color: var(--ink);
}

.test-choice:hover {
  border-color: var(--gold-500);
  transform: translateY(-2px);
}

.test-choice.selected {
  border-color: var(--gold-500);
  background: var(--cream-200);
}

.test-choice .label {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--navy-950);
  font-weight: 700;
  margin-bottom: 6px;
}

.test-choice .meta {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* ---------- Test-taking interface ---------- */

.test-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream-100);
}

.test-topbar {
  background: var(--navy-950);
  color: var(--cream-100);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.test-topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.test-topbar .test-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.1rem;
}

.timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  background: var(--navy-800);
  border: 1px solid var(--navy-600);
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--cream-50);
  min-width: 92px;
  text-align: center;
}

.timer.low-time {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.progress-track {
  height: 6px;
  background: var(--navy-800);
  width: 100%;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-400), var(--gold-600));
  transition: width 0.3s ease;
}

.test-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 24px;
}

.question-card {
  background: var(--cream-50);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 44px;
  max-width: 720px;
  width: 100%;
}

.question-meta-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.question-text {
  font-size: 1.25rem;
  color: var(--navy-950);
  font-weight: 600;
  margin-bottom: 28px;
  line-height: 1.5;
}

.question-image-wrap {
  margin: 8px 0 28px;
  text-align: center;
}

.question-image {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--cream-300);
  background: #fff;
  padding: 12px;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1.5px solid var(--cream-300);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
  background: var(--cream-50);
}

.choice:hover {
  border-color: var(--gold-400);
}

.choice.selected {
  border-color: var(--gold-500);
  background: #fbf3dd;
}

.choice .choice-key {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--navy-950);
  color: var(--cream-50);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.choice.selected .choice-key {
  background: var(--gold-500);
  color: var(--navy-950);
}

.test-footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 36px;
  gap: 16px;
}

.test-footer-nav .spacer {
  flex: 1;
}

.qnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.qnav button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--cream-300);
  background: var(--cream-50);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--ink-soft);
}

.qnav button.current {
  border-color: var(--navy-900);
  color: var(--navy-900);
}

.qnav button.answered {
  background: var(--navy-950);
  color: var(--cream-50);
  border-color: var(--navy-950);
}

.qnav button.current.answered {
  background: var(--gold-500);
  border-color: var(--gold-500);
  color: var(--navy-950);
}

/* ---------- Results ---------- */

.score-hero {
  text-align: center;
  padding: 56px 40px;
}

.score-big {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 800;
  color: var(--navy-950);
  line-height: 1;
}

.score-big .range {
  font-size: 0.35em;
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-weight: 500;
}

.section-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--cream-300);
}

.section-score-row:last-child {
  border-bottom: none;
}

.bar-track {
  flex: 1;
  min-width: 60px;
  height: 10px;
  background: var(--cream-200);
  border-radius: 999px;
  margin: 0 18px;
  overflow: hidden;
}

@media (max-width: 560px) {
  .section-score-row {
    flex-wrap: wrap;
  }
  .section-score-row > div:first-child {
    min-width: 0 !important;
    width: 100%;
  }
  .bar-track {
    order: 1;
    flex: 0 0 100%;
    margin: 10px 0 0;
  }
  .section-score-row > div:last-child {
    order: 2;
    flex: 0 0 100%;
    min-width: 0 !important;
    margin-top: 6px;
    text-align: left !important;
  }
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy-700), var(--navy-950));
  border-radius: 999px;
}

.weakness-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 0;
  border-bottom: 1px solid var(--cream-300);
}

.weakness-item:last-child {
  border-bottom: none;
}

.weakness-rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.plan-card {
  background: var(--navy-950);
  color: var(--cream-100);
  border-radius: var(--radius);
  padding: 40px;
}

.plan-card h3 {
  color: var(--gold-400);
}

.cta-block {
  text-align: center;
  padding: 56px 24px;
  background: var(--cream-200);
  border-radius: var(--radius);
}

.review-block {
  background: var(--cream-100);
  border-left: 3px solid var(--cream-300);
  padding: 14px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 16px;
  font-size: 0.95rem;
}

.review-block.correct {
  border-left-color: var(--success);
}

.review-block.incorrect {
  border-left-color: var(--danger);
}

/* ---------- Utility ---------- */

.text-center {
  text-align: center;
}
.small {
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.mt-0 {
  margin-top: 0;
}
.mt-1 {
  margin-top: 8px;
}
.mt-2 {
  margin-top: 16px;
}
.mt-3 {
  margin-top: 24px;
}
.mt-4 {
  margin-top: 40px;
}
.mb-0 {
  margin-bottom: 0;
}
.hidden {
  display: none !important;
}
