:root {
  --ft-red: #ee3124;
  --ft-red-strong: #c72b20;
  --ft-red-deep: #9f2219;
  --ft-ink: #1f2430;
  --ft-ink-soft: #546071;
  --ft-border: #d8dde5;
  --ft-paper: #f3f5f8;
  --ft-surface: #ffffff;
  --ft-surface-soft: #f9fafb;
  --ft-success: #0f7a4a;
  --ft-warn: #9a4f06;
  --ft-danger: #ad2119;
  --ft-navy: #111827;
  --ft-navy-soft: #1d2939;
  --shadow-lg: 0 28px 70px rgba(17, 24, 39, 0.14);
  --shadow-md: 0 12px 34px rgba(17, 24, 39, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Barlow", "Segoe UI", sans-serif;
  color: var(--ft-ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(238, 49, 36, 0.1) 0%, rgba(238, 49, 36, 0) 30%),
    radial-gradient(circle at 94% 10%, rgba(38, 72, 104, 0.12) 0%, rgba(38, 72, 104, 0) 31%),
    linear-gradient(160deg, #f7f8fa 0%, #eef2f5 48%, #f8f7f6 100%);
  padding: 18px 18px 64px;
}

body.auth-open {
  overflow: hidden;
}

.brand-ribbon {
  position: fixed;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--ft-red) 0%, #ff5f55 44%, var(--ft-red-deep) 100%);
  z-index: 20;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  z-index: -1;
}

.shape-a {
  width: 420px;
  height: 420px;
  left: -210px;
  top: 42%;
  background: radial-gradient(circle at 32% 36%, rgba(238, 49, 36, 0.14), rgba(238, 49, 36, 0));
}

.shape-b {
  width: 380px;
  height: 380px;
  right: -160px;
  top: 10%;
  background: radial-gradient(circle at 40% 30%, rgba(31, 71, 102, 0.14), rgba(31, 36, 48, 0));
}

.app-shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.card {
  border: 1px solid var(--ft-border);
  border-radius: var(--radius-xl);
  background: var(--ft-surface);
  box-shadow: var(--shadow-md);
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 30;
  min-height: 74px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 28px;
  padding: 10px 12px 10px 16px;
  border-color: rgba(216, 221, 229, 0.78);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.1);
  backdrop-filter: blur(18px);
}

.exam-picker {
  min-width: 210px;
  border: 1px solid #e1e5ea;
  border-radius: 15px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #ffffff;
}

.exam-picker-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--ft-red-strong);
  background: #fff0ef;
}

.exam-picker-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.exam-picker-copy {
  min-width: 0;
  display: grid;
  gap: 0;
}

.exam-picker-copy small {
  color: #98a2b3;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.exam-picker select {
  width: 150px;
  min-height: auto;
  border: 0;
  border-radius: 0;
  padding: 1px 22px 1px 0;
  outline: 0;
  background: transparent;
  color: var(--ft-navy);
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-overflow: ellipsis;
}

.brand-lockup {
  border: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ft-navy);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.brand-symbol {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(145deg, #f34134 0%, #bd241b 100%);
  box-shadow: 0 9px 18px rgba(199, 43, 32, 0.28);
}

.brand-symbol svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-lockup > span:last-child {
  display: grid;
  gap: 1px;
}

.brand-lockup strong {
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.brand-lockup small {
  color: #788394;
  font-size: 0.75rem;
  font-weight: 600;
}

.primary-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.primary-nav .tab-btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: transparent;
  box-shadow: none;
  color: #667085;
  font-size: 0.82rem;
}

.primary-nav .tab-btn:hover {
  border: 0;
  background: #f2f4f7;
  color: var(--ft-navy);
}

.primary-nav .tab-btn.is-active {
  border: 0;
  background: #fff0ef;
  color: var(--ft-red-strong);
  box-shadow: none;
}

.auth-trigger {
  min-width: 154px;
  border: 1px solid #e1e5ea;
  border-radius: 15px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: 34px 1fr 15px;
  align-items: center;
  gap: 9px;
  background: #ffffff;
  color: var(--ft-navy);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.auth-trigger:hover {
  border-color: rgba(238, 49, 36, 0.35);
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.09);
  transform: translateY(-1px);
}

.auth-trigger-avatar {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: #f2f4f7;
  color: #475467;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
}

.auth-trigger.is-authenticated .auth-trigger-avatar {
  color: #ffffff;
  background: linear-gradient(145deg, var(--ft-navy-soft), #344054);
}

.auth-trigger-avatar svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.auth-trigger-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
  text-align: left;
}

.auth-trigger-copy small {
  color: #98a2b3;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-trigger-copy strong {
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 0.78rem;
}

.auth-trigger-arrow {
  width: 15px;
  fill: none;
  stroke: #98a2b3;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.module.home-module {
  padding: 0;
  overflow: visible;
}

.hero {
  position: relative;
  min-height: 600px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  align-items: center;
  gap: clamp(36px, 6vw, 84px);
  padding: clamp(46px, 7vw, 86px) clamp(24px, 5vw, 68px);
  overflow: hidden;
  border: 1px solid #dce1e7;
  border-radius: 32px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.96) 52%, rgba(244, 247, 249, 0.94) 100%);
  box-shadow: var(--shadow-lg);
}

.hero::before {
  content: "";
  position: absolute;
  width: 430px;
  height: 430px;
  left: -220px;
  bottom: -290px;
  border-radius: 50%;
  background: rgba(238, 49, 36, 0.09);
}

.hero-copy,
.hero-preview {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #e4e7ec;
  border-radius: 999px;
  padding: 7px 12px;
  color: #475467;
  background: rgba(255, 255, 255, 0.84);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-kicker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ft-red);
  box-shadow: 0 0 0 4px rgba(238, 49, 36, 0.12);
}

.hero h1 {
  max-width: 700px;
  margin: 23px 0 20px;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: clamp(2.7rem, 5.4vw, 4.9rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
  color: var(--ft-navy);
}

.hero h1 span {
  color: var(--ft-red);
}

.hero-lead {
  max-width: 600px;
  margin: 0;
  color: #5b6677;
  font-size: clamp(1.03rem, 1.7vw, 1.22rem);
  line-height: 1.62;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn-large {
  min-height: 50px;
  padding: 13px 19px;
}

.btn-large svg,
.btn-light svg,
.btn-auth-submit svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-primary,
.btn-light,
.btn-auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.btn-quiet {
  border: 1px solid #dfe3e8;
  background: #ffffff;
  color: #344054;
  box-shadow: none;
}

.btn-quiet:hover {
  background: #f8fafc;
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 27px;
}

.hero-proof span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #667085;
  font-size: 0.82rem;
  font-weight: 600;
}

.hero-proof svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #15905a;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-preview {
  min-height: 420px;
  display: grid;
  align-items: center;
}

.preview-glow {
  position: absolute;
  inset: 5% 2% 0 5%;
  border-radius: 45%;
  background: radial-gradient(circle, rgba(238, 49, 36, 0.16), rgba(29, 41, 57, 0.04) 48%, transparent 72%);
  filter: blur(8px);
}

.practice-preview {
  position: relative;
  z-index: 2;
  width: min(100%, 490px);
  margin: 0 auto;
  padding: 24px;
  border: 1px solid rgba(215, 221, 229, 0.95);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 70px rgba(17, 24, 39, 0.18);
  transform: rotate(1.5deg);
}

.practice-preview-head,
.practice-preview-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.practice-preview-head > div {
  display: grid;
  gap: 3px;
}

.preview-label {
  color: #98a2b3;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.practice-preview-head strong {
  color: var(--ft-navy);
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 0.9rem;
}

.preview-counter {
  border-radius: 999px;
  padding: 5px 9px;
  background: #f2f4f7;
  color: #475467;
  font-size: 0.72rem;
  font-weight: 700;
}

.preview-progress {
  height: 6px;
  margin: 18px 0 21px;
  overflow: hidden;
  border-radius: 999px;
  background: #eceff3;
}

.preview-progress span {
  display: block;
  width: 34%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ft-red), #ff6a60);
}

.preview-question {
  margin: 0 0 16px;
  color: #293445;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
}

.preview-options {
  display: grid;
  gap: 8px;
}

.preview-options span {
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #e4e7ec;
  border-radius: 11px;
  padding: 10px 12px;
  color: #667085;
  background: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
}

.preview-options .is-selected {
  border-color: #80cba5;
  color: #0b6f45;
  background: #edf9f2;
}

.preview-options i {
  width: 16px;
  height: 16px;
  border: 5px solid #15905a;
  border-radius: 50%;
  background: #ffffff;
}

.practice-preview-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #eceff3;
}

.preview-success {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0b6f45;
  font-size: 0.75rem;
  font-weight: 700;
}

.preview-success svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
}

.preview-score {
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--ft-red-strong);
  background: #fff0ef;
  font-size: 0.72rem;
  font-weight: 700;
}

.floating-stat {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(224, 228, 234, 0.92);
  border-radius: 15px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 30px rgba(17, 24, 39, 0.14);
  backdrop-filter: blur(10px);
}

.floating-stat-top {
  top: 8%;
  right: -3%;
}

.floating-stat-bottom {
  bottom: 6%;
  left: -3%;
}

.floating-stat > span {
  display: grid;
}

.floating-stat small {
  color: #98a2b3;
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
}

.floating-stat strong {
  color: var(--ft-navy);
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 0.85rem;
}

.floating-stat-bottom > strong {
  color: var(--ft-red);
  font-size: 1.24rem;
}

.floating-stat b {
  color: #15905a;
  font-size: 0.68rem;
}

.floating-icon {
  width: 32px;
  height: 32px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #ffffff;
  background: var(--ft-navy-soft);
}

.floating-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.value-section {
  padding: 88px 0 78px;
}

.section-heading {
  max-width: 720px;
  margin: 0 auto 38px;
  text-align: center;
}

.section-heading p,
.journey-copy p {
  margin: 0 0 10px;
  color: var(--ft-red);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.section-heading h2,
.journey-copy h2 {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: clamp(1.8rem, 3.4vw, 2.7rem);
  line-height: 1.2;
  letter-spacing: -0.04em;
  color: var(--ft-navy);
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.value-card {
  min-height: 230px;
  padding: 25px;
  border: 1px solid #dde2e8;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.value-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 38px rgba(17, 24, 39, 0.1);
}

.value-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}

.value-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.value-icon-red {
  color: #c92d22;
  background: #fff0ef;
}

.value-icon-green {
  color: #0c7b4a;
  background: #eaf8f0;
}

.value-icon-blue {
  color: #285d96;
  background: #eaf2fb;
}

.value-card h3 {
  margin: 19px 0 9px;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 1.06rem;
}

.value-card p {
  margin: 0;
  color: #667085;
  line-height: 1.55;
}

.journey-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(430px, 1.35fr) auto;
  align-items: center;
  gap: 34px;
  padding: 34px;
  overflow: hidden;
  border-radius: 26px;
  color: #ffffff;
  background:
    radial-gradient(circle at 78% 20%, rgba(238, 49, 36, 0.22), transparent 34%),
    linear-gradient(125deg, #111827 0%, #1d2939 100%);
  box-shadow: 0 24px 48px rgba(17, 24, 39, 0.22);
}

.journey-copy p {
  color: #ff8178;
}

.journey-copy h2 {
  color: #ffffff;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
}

.journey-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.journey-steps li {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.journey-steps span {
  color: #ff8178;
  font-size: 0.68rem;
  font-weight: 800;
}

.journey-steps strong {
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 0.85rem;
}

.journey-steps small {
  color: #aeb7c5;
  line-height: 1.3;
}

.btn-light {
  min-height: 46px;
  background: #ffffff;
  color: var(--ft-navy);
  white-space: nowrap;
}

.tab-btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 14px;
  background: transparent;
  color: var(--ft-ink-soft);
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  border-color: rgba(238, 49, 36, 0.25);
  background: #fff6f5;
  color: var(--ft-red-strong);
}

.tab-btn.is-active {
  border-color: rgba(238, 49, 36, 0.34);
  background: linear-gradient(135deg, var(--ft-red) 0%, var(--ft-red-strong) 100%);
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(199, 43, 32, 0.35);
}

.module {
  display: none;
  padding: 24px;
  animation: rise 0.45s ease;
}

.module.is-visible {
  display: block;
}

#admin-module {
  border-top: 5px solid var(--ft-red);
}

#study-module {
  border-top: 5px solid var(--ft-success);
}

#exam-module {
  border-top: 5px solid #273445;
}

#leaderboard-module {
  border-top: 5px solid #2e5d9f;
}

.module-title-wrap h2 {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 1.45rem;
}

.module-title-wrap p {
  margin: 7px 0 18px;
  color: var(--ft-ink-soft);
}

.settings-card {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid #cfd7e0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #f8fafc 0%, #fff8f7 100%);
}

.exam-management-card {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid #d8dee7;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0%, rgba(238, 49, 36, 0.09), transparent 30%),
    #ffffff;
}

.exam-management-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.exam-management-head h3,
.exam-management-head p {
  margin: 0;
}

.exam-management-head > div > p:last-child {
  margin-top: 6px;
  color: var(--ft-ink-soft);
}

.section-eyebrow {
  margin: 0 0 6px !important;
  color: var(--ft-red) !important;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.exam-catalog-form {
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.8fr;
  align-items: end;
  gap: 12px;
}

.exam-catalog-form > div {
  display: grid;
  gap: 7px;
}

.exam-description-field {
  grid-column: 1 / 3;
}

.catalog-active-toggle {
  min-height: 47px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--ft-border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fafc;
}

.catalog-active-toggle input {
  width: auto;
  margin: 0;
}

.settings-card h3,
.settings-card p {
  margin: 0;
}

.settings-card > div > p {
  margin-top: 6px;
  color: var(--ft-ink-soft);
}

.settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.settings-form > div {
  display: grid;
  gap: 7px;
}

.settings-toggle {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #cfd7e0;
  border-radius: var(--radius-md);
  background: #ffffff;
  cursor: pointer;
}

.settings-toggle input {
  width: auto;
  margin: 3px 0 0;
}

.settings-toggle span {
  display: grid;
  gap: 3px;
}

.settings-toggle small {
  color: var(--ft-ink-soft);
  font-weight: 400;
}

.settings-summary,
.section-note {
  color: var(--ft-ink-soft);
}

.settings-status {
  display: none;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-weight: 700;
}

.settings-status:not(:empty) {
  display: block;
}

.settings-status[data-tone="success"] {
  border: 1px solid #a9dbc1;
  background: #eaf8f0;
  color: var(--ft-success);
}

.settings-status[data-tone="error"] {
  border: 1px solid #edb4af;
  background: #fff0ef;
  color: var(--ft-danger);
}

.grid-form {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

label {
  font-weight: 700;
  color: #273445;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--ft-border);
  background: #ffffff;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  color: var(--ft-ink);
}

input[type="file"] {
  padding: 10px;
}

input[type="radio"] {
  accent-color: var(--ft-red);
}

input[type="checkbox"] {
  accent-color: var(--ft-red);
}

textarea:focus,
input:focus,
select:focus {
  outline: 2px solid rgba(238, 49, 36, 0.2);
  border-color: var(--ft-red);
}

.image-preview-wrap {
  display: none;
  border: 1px dashed rgba(238, 49, 36, 0.4);
  border-radius: var(--radius-md);
  padding: 10px;
  background: #fff8f7;
}

.image-preview-wrap.is-visible {
  display: block;
}

.preview-title {
  margin: 0 0 8px;
  color: var(--ft-ink-soft);
  font-weight: 700;
}

.field-group {
  display: grid;
  gap: 10px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-toggle {
  border: 1px solid var(--ft-border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;
}

.choice-toggle input {
  width: auto;
  margin: 0;
}

.field-hint {
  margin: -2px 0 0;
  color: var(--ft-ink-soft);
  font-size: 0.92rem;
}

.auth-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  justify-content: flex-end;
  padding: 14px;
  background: rgba(13, 20, 31, 0.56);
  backdrop-filter: blur(8px);
}

.auth-dialog.is-open {
  display: flex;
  animation: fade-in 0.2s ease;
}

.auth-dialog-panel {
  position: relative;
  width: min(470px, 100%);
  height: 100%;
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 26px;
  padding: 42px 34px 30px;
  background: #ffffff;
  box-shadow: 0 32px 90px rgba(5, 10, 18, 0.3);
  animation: slide-in 0.28s ease;
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #667085;
  cursor: pointer;
}

.auth-close:hover {
  color: var(--ft-navy);
  background: #f8fafc;
}

.auth-close svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.auth-dialog-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-right: 42px;
}

.auth-dialog-brand > span:last-child {
  display: grid;
  gap: 4px;
}

.auth-dialog-brand small {
  color: var(--ft-red);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.auth-dialog-brand h2 {
  margin: 0;
  color: var(--ft-navy);
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 1.35rem;
  letter-spacing: -0.035em;
}

.auth-dialog-intro {
  margin: 20px 0;
  color: #667085;
  line-height: 1.5;
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 15px;
  padding: 5px;
  border-radius: 13px;
  background: #f2f4f7;
}

.auth-mode-btn {
  border: 0;
  border-radius: 10px;
  padding: 10px;
  background: transparent;
  color: #667085;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.auth-mode-btn.is-active {
  color: var(--ft-navy);
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.08);
}

.auth-status {
  display: none;
  border: 1px solid #e4e7ec;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 0.86rem;
  font-weight: 700;
  background: #f8fafc;
  color: var(--ft-ink-soft);
}

.auth-status:not(:empty) {
  display: block;
}

.auth-status[data-tone="success"] {
  border-color: #8ec7a8;
  background: #eaf8f0;
  color: var(--ft-success);
}

.auth-status[data-tone="error"] {
  border-color: #e8a8a2;
  background: #fff3f2;
  color: var(--ft-danger);
}

.auth-status[data-tone="warn"] {
  border-color: #f1c89f;
  background: #fff6ec;
  color: var(--ft-warn);
}

.auth-form {
  display: grid;
  gap: 9px;
}

.auth-form-view {
  display: none;
}

.auth-form-view.is-visible {
  display: grid;
  animation: rise 0.2s ease;
}

.auth-form label,
.auth-password-grid label {
  margin-top: 3px;
  font-size: 0.84rem;
}

.auth-form input {
  min-height: 47px;
  border-color: #d7dce3;
}

.input-with-icon {
  position: relative;
}

.input-with-icon svg {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: #98a2b3;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.input-with-icon input {
  padding-left: 41px;
}

.auth-password-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.auth-password-grid > div {
  display: grid;
  gap: 9px;
}

.btn-auth-submit {
  width: 100%;
  min-height: 49px;
  margin-top: 9px;
}

.auth-session-panel {
  min-height: 100%;
  display: none;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.auth-session-panel.is-visible {
  display: grid;
}

.auth-session-avatar {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 26px;
  color: #ffffff;
  background: linear-gradient(145deg, var(--ft-navy-soft), #3b4657);
  box-shadow: 0 16px 30px rgba(17, 24, 39, 0.18);
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.auth-session-eyebrow {
  margin: 22px 0 7px;
  color: #15905a;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.auth-session-panel h2 {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 1.55rem;
}

.auth-session-panel > p:not(.auth-session-eyebrow) {
  margin: 7px 0 12px;
  color: #667085;
}

.auth-session-role {
  margin-bottom: 20px;
  border-radius: 999px;
  padding: 5px 10px;
  color: #344054;
  background: #eef2f6;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.user-banner {
  display: none;
  border: 1px solid rgba(199, 43, 32, 0.26);
  border-radius: 12px;
  background: #fff6f5;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.user-banner p {
  margin: 0;
}

.question-image-slot {
  display: none;
  margin: 10px 0 14px;
}

.question-image-slot.is-visible {
  display: block;
}

.question-media {
  margin: 10px 0 12px;
}

.question-image {
  width: min(100%, 640px);
  max-height: 360px;
  object-fit: contain;
  display: block;
  border: 1px solid var(--ft-border);
  border-radius: 12px;
  background: #f7fafc;
}

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

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

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

.btn:disabled {
  cursor: wait;
  filter: grayscale(0.35);
  opacity: 0.65;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--ft-red) 0%, var(--ft-red-strong) 100%);
  color: #ffffff;
  box-shadow: 0 9px 16px rgba(199, 43, 32, 0.34);
}

.btn-soft {
  background: #eef2f6;
  color: #253243;
}

.btn-danger {
  background: linear-gradient(135deg, #bf2a21 0%, #951f18 100%);
  color: #ffffff;
}

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.list-head h3 {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
}

.question-list {
  display: grid;
  gap: 12px;
}

.question-card {
  position: relative;
  border: 1px solid var(--ft-border);
  border-radius: var(--radius-lg);
  padding: 14px 14px 14px 18px;
  background: #ffffff;
}

.question-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  border-radius: 16px 0 0 16px;
  background: linear-gradient(180deg, var(--ft-red) 0%, var(--ft-red-deep) 100%);
}

.study-question-list .question-card::before {
  background: linear-gradient(180deg, #16a365 0%, var(--ft-success) 100%);
}

.question-card h4 {
  margin: 0 0 8px;
}

.question-options {
  margin: 0;
  padding-left: 18px;
  color: var(--ft-ink-soft);
}

.question-options li + li {
  margin-top: 4px;
}

.study-instruction {
  margin: 10px 0;
  color: var(--ft-ink-soft);
  font-weight: 700;
}

.study-choice-list {
  display: grid;
  gap: 8px;
}

.study-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--ft-border);
  border-radius: var(--radius-md);
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.study-choice:hover {
  border-color: rgba(15, 122, 74, 0.45);
  background: #f4fbf7;
}

.study-choice input {
  width: auto;
  margin: 3px 0 0;
}

.study-choice.is-answer-correct {
  border-color: #79c99d;
  background: #eaf8f0;
  color: #0b633c;
}

.study-choice.is-answer-wrong {
  border-color: #e5a09a;
  background: #fff1f0;
  color: var(--ft-danger);
}

.study-practice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.study-feedback {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-weight: 700;
}

.study-feedback[data-tone="success"] {
  border: 1px solid #b9dfca;
  background: #edf9f2;
  color: #0b633c;
}

.study-feedback[data-tone="error"] {
  border: 1px solid #e5a09a;
  background: #fff1f0;
  color: var(--ft-danger);
}

.study-feedback[data-tone="warn"] {
  border: 1px solid #f1c89f;
  background: #fff6ec;
  color: var(--ft-warn);
}

.question-foot {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.question-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  border-radius: 999px;
  background: #ffe8e5;
  color: var(--ft-red-strong);
  padding: 4px 10px;
  font-weight: 700;
  font-size: 0.85rem;
}

.badge-neutral {
  background: #edf2f7;
  color: #344255;
}

.empty-state {
  border: 1px dashed #cfd7e0;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
  background: #f8fafc;
  color: var(--ft-ink-soft);
}

.inline-empty {
  margin-bottom: 10px;
}

.inline-empty p {
  margin: 0;
}

.start-form {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.exam-panel,
.exam-result {
  display: none;
}

.exam-panel.is-visible,
.exam-result.is-visible {
  display: block;
}

.exam-head {
  margin-bottom: 10px;
}

.exam-head p {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  color: var(--ft-red-strong);
  font-weight: 700;
}

.exam-head h3 {
  margin: 6px 0 0;
  line-height: 1.32;
}

.question-type-note {
  margin: 8px 0 0;
  color: var(--ft-ink-soft);
  font-weight: 700;
}

.answer-form {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.answer-item {
  border: 1px solid var(--ft-border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transition: transform 0.16s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.answer-item:hover {
  border-color: rgba(238, 49, 36, 0.4);
  background: #fff7f6;
  transform: translateX(1px);
}

.answer-item input {
  width: auto;
  margin-top: 2px;
}

.result-box {
  border: 1px solid var(--ft-border);
  border-radius: var(--radius-lg);
  background: #ffffff;
  padding: 16px;
}

.result-title {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
}

.score {
  margin: 8px 0 12px;
  font-size: 1.08rem;
  font-weight: 700;
}

.review-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ft-ink-soft);
}

.review-list li + li {
  margin-top: 8px;
}

.is-correct {
  color: #0f7a4a;
  font-weight: 700;
}

.is-wrong {
  color: #a91f19;
  font-weight: 700;
}

.leaderboard-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.leaderboard-head p {
  margin: 0;
  color: var(--ft-ink-soft);
  font-weight: 700;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.leaderboard-card {
  border: 1px solid var(--ft-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: #ffffff;
}

.leaderboard-card h3 {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
}

.leaderboard-note {
  margin: 6px 0 10px;
  color: var(--ft-ink-soft);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
}

.leaderboard-table th,
.leaderboard-table td {
  border-bottom: 1px solid #e6ebf2;
  padding: 9px 8px;
  text-align: left;
  font-size: 0.92rem;
}

.leaderboard-table th {
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #4a5a6f;
}

.rank-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  border-radius: 999px;
  padding: 3px 8px;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  background: #e6eefc;
  color: #214a8d;
}

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

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(26px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 1060px) {
  .topbar {
    grid-template-columns: 1fr auto auto;
    gap: 8px 18px;
  }

  .primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    overflow-x: auto;
    padding-top: 4px;
    scrollbar-width: none;
  }

  .primary-nav::-webkit-scrollbar {
    display: none;
  }

  .leaderboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 50px;
  }

  .hero-copy {
    text-align: center;
  }

  .hero-kicker,
  .hero-actions,
  .hero-proof {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions,
  .hero-proof {
    justify-content: center;
  }

  .hero-lead {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-preview {
    width: min(560px, 100%);
    margin: 0 auto;
  }

  .value-grid {
    grid-template-columns: 1fr;
  }

  .value-card {
    min-height: auto;
  }

  .journey-card {
    grid-template-columns: 1fr;
  }

  .journey-copy {
    max-width: 520px;
  }

  .settings-form {
    grid-template-columns: 1fr;
  }

  .exam-catalog-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .exam-description-field {
    grid-column: 1 / -1;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 740px) {
  body {
    padding: 8px 10px 42px;
  }

  .topbar {
    top: 6px;
    min-height: 64px;
    padding: 8px 9px 8px 11px;
    border-radius: 18px;
  }

  .brand-symbol {
    width: 37px;
    height: 37px;
    flex-basis: 37px;
    border-radius: 12px;
  }

  .brand-lockup small {
    display: none;
  }

  .auth-trigger {
    min-width: 44px;
    grid-template-columns: 32px;
    padding: 6px;
  }

  .exam-picker {
    min-width: 0;
    padding: 6px 8px;
  }

  .exam-picker-icon {
    display: none;
  }

  .exam-picker select {
    width: 118px;
  }

  .auth-trigger-copy,
  .auth-trigger-arrow {
    display: none;
  }

  .primary-nav .tab-btn {
    flex: 0 0 auto;
    padding: 9px 11px;
  }

  .hero {
    min-height: auto;
    padding: 45px 20px 42px;
    border-radius: 24px;
  }

  .hero h1 {
    font-size: clamp(2.35rem, 12vw, 3.45rem);
  }

  .hero-actions {
    display: grid;
  }

  .hero-proof {
    display: grid;
    justify-content: center;
    text-align: left;
  }

  .hero-preview {
    min-height: 380px;
  }

  .practice-preview {
    padding: 19px;
    transform: none;
  }

  .floating-stat-top {
    top: -5%;
    right: -2%;
  }

  .floating-stat-bottom {
    bottom: -2%;
    left: -2%;
  }

  .value-section {
    padding: 64px 0 58px;
  }

  .journey-card {
    padding: 26px 20px;
  }

  .journey-steps {
    grid-template-columns: 1fr;
  }

  .auth-dialog {
    padding: 0;
  }

  .auth-dialog-panel {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
    padding: 58px 22px 28px;
  }

  .module {
    padding: 18px;
  }

  .home-module {
    padding: 0;
  }

  .list-head,
  .exam-management-head,
  .leaderboard-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .actions {
    width: 100%;
  }

  .btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 520px) {
  .topbar {
    grid-template-columns: 1fr auto auto;
    gap: 7px;
  }

  .exam-picker {
    border-radius: 12px;
  }

  .exam-picker-copy small {
    display: none;
  }

  .exam-picker select {
    width: 92px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .exam-catalog-form {
    grid-template-columns: 1fr;
  }

  .exam-description-field {
    grid-column: auto;
  }

  .auth-password-grid {
    grid-template-columns: 1fr;
  }

  .auth-dialog-brand h2 {
    font-size: 1.18rem;
  }

  .practice-preview-head,
  .practice-preview-foot {
    align-items: flex-start;
  }

  .floating-stat {
    transform: scale(0.88);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
