/* FreeMockTest student upgrades — v20260818 */
:root {
  --fmt-navy: #0a2540;
  --fmt-navy-soft: #123b63;
  --fmt-brand: #1167b1;
  --fmt-brand-light: #e6f2ff;
  --fmt-success: #087f5b;
  --fmt-success-light: #e6f6ef;
  --fmt-danger: #b42318;
  --fmt-muted: #486581;
  --fmt-muted-light: #627d98;
  --fmt-line: #d9e2ec;
  --fmt-surface: #f7fafc;
  --fmt-card: #ffffff;
  --fmt-shadow: 0 12px 34px rgba(10, 37, 64, 0.08);
  --fmt-radius: 14px;
  --fmt-radius-sm: 10px;
}

html.fmt-dark {
  --fmt-navy: #e8eef4;
  --fmt-navy-soft: #c5d4e3;
  --fmt-brand: #5eb3f5;
  --fmt-brand-light: #1a2d42;
  --fmt-success: #3ecf8e;
  --fmt-success-light: #1a3328;
  --fmt-danger: #f87171;
  --fmt-muted: #94a3b8;
  --fmt-muted-light: #64748b;
  --fmt-line: #2d3f52;
  --fmt-surface: #0f1724;
  --fmt-card: #162032;
  --fmt-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

html.fmt-dark body {
  background: #0b1220;
  color: var(--fmt-navy);
}

@supports not (overflow: clip) {
  html,
  body {
    overflow-x: hidden;
  }
}

.fmt-feed,
.fmt-pattern-note,
.fmt-student-hub,
.fmt-exam-helper,
.fmt-practice-dash,
.fmt-daily-challenge,
.fmt-results-cta,
.fmt-recent-scores {
  max-width: 1180px;
  margin: 28px auto;
  padding: 0 16px;
  animation: fmtFadeUp 0.45s ease both;
}

@keyframes fmtFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fmt-feed__shell,
.fmt-pattern-note__shell,
.fmt-submit-nudges,
.fmt-student-hub__shell,
.fmt-exam-helper__shell,
.fmt-practice-dash__shell,
.fmt-daily-challenge__shell,
.fmt-results-cta__shell,
.fmt-recent-scores__shell {
  border: 1px solid var(--fmt-line);
  border-radius: var(--fmt-radius);
  background: var(--fmt-card);
  box-shadow: var(--fmt-shadow);
}

.fmt-student-hub__shell {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 22px;
  overflow: hidden;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(17, 103, 177, 0.14), transparent 36%),
    radial-gradient(circle at bottom right, rgba(8, 127, 91, 0.08), transparent 32%),
    linear-gradient(135deg, var(--fmt-surface), var(--fmt-card) 52%, var(--fmt-success-light));
}

.fmt-student-hub__intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.fmt-student-hub__eyebrow,
.fmt-daily-challenge__eyebrow {
  width: fit-content;
  border-radius: 999px;
  background: var(--fmt-success-light);
  color: var(--fmt-success);
  font-size: 0.76rem;
  font-weight: 800;
  padding: 5px 10px;
}

.fmt-student-hub h2,
.fmt-exam-helper h2,
.fmt-practice-dash h2,
.fmt-daily-challenge h2 {
  margin: 10px 0 0;
  color: var(--fmt-navy);
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.fmt-student-hub p,
.fmt-exam-helper p,
.fmt-practice-dash p,
.fmt-daily-challenge p {
  margin: 10px 0 0;
  color: var(--fmt-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.fmt-student-hub__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.fmt-student-hub__actions a,
.fmt-results-cta__actions a,
.fmt-mobile-bar a {
  border-radius: 999px;
  background: var(--fmt-navy);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 800;
  padding: 10px 14px;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.fmt-student-hub__actions a:hover,
.fmt-results-cta__actions a:hover,
.fmt-mobile-bar a:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(10, 37, 64, 0.18);
}

.fmt-student-hub__actions a:nth-child(2),
.fmt-student-hub__actions a:nth-child(3) {
  background: var(--fmt-brand-light);
  color: var(--fmt-navy);
}

.fmt-student-hub__resume {
  background: var(--fmt-success) !important;
}

.fmt-student-hub__finder {
  border: 1px solid var(--fmt-line);
  border-radius: var(--fmt-radius-sm);
  background: rgba(255, 255, 255, 0.82);
  padding: 16px;
}

html.fmt-dark .fmt-student-hub__finder {
  background: rgba(22, 32, 50, 0.9);
}

.fmt-student-hub__finder label {
  display: block;
  color: var(--fmt-navy);
  font-size: 0.84rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.fmt-student-hub__finder input {
  width: 100%;
  border: 1px solid var(--fmt-line);
  border-radius: var(--fmt-radius-sm);
  background: var(--fmt-card);
  color: var(--fmt-navy);
  font-size: 0.95rem;
  outline: none;
  padding: 12px 13px;
}

.fmt-student-hub__finder input:focus {
  border-color: var(--fmt-brand);
  box-shadow: 0 0 0 3px rgba(17, 103, 177, 0.14);
}

.fmt-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.fmt-hub-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--fmt-line);
  border-radius: var(--fmt-radius-sm);
  background: var(--fmt-card);
  color: var(--fmt-navy);
  padding: 12px;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  position: relative;
}

.fmt-hub-card:hover {
  border-color: var(--fmt-brand);
  box-shadow: 0 10px 22px rgba(10, 37, 64, 0.1);
  transform: translateY(-1px);
}

.fmt-hub-card__label {
  font-size: 0.93rem;
  font-weight: 900;
}

.fmt-hub-card__meta {
  color: var(--fmt-muted-light);
  font-size: 0.78rem;
  line-height: 1.35;
}

.fmt-hub-card__star {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: transparent;
  color: var(--fmt-muted-light);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 2px;
}

.fmt-hub-card__star.fmt-active {
  color: #f59e0b;
}

.fmt-student-hub__empty {
  color: var(--fmt-danger) !important;
  font-size: 0.85rem !important;
}

/* Practice dashboard */
.fmt-practice-dash__shell {
  padding: 20px 22px;
}

.fmt-practice-dash__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.fmt-stat-ring {
  border: 1px solid var(--fmt-line);
  border-radius: var(--fmt-radius-sm);
  background: var(--fmt-surface);
  padding: 14px;
  text-align: center;
}

.fmt-stat-ring__value {
  display: block;
  color: var(--fmt-navy);
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1.1;
}

.fmt-stat-ring__label {
  display: block;
  margin-top: 4px;
  color: var(--fmt-muted-light);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fmt-stat-ring.fmt-streak .fmt-stat-ring__value {
  color: var(--fmt-success);
}

/* Daily challenge */
.fmt-daily-challenge__shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 20px 22px;
  background:
    linear-gradient(135deg, var(--fmt-brand-light), var(--fmt-card)),
    var(--fmt-card);
}

.fmt-daily-challenge__cta {
  border-radius: 999px;
  background: var(--fmt-brand);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 12px 18px;
  text-decoration: none;
  white-space: nowrap;
}

/* Exam helper */
.fmt-exam-helper__shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  gap: 18px;
  padding: 18px;
  background: linear-gradient(135deg, var(--fmt-card), var(--fmt-surface));
}

.fmt-exam-helper__cards {
  display: grid;
  gap: 10px;
}

.fmt-exam-helper__cards a {
  display: grid;
  gap: 3px;
  border: 1px solid var(--fmt-line);
  border-radius: var(--fmt-radius-sm);
  background: var(--fmt-card);
  color: var(--fmt-navy);
  padding: 12px;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease;
}

.fmt-exam-helper__cards a:hover {
  border-color: var(--fmt-success);
  background: var(--fmt-success-light);
}

.fmt-exam-helper__cards strong {
  font-size: 0.94rem;
}

.fmt-exam-helper__cards span {
  color: var(--fmt-muted-light);
  font-size: 0.8rem;
}

/* Live feed */
.fmt-feed__shell {
  overflow: hidden;
}

.fmt-feed__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  background: linear-gradient(135deg, #0a2540, #123b63);
  color: #ffffff;
}

.fmt-feed__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.fmt-feed__copy {
  margin: 6px 0 0;
  max-width: 720px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
  line-height: 1.55;
}

.fmt-feed__stamp {
  align-self: flex-start;
  white-space: nowrap;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 700;
}

.fmt-feed__tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 18px 0;
}

.fmt-feed__tab {
  border: 1px solid var(--fmt-line);
  border-radius: 999px;
  background: var(--fmt-surface);
  color: var(--fmt-muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 12px;
}

.fmt-feed__tab[aria-selected="true"] {
  border-color: var(--fmt-brand);
  background: var(--fmt-brand-light);
  color: var(--fmt-navy);
}

.fmt-feed__list {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.fmt-feed__item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--fmt-line);
  border-radius: var(--fmt-radius-sm);
  padding: 14px;
  background: var(--fmt-card);
}

.fmt-feed__item a {
  color: var(--fmt-navy);
  font-weight: 800;
  text-decoration: none;
}

.fmt-feed__item a:hover {
  color: var(--fmt-brand);
}

.fmt-feed__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--fmt-muted-light);
  font-size: 0.78rem;
}

.fmt-feed__badge,
.fmt-pattern-note__badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--fmt-success-light);
  color: var(--fmt-success);
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 8px;
}

.fmt-pattern-note__shell {
  padding: 16px;
}

.fmt-pattern-note__title {
  margin: 8px 0 4px;
  color: var(--fmt-navy);
  font-size: 1rem;
  font-weight: 800;
}

.fmt-pattern-note__copy {
  margin: 0;
  color: var(--fmt-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* Submit nudges */
.fmt-submit-nudges {
  margin-top: 16px;
  padding: 13px;
}

.fmt-submit-nudges__title {
  margin: 0 0 8px;
  color: var(--fmt-navy);
  font-size: 0.9rem;
  font-weight: 800;
}

.fmt-submit-nudges__list {
  display: grid;
  gap: 8px;
}

.fmt-submit-nudges__button {
  border: 1px solid var(--fmt-line);
  border-radius: var(--fmt-radius-sm);
  background: var(--fmt-surface);
  color: var(--fmt-navy);
  cursor: pointer;
  padding: 9px 10px;
  text-align: left;
  font-size: 0.83rem;
  line-height: 1.35;
}

.fmt-submit-nudges__button:hover {
  border-color: var(--fmt-brand);
  background: var(--fmt-brand-light);
}

/* Results CTA */
.fmt-results-cta__shell {
  padding: 20px 22px;
  background: linear-gradient(135deg, var(--fmt-success-light), var(--fmt-card));
}

.fmt-results-cta__message {
  margin: 8px 0 0;
  color: var(--fmt-navy);
  font-size: 1.05rem;
  font-weight: 800;
}

.fmt-results-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.fmt-results-cta__actions a.fmt-secondary {
  background: var(--fmt-brand-light);
  color: var(--fmt-navy);
}

/* Recent scores */
.fmt-recent-scores__shell {
  padding: 18px 22px;
}

.fmt-recent-scores__list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.fmt-recent-scores__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--fmt-line);
  border-radius: var(--fmt-radius-sm);
  padding: 10px 12px;
  text-decoration: none;
  color: var(--fmt-navy);
  font-size: 0.88rem;
}

.fmt-recent-scores__item:hover {
  border-color: var(--fmt-brand);
  background: var(--fmt-brand-light);
}

.fmt-recent-scores__score {
  font-weight: 900;
  color: var(--fmt-success);
}

/* Progress toast */
.fmt-progress-toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  border-radius: 999px;
  background: rgba(10, 37, 64, 0.92);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 14px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
}

.fmt-progress-toast.fmt-visible {
  opacity: 1;
}

/* Keyboard shortcuts overlay */
.fmt-shortcuts-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 37, 64, 0.55);
  padding: 20px;
}

.fmt-shortcuts-panel {
  width: min(420px, 100%);
  border-radius: var(--fmt-radius);
  background: var(--fmt-card);
  padding: 22px;
  box-shadow: var(--fmt-shadow);
}

.fmt-shortcuts-panel h3 {
  margin: 0;
  color: var(--fmt-navy);
  font-size: 1.1rem;
  font-weight: 900;
}

.fmt-shortcuts-panel p {
  margin: 8px 0 0;
  color: var(--fmt-muted);
  font-size: 0.88rem;
}

.fmt-shortcuts-grid {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.fmt-shortcuts-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.86rem;
  color: var(--fmt-navy);
}

.fmt-shortcuts-row kbd {
  border: 1px solid var(--fmt-line);
  border-radius: 6px;
  background: var(--fmt-surface);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 2px 7px;
}

.fmt-shortcuts-close {
  margin-top: 16px;
  width: 100%;
  border: none;
  border-radius: 999px;
  background: var(--fmt-navy);
  color: #ffffff;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 800;
  padding: 10px;
}

/* Dark mode toggle */
.fmt-theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9997;
  width: 44px;
  height: 44px;
  border: 1px solid var(--fmt-line);
  border-radius: 999px;
  background: var(--fmt-card);
  color: var(--fmt-navy);
  cursor: pointer;
  font-size: 1.1rem;
  box-shadow: var(--fmt-shadow);
  transition: transform 160ms ease;
}

.fmt-theme-toggle:hover {
  transform: scale(1.05);
}

/* Mobile sticky bar */
.fmt-mobile-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9996;
  display: none;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--fmt-line);
  backdrop-filter: blur(8px);
}

html.fmt-dark .fmt-mobile-bar {
  background: rgba(15, 23, 36, 0.96);
}

.fmt-mobile-bar a {
  flex: 1;
  text-align: center;
  padding: 12px 10px;
}

.fmt-mobile-bar a.fmt-secondary {
  background: var(--fmt-brand-light);
  color: var(--fmt-navy);
}

/* Timer warning */
.fmt-timer-warning {
  animation: fmtTimerPulse 1s ease infinite;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.25) !important;
}

@keyframes fmtTimerPulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.2);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(180, 35, 24, 0.35);
  }
}

/* Comparison / SEO */
.fmt-compare,
.fmt-seo-faq {
  max-width: 1180px;
  margin: 28px auto;
  padding: 0 16px;
  animation: fmtFadeUp 0.45s ease both;
}

.fmt-compare__shell,
.fmt-seo-faq__shell {
  border: 1px solid var(--fmt-line);
  border-radius: var(--fmt-radius);
  background: var(--fmt-card);
  box-shadow: var(--fmt-shadow);
  padding: 22px;
}

.fmt-compare h2,
.fmt-seo-faq h2 {
  margin: 8px 0 0;
  color: var(--fmt-navy);
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  font-weight: 900;
}

.fmt-compare p,
.fmt-seo-faq p {
  margin: 10px 0 0;
  color: var(--fmt-muted);
  line-height: 1.6;
}

.fmt-compare table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.fmt-compare th,
.fmt-compare td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--fmt-line);
  font-size: 0.9rem;
}

.fmt-compare th {
  color: var(--fmt-navy);
  font-weight: 800;
}

.fmt-compare td.fmt-yes {
  color: var(--fmt-success);
  font-weight: 800;
}

.fmt-compare td.fmt-no {
  color: var(--fmt-danger);
  font-weight: 700;
}

.fmt-compare__more {
  display: inline-block;
  margin-top: 14px;
  color: var(--fmt-brand);
  font-weight: 800;
  text-decoration: none;
}

.fmt-seo-faq details {
  border-top: 1px solid var(--fmt-line);
  padding: 12px 0;
}

.fmt-seo-faq summary {
  cursor: pointer;
  color: var(--fmt-navy);
  font-weight: 800;
}

.fmt-seo-faq details p {
  margin: 8px 0 0;
}

/* Collapse duplicate homepage sections */
.fmt-section-collapsed {
  display: none !important;
}

.fmt-exam-week {
  max-width: 1180px;
  margin: 20px auto 0;
  padding: 0 16px;
}

.fmt-exam-week__shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--fmt-line);
  border-radius: var(--fmt-radius);
  background: var(--fmt-brand-light);
  color: var(--fmt-navy);
}

.fmt-exam-week__shell p {
  margin: 4px 0 0;
  color: var(--fmt-muted);
  font-size: 0.95rem;
}

.fmt-exam-week__shell a {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--fmt-radius-sm);
  background: var(--fmt-brand);
  color: #fff;
  font-weight: 600;
}

.fmt-results-cta__note {
  margin: 8px 0 0;
  color: var(--fmt-muted);
  font-size: 0.9rem;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fmt-feed,
  .fmt-pattern-note,
  .fmt-student-hub,
  .fmt-exam-helper,
  .fmt-practice-dash,
  .fmt-daily-challenge,
  .fmt-results-cta,
  .fmt-recent-scores {
    animation: none;
  }

  .fmt-timer-warning {
    animation: none;
  }
}

@media (max-width: 720px) {
  .fmt-student-hub__shell,
  .fmt-exam-helper__shell,
  .fmt-daily-challenge__shell {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .fmt-hub-grid {
    grid-template-columns: 1fr;
  }

  .fmt-practice-dash__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fmt-feed__header {
    flex-direction: column;
  }

  .fmt-feed__stamp {
    white-space: normal;
  }

  .fmt-mobile-bar {
    display: flex;
  }

  .fmt-theme-toggle {
    bottom: 72px;
  }
}
