/* ══════════════════════════════════════════════
   Lingum Academy · English Test · styles.css
   Navy + Gold · Premium Academic Assessment
   ══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  /* Brand palette */
  --navy: #0f1e3c;
  --navy-mid: #162547;
  --navy-light: #1e3360;
  --navy-100: #eaeff8;
  --navy-50: #f4f6fb;
  --gold: #c9a84c;
  --gold-light: #ddb96a;
  --gold-pale: #fdf6e3;
  --gold-dim: rgba(201, 168, 76, .16);
  --cream: #faf8f4;
  --white: #ffffff;

  /* Text */
  --text-primary: #0f1e3c;
  --text-secondary: #3d4f6e;
  --text-muted: #8896ae;

  /* Borders */
  --border: #dde3ed;
  --border-mid: #c5cfe2;

  /* States */
  --success: #0e7a52;
  --success-bg: #e6f4ef;
  --error: #c0392b;
  --error-bg: #fdecea;

  /* Shadows */
  --shadow-xs: 0 1px 3px rgba(15, 30, 60, .05);
  --shadow-sm: 0 2px 10px rgba(15, 30, 60, .08);
  --shadow-md: 0 6px 24px rgba(15, 30, 60, .10);
  --shadow-lg: 0 24px 64px rgba(15, 30, 60, .15);
  --shadow-gold: 0 4px 20px rgba(201, 168, 76, .32);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Transitions — split so color changes are instant */
  --t-fast: 0.12s cubic-bezier(.4, 0, .2, 1);
  --t-base: 0.22s cubic-bezier(.4, 0, .2, 1);
  --t-slow: 0.45s cubic-bezier(.4, 0, .2, 1);
  --transition: all var(--t-base);
  /* kept for legacy use */
}

/* ── Reset ─────────────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* ── Base ──────────────────────────────────────────────────── */
body {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--navy);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 36px 16px 72px;
  position: relative;
  overflow-x: hidden;
}

/* ── Ambient blobs ─────────────────────────────────────────── */
.bg-blobs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .18;
}

.blob-1 {
  width: 700px;
  height: 700px;
  top: -200px;
  left: -200px;
  background: radial-gradient(circle, #c9a84c 0%, transparent 70%);
  animation: drift1 18s ease-in-out infinite alternate;
}

.blob-2 {
  width: 500px;
  height: 500px;
  bottom: -150px;
  right: -150px;
  background: radial-gradient(circle, #3a5fa8 0%, transparent 70%);
  opacity: .12;
  animation: drift2 22s ease-in-out infinite alternate;
}

.blob-3 {
  width: 350px;
  height: 350px;
  top: 50%;
  left: 55%;
  background: radial-gradient(circle, #c9a84c 0%, transparent 70%);
  opacity: .07;
  animation: drift3 15s ease-in-out infinite alternate;
}

@keyframes drift1 {
  from {
    transform: translate(0, 0) scale(1)
  }

  to {
    transform: translate(60px, 40px) scale(1.1)
  }
}

@keyframes drift2 {
  from {
    transform: translate(0, 0) scale(1)
  }

  to {
    transform: translate(-40px, -60px) scale(1.08)
  }
}

@keyframes drift3 {
  from {
    transform: translate(0, 0)
  }

  to {
    transform: translate(30px, -50px)
  }
}

/* ── Layout ────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 720px;
  position: relative;
  z-index: 1;
}

#test-container {
  background: var(--cream);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: cardIn 0.55s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(28px) scale(.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ══════════════════════════════════════════════
   Header
══════════════════════════════════════════════ */
.site-header {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 30px 40px 26px;
  background: var(--navy);
  position: relative;
  overflow: hidden;
}

/* Subtle grid texture */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

/* Gold accent line */
.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 55%, transparent 100%);
}

.logo {
  display: block;
  height: 44px;
  width: auto;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
  position: relative;
  z-index: 1;
}

.header-text {
  position: relative;
  z-index: 1;
}

.header-text h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
  margin: 0;
}

.header-sub {
  font-size: 11px;
  color: var(--gold-light);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 600;
  margin-top: 5px;
}

/* ── Section padding ───────────────────────────────────────── */
.student-verification,
#test-content {
  padding: 36px 40px 40px;
}

/* ══════════════════════════════════════════════
   Verify card
══════════════════════════════════════════════ */
.verify-card {
  max-width: 460px;
  margin: 0 auto;
  text-align: center;
}

.verify-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--gold-light);
  margin-bottom: 22px;
  box-shadow: 0 8px 24px rgba(15, 30, 60, .22);
}

.verify-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.verify-card>p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ── Input group ───────────────────────────────────────────── */
.student-id-input {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  justify-content: center;
}

.input-wrapper {
  position: relative;
  flex: 1;
  max-width: 270px;
}

.input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input-field {
  display: block;
  width: 100%;
  padding: 13px 16px 13px 42px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--t-base), box-shadow var(--t-base);
  letter-spacing: .06em;
}

.input-field::placeholder {
  color: var(--text-muted);
  letter-spacing: .02em;
}

.input-field:focus {
  border-color: var(--navy-light);
  box-shadow: 0 0 0 3px rgba(30, 51, 96, .10);
}

/* Verification message */
.verification-message {
  min-height: 22px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  padding: 0 8px;
  transition: var(--transition);
}

.verification-message:not(:empty) {
  padding: 10px 16px;
}

.verification-message.error {
  color: var(--error);
  background: var(--error-bg);
  border: 1px solid #f5c6c2;
}

.verification-message.success {
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid #b7dfd3;
}

.id-info {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ══════════════════════════════════════════════
   Buttons
══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform var(--t-base), box-shadow var(--t-base), opacity var(--t-base);
  white-space: nowrap;
  text-decoration: none;
  min-width: 110px;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.15s;
}

.btn:hover::after {
  background: rgba(255, 255, 255, .08);
}

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

.btn-primary {
  background: linear-gradient(140deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 30, 60, .22);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--navy-light);
  color: var(--navy);
  background: var(--navy-50);
  transform: translateY(-1px);
}

.btn-submit {
  background: linear-gradient(140deg, var(--gold) 0%, var(--gold-light) 100%);
  color: var(--navy);
  font-weight: 700;
  box-shadow: var(--shadow-gold);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(201, 168, 76, .52);
}

.btn:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-restart {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  display: flex;
}

/* ══════════════════════════════════════════════
   Progress
══════════════════════════════════════════════ */
.progress-container {
  margin-bottom: 28px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.progress-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-muted);
  font-weight: 700;
}

.progress-text {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.progress-track {
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress {
  height: 100%;
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy-light) 60%, var(--gold) 100%);
  width: 0%;
  border-radius: 99px;
  transition: width 0.55s cubic-bezier(.4, 0, .2, 1);
}

.progress-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--t-base), transform var(--t-base), box-shadow var(--t-base);
  cursor: default;
}

.progress-dot.done {
  background: var(--navy-light);
  transform: scale(1.1);
}

.progress-dot.active {
  background: var(--gold);
  transform: scale(1.3);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, .22);
}

/* ── Instructions ──────────────────────────────────────────── */
.instructions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 24px;
  padding: 13px 16px;
  background: var(--navy-50);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  border-left: 3px solid var(--navy-light);
  line-height: 1.55;
}

.instructions svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--navy-light);
}

/* ══════════════════════════════════════════════
   Questions
══════════════════════════════════════════════ */
.test-page {
  animation: pageIn .28s ease both;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateX(18px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.question-container {
  margin-bottom: 16px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t-base), border-color var(--t-base);
}

.question-container:focus-within {
  border-color: var(--border-mid);
  box-shadow: var(--shadow-sm);
}

.question-header {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 16px 20px 13px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to right, var(--cream) 0%, var(--white) 100%);
}

.question-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
  letter-spacing: 0;
}

.question {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.5;
  margin: 0;
}

/* ── Options ───────────────────────────────────────────────── */
.options {
  display: flex;
  flex-direction: column;
  padding: 10px 14px 12px;
  gap: 5px;
}

.option {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 15px;
  background: var(--cream);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;

  /*
   * INSTANT SELECTION: background and border-color are intentionally
   * excluded from the transition so they change synchronously.
   * Only transform/box-shadow get easing for tactile feel.
   */
  transition:
    transform var(--t-fast),
    box-shadow var(--t-base);

  user-select: none;
  -webkit-user-select: none;
  position: relative;
}

.option:hover {
  background: var(--navy-50);
  border-color: var(--border-mid);
}

/* Active state — via JS .selected class (instant) OR CSS :has (persistent) */
.option.selected,
.option:has(input:checked) {
  background: var(--gold-pale);
  border-color: var(--gold);
  box-shadow: 0 2px 10px var(--gold-dim);
}

/* Slight nudge on hover when unselected */
.option:not(.selected):not(:has(input:checked)):hover {
  transform: translateX(2px);
}

/* Custom radio */
.option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-mid);
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  /* Color transitions are fast here for consistency */
  transition:
    border-color var(--t-fast),
    background var(--t-fast),
    box-shadow var(--t-fast);
  position: relative;
}

.option.selected input[type="radio"],
.option input[type="radio"]:checked {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: inset 0 0 0 4px var(--white), 0 0 0 1px var(--gold);
}

.option input[type="radio"]:focus-visible {
  outline: 2px solid var(--navy-light);
  outline-offset: 2px;
}

/* Option letter badge */
.option-letter {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
  /* Fast color transition */
  transition: background var(--t-fast), color var(--t-fast);
}

.option.selected .option-letter,
.option:has(input:checked) .option-letter {
  background: var(--gold);
  color: var(--navy);
}

.option label {
  cursor: pointer;
  font-size: 14.5px;
  color: var(--text-primary);
  line-height: 1.45;
  flex: 1;
  font-weight: 400;
}

.option.selected label,
.option:has(input:checked) label {
  font-weight: 500;
  color: var(--navy);
}

/* ── Navigation buttons ────────────────────────────────────── */
.navigation-buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

#prev-btn {
  margin-right: auto;
}

/* ══════════════════════════════════════════════
   Results
══════════════════════════════════════════════ */
.results-card {
  max-width: 460px;
  margin: 0 auto;
  text-align: center;
  padding: 8px 0;
  animation: pageIn .4s ease both;
}

.results-header {
  margin-bottom: 32px;
}

.results-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--gold-light);
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(15, 30, 60, .22);
}

.results-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.65rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.results-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Score ring */
.score-container {
  margin-bottom: 28px;
}

.score-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 168px;
  height: 168px;
  margin: 0 auto 16px;
}

.ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 9;
}

.ring-fill {
  fill: none;
  stroke: var(--gold);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 1.3s cubic-bezier(.4, 0, .2, 1);
}

.score-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-pct {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.score-frac {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.score-label {
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 22px;
  border-radius: 99px;
  display: inline-block;
  letter-spacing: .01em;
}

.score-label.label-great {
  background: var(--success-bg);
  color: var(--success);
}

.score-label.label-good {
  background: #e8f4fd;
  color: #1a6fa8;
}

.score-label.label-ok {
  background: #fff8e1;
  color: #a0780a;
}

.score-label.label-low {
  background: var(--error-bg);
  color: var(--error);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
  body {
    padding: 14px 10px 56px;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 22px 22px 18px;
  }

  .header-text h1 {
    font-size: 1.45rem;
  }

  .student-verification,
  #test-content {
    padding: 22px 18px 26px;
  }

  .student-id-input {
    flex-direction: column;
    align-items: stretch;
  }

  .input-wrapper {
    max-width: 100%;
  }

  .btn {
    width: 100%;
  }

  .navigation-buttons {
    flex-wrap: wrap;
  }

  #prev-btn {
    width: 100%;
    order: 2;
  }

  #next-btn,
  #submit-btn {
    flex: 1;
  }

  .question-header {
    padding: 13px 15px 11px;
    gap: 10px;
  }

  .options {
    padding: 8px 10px 10px;
  }

  .option {
    padding: 10px 12px;
    gap: 9px;
  }
}

@media (max-width: 400px) {
  #test-container {
    border-radius: var(--radius-lg);
  }

  .header-text h1 {
    font-size: 1.28rem;
  }
}