:root {
  --navy-900: #0b1240;
  --navy-800: #141d5c;
  --navy-700: #22307f;
  --gold: #ffc72c;
  --gold-soft: #fff4d1;
  --red: #e3262f;
  --ink: #1b1f3b;
  --muted: #5b6185;
  --line: #e2e5f1;
  --bg: #f4f6fb;
  --white: #ffffff;
  --green: #1f9d55;
  --radius: 14px;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.6; }
a { color: var(--navy-700); }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 20px; }
.center { text-align: center; }
.hint { color: var(--muted); font-size: 14px; }

/* ---------- header / footer ---------- */
.site-head { position: relative; background: var(--white); border-bottom: 4px solid var(--gold); box-shadow: 0 4px 18px rgba(11, 18, 64, .06); }
.head-row { display: flex; align-items: center; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--navy-900); text-decoration: none; padding: 8px 0; }
.brand img { height: 52px; width: auto; display: block; }
.brand .brand-sep { display: block; width: 1.5px; height: 40px; background: var(--line); }
.brand span { font-weight: 800; font-size: 19px; line-height: 1.2; margin-left: 2px; }
.brand small { display: block; margin-top: 2px; font-weight: 700; font-size: 13.5px; color: var(--navy-700); letter-spacing: .2px; }
.site-foot { color: var(--muted); font-size: 12px; text-align: center; padding: 32px 20px; }

/* ---------- hero ---------- */
.hero { margin: 32px 0 24px; padding: 32px; border-radius: var(--radius); color: var(--white);
  background: radial-gradient(circle at 90% 20%, rgba(56, 84, 214, .6), transparent 50%), linear-gradient(120deg, var(--navy-900), var(--navy-700)); }
.kicker { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); }
.hero h1 { margin: 8px 0 12px; font-size: clamp(26px, 5vw, 38px); line-height: 1.15; }
.hl { color: var(--gold); }
.lead { margin: 0; max-width: 620px; color: rgba(255, 255, 255, .85); }
.result .lead { color: var(--muted); }
.facts { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 20px 0 0; }
.facts li { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 199, 44, .5); border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.facts b { color: var(--gold); }

/* ---------- cards ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 0 0 16px; }
.test-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.test-card { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; border-top: 5px solid var(--gold); }
.test-card h2 { margin: 0 0 6px; font-size: 22px; }
.test-card p { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.test-card.is-closed { border-top-color: var(--line); }
.test-step { position: absolute; top: 16px; right: 20px; font-size: 40px; font-weight: 800; color: var(--line); }
.topics-box { background: var(--gold-soft); border-radius: var(--radius); padding: 18px 22px; }
.topics-box h3 { margin: 0 0 6px; font-size: 16px; }
.topics-box ol { margin: 0; padding-left: 20px; columns: 2; font-size: 14px; }

/* ---------- buttons ---------- */
.btn { display: inline-block; border: 1.5px solid var(--navy-700); color: var(--navy-700); background: var(--white); font: inherit; font-weight: 700; font-size: 14px;
  padding: 10px 18px; border-radius: 10px; cursor: pointer; text-decoration: none; transition: transform .1s, background .15s; }
.btn:hover { background: var(--bg); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--navy-700); color: var(--white); }
.btn-primary:hover { background: var(--navy-800); }
.btn-disabled { border-color: var(--line); color: var(--muted); cursor: not-allowed; }
.link-danger { background: none; border: 0; color: var(--red); font: inherit; font-size: 12px; cursor: pointer; padding: 0; }

/* ---------- form ---------- */
.page-title { font-size: 26px; margin: 24px 0 16px; }
legend { font-weight: 800; padding: 0 6px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--navy-700); text-transform: uppercase; letter-spacing: 1px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.span-2 { grid-column: span 2; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
input, select { font: inherit; font-weight: 500; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--white); }
input:focus, select:focus { outline: none; border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(34, 48, 127, .15); }
.q-num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: var(--navy-900); font-size: 13px; }
.q-text { font-size: 16px; font-weight: 600; margin: 4px 0 12px; }
.option { flex-direction: row; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; margin-bottom: 8px; font-weight: 500; cursor: pointer; transition: border-color .15s, background .15s; }
.option:hover { border-color: var(--navy-700); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.opt-letter { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.option:has(input:checked) { border-color: var(--navy-700); background: #eef1ff; }
.option:has(input:checked) .opt-letter { background: var(--navy-700); border-color: var(--navy-700); color: var(--white); }
.option:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(34, 48, 127, .25); }
.question.missing { border-color: var(--red); }
.submit-bar { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; box-shadow: 0 -6px 20px rgba(11, 18, 64, .08); }
.form-error { color: var(--red); font-weight: 600; min-height: 1em; }
.alert { background: #fdecec; border: 1px solid #f5b5b8; color: #8f1d22; border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.notice { background: var(--gold-soft); border-radius: 10px; padding: 12px 16px; margin: 16px 0; }
.progress { position: sticky; top: 0; z-index: 5; height: 5px; background: var(--line); }
.progress-bar { height: 100%; width: 0; background: var(--gold); transition: width .25s; }

/* ---------- result ---------- */
.result { margin-top: 28px; text-align: left; }
.result h1 { margin: 6px 0; font-size: 28px; }
.score-ring { --score: 0; width: 170px; height: 170px; margin: 20px auto 8px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--white) 78%, transparent 79%), conic-gradient(var(--gold) calc(var(--score) * 1%), var(--line) 0); }
.score-ring span { font-size: 48px; font-weight: 800; line-height: 1; color: var(--navy-900); }
.score-ring small { color: var(--muted); }
.compare { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; margin: 18px 0; padding: 14px; background: var(--bg); border-radius: 12px; }
.compare div { text-align: center; min-width: 90px; }
.compare small { display: block; color: var(--muted); font-size: 12px; }
.compare b { font-size: 26px; }
.compare em { display: block; font-style: normal; font-weight: 700; color: var(--green); font-size: 13px; }
.compare .arrow { font-size: 24px; color: var(--muted); min-width: 0; }
.topic-bars { display: grid; gap: 10px; }
.topic-row { display: grid; grid-template-columns: 190px minmax(0, 1fr) 90px; align-items: center; gap: 12px; font-size: 14px; }
.topic-row b { text-align: right; }
.track { height: 12px; background: var(--line); border-radius: 999px; overflow: hidden; }
.fill { height: 100%; background: var(--navy-700); border-radius: 999px; animation: grow .9s ease-out; transform-origin: left; }
.fill.pre { background: #a9b2dc; }
.fill.post { background: var(--gold); }
.track-stack { display: grid; gap: 4px; }
@keyframes grow { from { transform: scaleX(0); } }

/* ---------- admin ---------- */
.login-card { max-width: 380px; margin: 48px auto; display: grid; gap: 14px; }
.login-card .page-title { margin: 0; }
.admin-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.admin-actions { display: flex; gap: 8px; }
.toggle-row { display: flex; flex-wrap: wrap; gap: 16px; }
.toggle-row form { display: flex; align-items: center; gap: 10px; }
.status { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.status.on { background: #e3f6ea; color: var(--green); }
.status.off { background: #fdecec; color: var(--red); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat small { display: block; color: var(--muted); font-size: 12px; }
.stat b { font-size: 28px; }
.stat em { font-style: normal; font-weight: 700; margin-left: 6px; color: var(--green); }
.stat.accent { background: var(--navy-900); color: var(--white); border-color: var(--navy-900); }
.stat.accent small { color: rgba(255, 255, 255, .7); }
.stat.accent em { color: var(--gold); }
.legend { font-size: 13px; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-left: 10px; }
.sw.pre { background: #a9b2dc; margin-left: 0; }
.sw.post { background: var(--gold); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.data-table th { text-align: left; background: var(--bg); padding: 8px 10px; font-weight: 700; }
.data-table td { padding: 8px 10px; border-top: 1px solid var(--line); }
.row-actions { display: flex; gap: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .hero { padding: 24px 20px; }
  .test-grid, .field-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .topics-box ol { columns: 1; }
  .topic-row { grid-template-columns: minmax(0, 1fr) 80px; }
  .topic-row .track, .topic-row .track-stack { grid-column: 1 / -1; grid-row: 2; }
  .brand span { font-size: 16px; }
  .brand img { height: 42px; }
  .brand small { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- steps ---------- */
.step-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.btn-lg { padding: 12px 26px; font-size: 15px; }
.step-enter { animation: stepIn .5s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes stepIn { from { opacity: 0; transform: translateY(24px); } }

/* ---------- overlay: loading ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
  background: rgba(11, 18, 64, .82); backdrop-filter: blur(6px); animation: fadeIn .3s ease both; }
.overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.loader { text-align: center; color: var(--white); width: min(320px, 100%); }
.loader-orbit { position: relative; width: 170px; height: 170px; margin: 0 auto 26px; }
.ring { position: absolute; inset: 0; border-radius: 50%; border: 5px solid transparent; }
.ring-gold { border-top-color: var(--gold); border-right-color: var(--gold); animation: spin 1.1s cubic-bezier(.6, .1, .4, .9) infinite; }
.ring-navy { inset: 16px; border-bottom-color: #7f93ff; border-left-color: #7f93ff; animation: spin 1.6s linear infinite reverse; }
.ring-dash { inset: -14px; border: 2px dashed rgba(255, 199, 44, .35); animation: spin 8s linear infinite; }
.dot { position: absolute; top: 50%; left: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: var(--gold); }
.dot-a { animation: orbit 2.4s linear infinite; }
.dot-b { animation: orbit 2.4s linear infinite -.8s; background: var(--red); }
.dot-c { animation: orbit 2.4s linear infinite -1.6s; background: var(--white); }
@keyframes orbit { from { transform: rotate(0deg) translateX(100px); } to { transform: rotate(360deg) translateX(100px); } }
@keyframes spin { to { transform: rotate(360deg); } }
.loader-core { position: absolute; inset: 34px; border-radius: 50%; background: var(--white); display: grid; place-items: center;
  box-shadow: 0 0 0 0 rgba(255, 199, 44, .6); animation: pulse 1.6s ease-out infinite; }
.loader-core img { width: 72%; }
@keyframes pulse { 70% { box-shadow: 0 0 0 22px rgba(255, 199, 44, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 199, 44, 0); } }
.loader-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.loader-status { margin: 4px 0 16px; min-height: 1.6em; color: rgba(255, 255, 255, .8); font-size: 14px; animation: blinkText 1s ease infinite alternate; }
@keyframes blinkText { from { opacity: .55; } }
.loader-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #fff1b8, var(--gold)); background-size: 200% 100%;
  animation: shimmer 1s linear infinite; transition: width .4s ease; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- overlay: confirm modal ---------- */
.modal { position: relative; width: min(440px, 100%); background: var(--white); border-radius: 20px; padding: 34px 28px 26px; text-align: center;
  border-top: 6px solid var(--gold); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); animation: popIn .45s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes popIn { from { opacity: 0; transform: scale(.85) translateY(20px); } }
.modal-icon { width: 64px; height: 64px; margin: -66px auto 12px; border-radius: 50%; background: var(--navy-700); color: var(--gold);
  display: grid; place-items: center; font-size: 32px; font-weight: 800; border: 5px solid var(--white); }
.modal h2 { margin: 0 0 6px; font-size: 21px; line-height: 1.3; }
.modal h2 span { color: var(--navy-700); }
.modal-name { margin: 0 0 14px; color: var(--muted); }
.modal-facts { display: flex; justify-content: center; gap: 8px; list-style: none; padding: 0; margin: 0 0 12px; }
.modal-facts li { background: var(--bg); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.modal-facts b { display: block; font-size: 18px; color: var(--navy-700); }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.modal-actions .btn-primary { min-width: 150px; letter-spacing: 2px; background: var(--navy-700); position: relative; overflow: hidden; }
.modal-actions .btn-primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
  transform: translateX(-100%); animation: sweep 2.2s ease-in-out infinite; }
@keyframes sweep { 60%, 100% { transform: translateX(100%); } }

/* ---------- welcome intro ---------- */
.intro-lock, .intro-lock body { overflow: hidden; }
.intro { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; overflow: hidden; color: var(--white);
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 60%, var(--navy-700) 100%);
  transition: transform .9s cubic-bezier(.77, 0, .18, 1), opacity .9s ease; }
.intro.is-leaving { transform: translateY(-100%); opacity: .6; }
.intro-glow { position: absolute; width: 900px; height: 900px; left: 50%; top: 50%; margin: -450px 0 0 -450px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 199, 44, .22) 0%, rgba(56, 84, 214, .25) 35%, transparent 65%); animation: glow 4s ease-in-out both; }
@keyframes glow { from { transform: scale(.4); opacity: 0; } 50% { opacity: 1; } }
.intro-grid { position: absolute; inset: 0; opacity: .08;
  background-image: linear-gradient(var(--white) 1px, transparent 1px), linear-gradient(90deg, var(--white) 1px, transparent 1px); background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, #000 0%, transparent 70%); animation: gridIn 1.2s ease both; }
@keyframes gridIn { from { opacity: 0; transform: scale(1.15); } }
.intro-body { position: relative; text-align: center; max-width: 900px; }

.intro-logos { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 30px; }
.intro-logo { position: relative; width: 92px; height: 92px; border-radius: 50%; background: var(--white); display: grid; place-items: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35); animation: logoPop .7s cubic-bezier(.2, 1.5, .4, 1) both; }
.intro-logo:last-child { animation-delay: .25s; }
.intro-logo img { width: 70%; height: 70%; object-fit: contain; }
.intro-logo::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 2.5px solid transparent;
  border-top-color: var(--gold); border-right-color: var(--gold); animation: spin 1.4s linear infinite, fadeIn .4s ease .5s both; }
.intro-x { font-size: 30px; font-weight: 300; color: var(--gold); animation: logoPop .5s ease .15s both; }
@keyframes logoPop { from { opacity: 0; transform: scale(.3) rotate(-20deg); } }

.intro-title { margin: 0; font-size: clamp(34px, 7vw, 68px); line-height: 1.1; font-weight: 800; letter-spacing: -1px; }
.intro-title .word { display: inline-block; opacity: 0; transform: translateY(40px) rotateX(60deg); filter: blur(8px);
  animation: wordIn .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(.9s + var(--i) * .22s); }
.intro-title .gold { background: linear-gradient(90deg, var(--gold), #fff1b8, var(--gold)); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: wordIn .7s cubic-bezier(.2, .8, .2, 1) both, shine 2.4s linear 2s infinite; animation-delay: calc(.9s + var(--i) * .22s), 2s; }
@keyframes wordIn { to { opacity: 1; transform: none; filter: none; } }
@keyframes shine { to { background-position: -200% 0; } }

.intro-line { display: block; width: 160px; height: 4px; margin: 26px auto 18px; border-radius: 999px; background: var(--gold);
  transform: scaleX(0); animation: lineGrow .8s cubic-bezier(.2, .8, .2, 1) 2s both; }
@keyframes lineGrow { to { transform: scaleX(1); } }
.intro-sub { margin: 0; font-size: clamp(14px, 2.2vw, 19px); font-weight: 600; letter-spacing: .5px; color: rgba(255, 255, 255, .85);
  animation: subIn .8s ease 2.3s both; }
.intro-sub b { color: var(--gold); }
@keyframes subIn { from { opacity: 0; transform: translateY(14px); letter-spacing: 4px; } }

.intro-skip { position: absolute; right: 24px; bottom: 24px; background: rgba(255, 255, 255, .1); color: var(--white);
  border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px; padding: 8px 16px; font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; animation: fadeIn .4s ease 1s both; }
.intro-skip:hover { background: rgba(255, 255, 255, .2); }

@media (max-width: 640px) {
  .intro-logo { width: 72px; height: 72px; }
  .intro-title .word { display: inline-block; }
}

/* ---------- attempts ---------- */
.attempt-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 0 8px; }
.attempt { position: relative; text-align: center; padding: 12px 8px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--white); }
.attempt small { display: block; color: var(--muted); font-size: 12px; }
.attempt b { font-size: 24px; }
.attempt em { display: block; font-style: normal; font-size: 11px; font-weight: 800; color: var(--green); letter-spacing: 1px; text-transform: uppercase; }
.attempt.is-empty { border-style: dashed; color: var(--muted); }
.attempt.is-best { border-color: var(--green); background: #f0faf4; }
.attempt.is-current { box-shadow: 0 0 0 3px rgba(255, 199, 44, .6); }
.result-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }

/* ---------- site nav ---------- */
.head-row { gap: 16px; flex-wrap: wrap; }
.site-nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a { color: var(--navy-800); text-decoration: none; font-size: 14.5px; font-weight: 700; padding: 8px 14px; border-radius: 10px; transition: background .15s, color .15s; }
.site-nav a:hover { background: var(--gold-soft); color: var(--navy-900); }
.site-nav a.is-active { background: var(--navy-700); color: var(--white); }

/* ---------- timer + draft ---------- */
.timer { position: sticky; top: 12px; z-index: 6; margin: 0 0 12px auto; width: max-content; display: flex; align-items: center; gap: 10px;
  background: var(--navy-900); color: var(--white); padding: 8px 16px; border-radius: 999px; box-shadow: 0 8px 20px rgba(11, 18, 64, .25); }
.timer span { font-size: 12px; color: rgba(255, 255, 255, .7); }
.timer b { font-size: 20px; font-variant-numeric: tabular-nums; color: var(--gold); }
.timer.is-warning { background: var(--red); animation: pulseWarn 1s ease infinite; }
.timer.is-warning b { color: var(--white); }
@keyframes pulseWarn { 50% { transform: scale(1.05); } }
.draft-notice { background: #e8f0ff; }

/* ---------- participant area ---------- */
.area-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-top: 24px; }
.area-head h1 { margin: 4px 0; font-size: 26px; }
.score-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; }
.steps li > div { flex: 1; }
.steps small { display: block; color: var(--muted); font-size: 13px; }
.step-dot { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--bg); color: var(--muted); border: 2px solid var(--line); }
.steps li.is-done .step-dot { background: var(--green); border-color: var(--green); color: var(--white); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.hero-sm { padding: 26px 32px; }

/* ---------- review ---------- */
.review-filter { margin-top: 10px; }
.chip { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; font-size: 14px; background: var(--bg); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.review-head { display: flex; align-items: center; gap: 10px; }
.review-head small { color: var(--navy-700); font-weight: 700; flex: 1; }
.review-item.is-wrong { border-left: 4px solid var(--red); border-radius: 0 var(--radius) var(--radius) 0; }
.review-item.is-correct { border-left: 4px solid var(--green); border-radius: 0 var(--radius) var(--radius) 0; }
.review-options { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.review-options li { padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 14px; display: flex; justify-content: space-between; gap: 10px; }
.review-options li em { font-style: normal; font-size: 12px; font-weight: 700; white-space: nowrap; }
.review-options li.is-key { border-color: var(--green); background: #f0faf4; }
.review-options li.is-key em { color: var(--green); }
.review-options li.is-chosen-wrong { border-color: var(--red); background: #fdecec; }
.review-options li.is-chosen-wrong em { color: var(--red); }

/* ---------- survey ---------- */
.survey-form { display: grid; gap: 16px; margin-top: 24px; }
.survey-form .page-title { margin: 0; }
.rating { border: 0; padding: 0; margin: 0; }
.rating legend { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); padding: 0 0 8px; }
.rating-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.rating-scale label { cursor: pointer; }
.rating-scale input { position: absolute; opacity: 0; pointer-events: none; }
.rating-scale span { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border: 1.5px solid var(--line); border-radius: 12px; transition: all .15s; text-align: center; }
.rating-scale b { font-size: 20px; }
.rating-scale small { font-size: 11px; color: var(--muted); font-weight: 500; }
.rating-scale label:hover span { border-color: var(--navy-700); }
.rating-scale input:checked + span { background: var(--navy-700); border-color: var(--navy-700); color: var(--white); transform: translateY(-2px); }
.rating-scale input:checked + span small { color: rgba(255, 255, 255, .8); }
.rating-scale input:focus-visible + span { box-shadow: 0 0 0 3px rgba(34, 48, 127, .25); }
.done-badge { width: 72px; height: 72px; margin: 0 auto 8px; border-radius: 50%; background: var(--green); color: var(--white); display: grid; place-items: center; font-size: 36px; animation: popIn .5s cubic-bezier(.2, 1.4, .4, 1) both; }

/* ---------- tasks ---------- */
.task-form { display: grid; gap: 14px; margin-top: 24px; }
.task-form .page-title { margin: 0; }
.upload-field { display: grid; gap: 6px; padding: 12px 14px; border: 1.5px dashed var(--line); border-radius: 12px; }
.upload-field .uploaded { color: var(--green); font-weight: 600; }
.grade-box { background: var(--gold-soft); border-radius: 12px; padding: 14px 18px; }
.grade-box h3 { margin: 0 0 6px; }
.grade-box ul { margin: 0; padding-left: 18px; }
.done-notice { background: #e3f6ea; color: var(--green); font-weight: 700; }

/* ---------- materials ---------- */
.material-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.material-card { display: flex; align-items: center; gap: 14px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; transition: transform .15s, box-shadow .15s; }
.material-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(11, 18, 64, .08); }
.material-body { flex: 1; min-width: 0; }
.material-body h3 { margin: 0; font-size: 15px; }
.material-body p { margin: 2px 0; font-size: 13px; color: var(--muted); }
.material-body small { color: var(--muted); font-size: 12px; }
.file-badge { flex: none; width: 48px; height: 56px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--white); background: var(--navy-700); }
.file-pdf { background: var(--red); }
.file-doc { background: #2b5fd9; }
.file-ppt { background: #d9622b; }
.file-xls { background: var(--green); }
.file-img { background: #8a4fd9; }
.session-pick { border: 0; padding: 0; margin: 0; }
.session-pick legend { text-transform: none; letter-spacing: 0; color: var(--ink); padding: 0 0 6px; }

@media (max-width: 640px) {
  .site-nav { margin-left: 0; width: 100%; }
  .score-summary { grid-template-columns: minmax(0, 1fr); }
  .material-grid { grid-template-columns: minmax(0, 1fr); }
  .rating-scale small { display: none; }
  .area-head { flex-direction: column; }
}

/* ---------- attendance success ---------- */
.success-modal { padding-top: 30px; }
.success-check { width: 84px; height: 84px; margin: 0 auto 14px; }
.success-check svg { width: 100%; height: 100%; }
.success-check circle { fill: none; stroke: var(--green); stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; animation: drawStroke .6s ease forwards; }
.success-check path { fill: none; stroke: var(--green); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: drawStroke .4s ease .55s forwards; }
@keyframes drawStroke { to { stroke-dashoffset: 0; } }
.redirect-bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 6px 0 4px; }
.redirect-bar span { display: block; height: 100%; width: 100%; background: var(--green); transform-origin: left; animation: shrinkBar linear forwards; }
@keyframes shrinkBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- survey: required comments ---------- */
.survey-progress { position: sticky; top: 8px; z-index: 4; width: max-content; margin-left: auto; background: var(--navy-900); color: var(--white); font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: 999px; }
.survey-progress span { color: var(--gold); }
.survey-form .rating { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px; transition: border-color .2s, background .2s; }
.survey-form .rating legend { display: flex; align-items: flex-start; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 700; color: var(--ink); padding: 0 6px; }
.survey-form .rating.is-complete { border-color: #9fd8b3; background: #fbfefc; }
.survey-form .rating.is-complete .q-num { background: var(--green); color: var(--white); }
.survey-form .rating.has-error { border-color: var(--red); background: #fff8f8; animation: shake .35s ease; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.comment-field { display: block; margin-top: 10px; font-size: 13px; }
.comment-field textarea { margin-top: 6px; }
.required { color: var(--red); }
.field-error { margin: 6px 0 0; min-height: 0; color: var(--red); font-size: 13px; font-weight: 600; }
.field-error:empty { display: none; }
.survey-form textarea { width: 100%; font: inherit; font-weight: 500; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; resize: vertical; }
.survey-form textarea:focus { outline: none; border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(34, 48, 127, .15); }
.survey-form .has-error textarea:invalid, .survey-form .has-error textarea:placeholder-shown { border-color: var(--red); }

/* ---------- light header: medium screens put the nav on its own row ---------- */
@media (max-width: 980px) {
  .head-row { gap: 4px 16px; }
  .site-nav { width: 100%; margin-left: 0; padding-bottom: 10px; overflow-x: auto; flex-wrap: nowrap; }
  .site-nav a { white-space: nowrap; padding: 6px 12px; }
  .brand img { height: 44px; }
}
.brand, .brand span { min-width: 0; }
@media (max-width: 640px) {
  .brand { gap: 10px; }
  .brand img { height: 38px; }
  .brand .brand-sep { height: 32px; }
  .brand span { font-size: 15px; }
  .brand small { font-size: 11.5px; line-height: 1.35; }
  .site-nav { flex-wrap: wrap; overflow-x: visible; gap: 2px; }
  .site-nav a { font-size: 13.5px; padding: 6px 10px; }
}

/* ---------- footer support ---------- */
.site-foot p { margin: 0 0 14px; }
.support-by { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); }
.support-by span { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
.support-by img { height: 44px; width: auto; border-radius: 10px; box-shadow: 0 6px 18px rgba(11, 18, 64, .15); transition: transform .2s, box-shadow .2s; }
.support-by:hover img { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(11, 18, 64, .22); }

/* ---------- page background: very soft UT gradient, no pattern ---------- */
body {
  background-color: #f5f7fb;
  background-image: linear-gradient(135deg, #edf2ff 0%, #f6f7fb 50%, #fdf8ec 100%);
  background-attachment: fixed;
}
.privacy-note { margin: 4px 0 0; padding: 10px 12px; border-radius: 10px; background: #eef3ff; color: var(--muted); font-size: 12.5px; line-height: 1.5; }

/* ---------- intro: supporter credit ---------- */
.intro-support { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px;
  animation: subIn .8s ease 2.7s both; }
.intro-support span { font-size: 9px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.intro-support img { height: 20px; width: auto; display: block; opacity: .9; }
@media (max-width: 640px) {
  .intro-support { bottom: 84px; }
  .intro-support img { height: 17px; }
}

/* ---------- small phones: form controls never exceed their container ---------- */
input, select, textarea { max-width: 100%; min-width: 0; }
label > input, label > select, label > textarea { width: 100%; }
.option { position: relative; }
.option input { left: 0; top: 0; }
