/* ==========================================================
   iTEP Practice Course — UPSRJ · OBLT
   Design canvas: 1366 × 768 (landscape) · 768 × 1366 (portrait)
   The stage is scaled to fit the window, so the layout always
   matches the original artboards.
   ========================================================== */

@font-face { font-family: "Poppins"; src: url("../fonts/Poppins-Light.ttf") format("truetype"); font-weight: 300; font-display: block; }
@font-face { font-family: "Poppins"; src: url("../fonts/Poppins-Regular.ttf") format("truetype"); font-weight: 400; font-display: block; }
@font-face { font-family: "Poppins"; src: url("../fonts/Poppins-Medium.ttf") format("truetype"); font-weight: 500; font-display: block; }

:root {
  --blue: #1c4593;
  --blue-dark: #153773;
  --gray: #c8d1d9;
  --orange: #f5772b;
  --error: #ffb4a8;
  --ok: #9be7b5;
  --ease: cubic-bezier(.65, 0, .35, 1);
  --t: .9s;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--blue);
  font-family: "Poppins", system-ui, sans-serif;
  font-weight: 400;
  color: #fff;
  overflow: hidden;
  transition: background-color .6s ease;
  -webkit-font-smoothing: antialiased;
}
body.is-diag { background: var(--gray); }
button, input, select { font-family: inherit; }

#viewport { position: fixed; inset: 0; overflow: hidden; }
#viewport.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
#viewport.scroll #stage { top: 0; }
.sizer { width: 1px; }
#stage {
  position: absolute;
  left: 50%; top: 50%;
  width: 1366px; height: 768px;
  transform-origin: 0 0;
  overflow: hidden;
}
#stage.portrait { width: 768px; height: 1366px; }
/* extra height on tall screens: content keeps its place in the middle */
#stage { --dy: 0px; }
#stage > .actor, #stage > .panel, .diag-hello, .btn-diag { margin-top: var(--dy); }
#stage.no-anim, #stage.no-anim * { transition: none !important; }

/* ---------- Frame + brand ---------- */
.frame {
  position: absolute;
  left: 34px; top: 37px; right: 42px; bottom: 32px;
  border: 4px solid var(--gray);
  border-radius: 40px;
  pointer-events: none;
}
.portrait .frame { left: 24px; top: 28px; right: 24px; bottom: 28px; border-radius: 36px; }

.brand { position: absolute; pointer-events: none; user-select: none; }
.upsrj { left: 77px; top: 76px; width: 245px; }
.oblt  { right: 87px; top: 82px; width: 146px; }
.portrait .upsrj { left: 60px; top: 66px; width: 232px; }
.portrait .oblt  { right: 60px; top: 70px; width: 150px; }

/* ---------- Actors (shared transition) ---------- */
.actor {
  position: absolute;
  transition:
    left var(--t) var(--ease), top var(--t) var(--ease),
    width var(--t) var(--ease), height var(--t) var(--ease),
    font-size var(--t) var(--ease),
    background-color var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease),
    translate var(--t) var(--ease),
    scale 1.4s cubic-bezier(.16, 1, .3, 1),
    opacity .8s ease;
}

.txt {
  left: 0; width: 100%;
  text-align: center;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  color: #fff;
}
.txt-welcome  { top: 177px; font-size: 70px; }
.txt-practice { top: 510px; font-size: 71px; }

.logo { left: 50%; translate: -50% 0; top: 276px; width: 348px; user-select: none; -webkit-user-drag: none; }

/* s0 — hidden, zoomed out */
[data-state="s0"] .txt,
[data-state="s0"] .logo { opacity: 0; scale: .78; }

/* s1 — fade in + zoom in (staggered) */
[data-state="s1"] .txt-welcome  { transition-delay: 0s; }
[data-state="s1"] .logo         { transition-delay: .15s; }
[data-state="s1"] .txt-practice { transition-delay: .3s; }

/* s2 and later — everything rises; texts fade out, logo stays */
#stage:not([data-state="s0"]):not([data-state="s1"]) .txt-welcome,
#stage:not([data-state="s0"]):not([data-state="s1"]) .txt-practice { translate: 0 -124px; opacity: 0; pointer-events: none; }
[data-state="s2"] .logo, [data-state="home"] .logo { top: 152px; }
[data-state="signup"] .logo { top: 108px; width: 232px; }
:is([data-state="login"], [data-state="tlogin"])  .logo { top: 118px; width: 232px; }
[data-state="signup"] .txt, :is([data-state="login"], [data-state="tlogin"]) .txt { transition-duration: .3s; }

/* ---------- Main buttons (become titles) ---------- */
.btn-main {
  display: flex; align-items: center; justify-content: center;
  top: 446px; width: 402px; height: 84px;
  border: 3px solid transparent;
  border-radius: 999px;
  font-size: 34px; font-weight: 400; line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0; pointer-events: none;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}
.btn-main:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
.btn-create { left: 200px; background-color: var(--gray); border-color: var(--gray); color: var(--blue); }
.btn-login  { left: 742px; background-color: rgba(28, 69, 147, 0); border-color: #fff; color: #fff; }

[data-state="home"] .btn-main { opacity: 1; pointer-events: auto; }
[data-state="home"] .btn-main:hover { box-shadow: 0 10px 30px rgba(0, 0, 0, .28); translate: 0 -2px; }
[data-state="home"] .btn-create:hover { background-color: #fff; border-color: #fff; }
[data-state="home"] .btn-login:hover  { background-color: rgba(255, 255, 255, .08); }

[data-state="signup"] .btn-create {
  left: 483px; top: 273px; width: 400px; height: 44px;
  background-color: rgba(200, 209, 217, 0); border-color: rgba(200, 209, 217, 0); color: #fff;
  opacity: 1; cursor: default;
}
:is([data-state="login"], [data-state="tlogin"]) .btn-login {
  left: 483px; top: 300px; width: 400px; height: 44px;
  border-color: rgba(255, 255, 255, 0); color: #fff;
  opacity: 1; cursor: default;
}
[data-state="signup"] .btn-login,
:is([data-state="login"], [data-state="tlogin"]) .btn-create { opacity: 0; transition-duration: .4s; }

/* ---------- Back ---------- */
.btn-back {
  position: absolute; left: 77px; top: 150px;
  background: none; border: 0; color: var(--gray);
  font-size: 18px; cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity .5s ease, color .2s;
}
.btn-back:hover { color: #fff; }
[data-state="signup"] .btn-back, :is([data-state="login"], [data-state="tlogin"]) .btn-back { opacity: 1; pointer-events: auto; transition-delay: .6s; }
.portrait .btn-back { left: 60px; top: 132px; font-size: 22px; }

/* ---------- Panels (forms) ---------- */
.panel {
  position: absolute;
  opacity: 0; visibility: hidden;
  transition: opacity .5s ease, visibility 0s linear .5s;
}
.panel.show { opacity: 1; visibility: visible; transition: opacity .5s ease, visibility 0s; }
.panel.show .row,
.panel.show .pw-rules,
.panel.show .btn-outline,
.panel.show .legend,
.panel.show .links { animation: rise .55s cubic-bezier(.2, .8, .2, 1) both; }
.panel.show > :nth-child(1) { animation-delay: .00s; }
.panel.show > :nth-child(2) { animation-delay: .07s; }
.panel.show > :nth-child(3) { animation-delay: .14s; }
.panel.show > :nth-child(4) { animation-delay: .21s; }
.panel.show > :nth-child(5) { animation-delay: .28s; }
.panel.show > :nth-child(6) { animation-delay: .35s; }
.panel.show > :nth-child(7) { animation-delay: .42s; }
.panel.show > :nth-child(8) { animation-delay: .49s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.form { left: 344px; width: 668px; }
.form-signup { top: 343px; }
.form-login  { top: 394px; }

.row {
  display: grid;
  grid-template-columns: 142px 1fr;
  align-items: center;
  height: 34px;
  margin-bottom: 17px;
}
.row.split { grid-template-columns: 140px 160px 1fr 160px; }
.row.split .lbl-group { padding-left: 71px; }
label { font-size: 23px; line-height: 1; white-space: nowrap; color: #fff; }
.form-login label { text-align: right; padding-right: 18px; }
.req { color: var(--orange); margin-left: 2px; }

input, select {
  width: 100%; height: 34px;
  border: 2px solid var(--gray);
  border-radius: 999px;
  background: var(--gray);
  color: var(--blue);
  font-size: 17px; font-weight: 500;
  padding: 0 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
input::placeholder { color: rgba(28, 69, 147, .45); font-weight: 400; }
input:focus, select:focus { background: #fff; border-color: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .22); }
select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--blue) 50%), linear-gradient(135deg, var(--blue) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
select:invalid { color: rgba(28, 69, 147, .45); }
#su-group { text-transform: uppercase; }
.invalid { border-color: var(--error) !important; box-shadow: 0 0 0 4px rgba(255, 138, 128, .35) !important; animation: shake .35s; }
@keyframes shake { 25% { translate: -5px 0; } 75% { translate: 5px 0; } }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 72px; }
.eye {
  position: absolute; right: 6px; top: 50%; translate: 0 -50%;
  border: 0; background: none; cursor: pointer;
  color: var(--blue); font-size: 11px; font-weight: 500; letter-spacing: .08em;
  padding: 6px 10px; border-radius: 999px;
}
.eye:hover { background: rgba(28, 69, 147, .1); }

.pw-rules {
  list-style: none;
  display: flex; gap: 14px; justify-content: flex-start;
  margin: -9px 0 0 142px; height: 22px;
  font-size: 13px; color: var(--gray);
}
.pw-rules li::before { content: "○ "; }
.pw-rules li.ok { color: var(--ok); }
.pw-rules li.ok::before { content: "● "; }

.btn-outline {
  display: block;
  width: 433px; height: 52px;
  margin: 0 auto;
  border: 3px solid var(--gray);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 28px; font-weight: 400; line-height: 1;
  cursor: pointer;
  transition: background-color .25s, color .25s, opacity .25s, box-shadow .25s;
}
.btn-outline:hover:not(:disabled) { background: var(--gray); color: var(--blue); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.btn-outline:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
.btn-outline.incomplete { opacity: .55; }
.btn-outline:disabled { opacity: .55; cursor: progress; }
.btn-send { margin-top: 12px; position: relative; left: 4px; }
.btn-dologin { margin-top: 50px; position: relative; left: 4px; }

.legend { margin-top: 14px; text-align: center; font-size: 14px; color: var(--gray); position: relative; left: -10px; }
.links { margin-top: 16px; text-align: center; font-size: 15px; color: var(--gray); position: relative; left: -10px; }
.link {
  background: none; border: 0; cursor: pointer;
  color: var(--gray); font-size: inherit;
  text-decoration: underline; text-underline-offset: 3px;
}
.link:hover { color: #fff; }
.link[hidden] { display: none; }

/* ---------- Sent panel ---------- */
.sent { left: 333px; top: 345px; width: 700px; text-align: center; }
.sent-title { font-size: 26px; margin-bottom: 18px; letter-spacing: .02em; }
.sent-text { font-size: 19px; color: var(--gray); margin-bottom: 12px; line-height: 1.5; }
.sent-text strong { color: #fff; font-weight: 500; }
.sent-text.small { font-size: 16px; margin-bottom: 30px; }

/* ---------- Diagnostic screen ---------- */
.diag {
  position: absolute; inset: 0;
  background: var(--gray);
  opacity: 0; visibility: hidden;
  transition: opacity .7s ease, visibility 0s linear .7s;
  color: var(--blue);
}
.diag.show { opacity: 1; visibility: visible; transition: opacity .7s ease, visibility 0s; }
.frame-diag { border-color: var(--blue); }
.diag-itep { position: absolute; left: 77px; top: 63px; width: 126px; }
.diag-oblt { position: absolute; right: 87px; top: 82px; width: 146px; }
.diag-hello { position: absolute; left: 0; width: 100%; top: 236px; text-align: center; font-size: 22px; color: var(--blue); }
.btn-diag {
  position: absolute; left: 416px; top: 310px; width: 533px; height: 147px;
  border: 0; border-radius: 32px;
  background: var(--blue); color: var(--gray);
  font-size: 43px; font-weight: 400; line-height: 1.44;
  cursor: pointer;
  transition: background-color .25s, box-shadow .25s, translate .25s;
}
.btn-diag:hover { background: var(--blue-dark); box-shadow: 0 16px 40px rgba(28, 69, 147, .35); translate: 0 -3px; }
.btn-diag:focus-visible { outline: 3px solid var(--orange); outline-offset: 5px; }
.diag.show .btn-diag { animation: pop .8s cubic-bezier(.16, 1, .3, 1) .25s both; }
@keyframes pop { from { opacity: 0; scale: .85; } to { opacity: 1; scale: 1; } }
.diag-foot { position: absolute; left: 0; width: 100%; bottom: 62px; text-align: center; font-size: 15px; color: var(--blue); }
.diag-foot .link-blue { color: var(--blue); margin-left: 10px; }
.diag-foot .link-blue:hover { color: var(--orange); }

/* ---------- Toast ---------- */
#toast {
  position: absolute; left: 50%; top: 52px;
  translate: -50% -140%;
  max-width: 640px;
  padding: 12px 26px;
  border-radius: 999px;
  background: #fff; color: var(--blue);
  font-size: 16px; font-weight: 500; text-align: center;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .3);
  opacity: 0; pointer-events: none;
  transition: translate .5s cubic-bezier(.16, 1, .3, 1), opacity .3s;
  z-index: 50;
}
#toast.show { translate: -50% 0; opacity: 1; }
#toast.error { background: #fff1ee; color: #b3261e; }
#toast.success { background: #eafaf0; color: #146c3b; }

#demoBadge {
  position: absolute; left: 50%; bottom: 6px; translate: -50% 0;
  font-size: 11px; letter-spacing: .08em; color: rgba(255, 255, 255, .55);
  z-index: 40;
}
body.is-diag #demoBadge { color: rgba(28, 69, 147, .55); }

/* ---------- Demo inbox ---------- */
.demo-inbox {
  position: absolute; inset: 0; z-index: 60;
  background: rgba(10, 24, 54, .7);
  display: grid; place-items: center;
}
.demo-inbox[hidden] { display: none; }
.mail { width: 560px; background: #fff; border-radius: 22px; overflow: hidden; color: #1d2433; text-align: center; padding-bottom: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); }
.mail-meta { font-size: 11px; letter-spacing: .06em; background: #eef1f4; color: #5b6575; padding: 8px; }
.mail-head { background: var(--blue); padding: 26px 0 22px; }
.mail-head img { width: 170px; }
.mail-body { padding: 26px 46px 10px; font-size: 15px; line-height: 1.6; }
.mail-body p { margin-bottom: 12px; }
.mail-title { color: var(--blue); font-size: 19px; font-weight: 500; }
.mail-btn { display: inline-block; margin: 8px 0 16px; padding: 12px 40px; border-radius: 999px; background: var(--blue); color: #fff; text-decoration: none; font-weight: 500; }
.mail-btn:hover { background: var(--blue-dark); }
.mail-small { font-size: 12px; color: #8a94a3; }
.mail .link { color: #5b6575; font-size: 13px; }

/* ==========================================================
   PORTRAIT (phones)
   ========================================================== */
.portrait .txt-welcome  { top: 360px; font-size: 64px; }
.portrait .txt-practice { top: 780px; font-size: 64px; }
.portrait .logo { top: 470px; width: 440px; }
.portrait[data-state="s2"] .logo, .portrait[data-state="home"] .logo { top: 300px; }
.portrait[data-state="signup"] .logo { top: 170px; width: 260px; }
.portrait:is([data-state="login"], [data-state="tlogin"])  .logo { top: 250px; width: 300px; }
#stage.portrait:not([data-state="s0"]):not([data-state="s1"]) .txt-welcome,
#stage.portrait:not([data-state="s0"]):not([data-state="s1"]) .txt-practice { translate: 0 -170px; }

.portrait .btn-main { left: 134px; width: 500px; height: 100px; font-size: 38px; }
.portrait .btn-create { top: 800px; }
.portrait .btn-login  { top: 940px; }
.portrait[data-state="signup"] .btn-create { left: 134px; top: 345px; width: 500px; height: 60px; font-size: 42px; }
.portrait:is([data-state="login"], [data-state="tlogin"])  .btn-login  { left: 134px; top: 470px; width: 500px; height: 60px; font-size: 42px; }

.portrait .form { left: 94px; width: 580px; }
.portrait .form-signup { top: 440px; }
.portrait .form-login  { top: 580px; }
.portrait .row { grid-template-columns: 1fr; grid-template-rows: auto 58px; height: auto; row-gap: 8px; margin-bottom: 20px; }
.portrait .row.split { grid-template-columns: 1fr 1fr; grid-template-rows: auto 58px; column-gap: 24px; grid-auto-flow: column; }
.portrait .row.split .lbl-group { padding-left: 0; }
.portrait label { font-size: 26px; padding-left: 12px; }
.portrait .form-login label { text-align: left; padding-right: 0; }
.portrait input, .portrait select { height: 58px; font-size: 24px; padding: 0 24px; }
.portrait .pw-wrap input { padding-right: 96px; }
.portrait .eye { font-size: 15px; }
.portrait .pw-rules { margin: -8px 0 0 12px; flex-wrap: wrap; gap: 6px 16px; height: auto; font-size: 18px; }
.portrait .btn-outline { width: 520px; height: 76px; font-size: 32px; }
.portrait .btn-send { margin-top: 30px; left: 0; }
.portrait .btn-dologin { margin-top: 40px; left: 0; }
.portrait .legend { font-size: 19px; margin-top: 20px; left: 0; }
.portrait .links { font-size: 20px; margin-top: 26px; left: 0; line-height: 2; }
.portrait .sent { left: 64px; top: 470px; width: 640px; }
.portrait .sent-title { font-size: 34px; }
.portrait .sent-text { font-size: 24px; }
.portrait .sent-text.small { font-size: 21px; }

.portrait .diag-itep { left: 60px; top: 60px; width: 150px; }
.portrait .diag-oblt { right: 60px; top: 84px; width: 150px; }
.portrait .diag-hello { top: 470px; font-size: 28px; }
.portrait .btn-diag { left: 104px; top: 560px; width: 560px; height: 200px; font-size: 44px; }
.portrait .diag-foot { font-size: 20px; bottom: 70px; }
.portrait #toast { top: 40px; max-width: 680px; font-size: 22px; }
.portrait .mail { width: 680px; }
.portrait .mail-body { font-size: 20px; }
.portrait .mail-title { font-size: 24px; }

@media (prefers-reduced-motion: reduce) {
  .actor, .panel, .diag { transition-duration: .01s !important; }
  .panel.show * { animation: none !important; }
}

/* ==========================================================
   TEACHER button (home) → becomes the "TEACHER ACCOUNT" title
   ========================================================== */
.btn-teacher {
  display: flex; align-items: center; justify-content: center;
  left: 533px; top: 588px; width: 300px; height: 50px;
  border: 2px solid rgba(200, 209, 217, .7);
  border-radius: 999px;
  background-color: rgba(28, 69, 147, 0);
  color: var(--gray);
  font-size: 19px; font-weight: 400; line-height: 1; letter-spacing: .02em;
  white-space: nowrap; cursor: pointer;
  opacity: 0; pointer-events: none;
}
.btn-teacher .lbl { transition: opacity .25s ease; }
.btn-teacher.swap .lbl { opacity: 0; }
.btn-teacher:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
[data-state="home"] .btn-teacher { opacity: 1; pointer-events: auto; }
[data-state="home"] .btn-teacher:hover { border-color: #fff; color: #fff; background-color: rgba(255, 255, 255, .08); }
[data-state="signup"] .btn-teacher,
:is([data-state="login"], [data-state="tlogin"]) .btn-teacher { opacity: 0; transition-duration: .4s; }
[data-state="tsignup"] .btn-teacher {
  left: 383px; top: 273px; width: 600px; height: 44px;
  font-size: 34px; letter-spacing: 0;
  border-color: rgba(200, 209, 217, 0); color: #fff;
  opacity: 1; cursor: default;
}
[data-state="tsignup"] .btn-main { opacity: 0; transition-duration: .4s; }
[data-state="tsignup"] .logo { top: 108px; width: 232px; }
[data-state="tsignup"] .txt { transition-duration: .3s; }
[data-state="tsignup"] .btn-back { opacity: 1; pointer-events: auto; transition-delay: .6s; }
.form-teacher .btn-send { margin-top: 12px; }

.portrait .btn-teacher { left: 184px; width: 400px; top: 1080px; height: 66px; font-size: 25px; }
.portrait[data-state="tsignup"] .btn-teacher { left: 84px; top: 345px; width: 600px; height: 60px; font-size: 42px; }
.portrait[data-state="tsignup"] .logo { top: 170px; width: 260px; }

/* ==========================================================
   TEACHER area (light style, like the diagnostic screen)
   ========================================================== */
.teacher { color: var(--blue); }
.t-view {
  position: absolute; left: 60px; right: 60px; top: 132px; bottom: 96px;
  display: flex; flex-direction: column; align-items: center;
  opacity: 0; visibility: hidden;
  transition: opacity .45s ease, visibility 0s linear .45s;
}
.t-view.show { opacity: 1; visibility: visible; transition: opacity .45s ease, visibility 0s; }
.t-view.show > * { animation: rise .55s cubic-bezier(.2, .8, .2, 1) both; }
.t-view.show > :nth-child(2) { animation-delay: .06s; }
.t-view.show > :nth-child(3) { animation-delay: .12s; }
.t-view.show > :nth-child(4) { animation-delay: .18s; }
.t-view.show > :nth-child(5) { animation-delay: .24s; }

.t-kicker { font-size: 14px; letter-spacing: .14em; color: rgba(28, 69, 147, .65); margin-bottom: 10px; }
.t-title { font-size: 34px; font-weight: 400; line-height: 1.15; text-align: center; color: var(--blue); }
.t-hint { font-size: 16px; color: rgba(28, 69, 147, .75); margin: 10px 0 30px; text-align: center; }

.q-grid { display: grid; grid-template-columns: repeat(5, 176px); gap: 18px 20px; margin-bottom: 40px; }
.q-chip {
  height: 58px; border: 3px solid var(--blue); border-radius: 999px;
  background: transparent; color: var(--blue);
  font-size: 20px; cursor: pointer;
  transition: background-color .2s, color .2s, transform .2s, box-shadow .2s;
}
.q-chip small { font-size: 14px; opacity: .8; }
.q-chip:hover { box-shadow: 0 8px 22px rgba(28, 69, 147, .2); transform: translateY(-2px); }
.q-chip.on { background: var(--blue); color: var(--gray); }
.q-chip:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.btn-blue {
  min-width: 300px; height: 56px; padding: 0 36px;
  border: 3px solid var(--blue); border-radius: 999px;
  background: var(--blue); color: var(--gray);
  font-size: 22px; cursor: pointer;
  transition: background-color .2s, color .2s, box-shadow .2s, opacity .2s;
}
.btn-blue:hover:not(:disabled) { background: var(--blue-dark); box-shadow: 0 12px 30px rgba(28, 69, 147, .3); }
.btn-blue.ghost { background: transparent; color: var(--blue); }
.btn-blue.ghost:hover { background: rgba(28, 69, 147, .08); box-shadow: none; }
.btn-blue:disabled { opacity: .5; cursor: progress; }
.btn-blue:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
.t-actions { display: flex; gap: 24px; margin-top: 30px; }

.g-list { width: 860px; max-height: 330px; overflow-y: auto; padding: 4px 8px; }
.g-row { display: grid; grid-template-columns: 190px 1fr; align-items: center; gap: 16px; margin-bottom: 16px; }
.g-row > span { font-size: 21px; }
.chip-box {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  min-height: 52px; padding: 7px 10px;
  border: 2px solid var(--blue); border-radius: 26px;
  background: rgba(255, 255, 255, .55);
  cursor: text;
}
.chip-box:focus-within { background: #fff; box-shadow: 0 0 0 4px rgba(28, 69, 147, .15); }
.chip-box.invalid { border-color: #c0392b; }
.chip-box input {
  flex: 1; min-width: 160px; height: 34px; border: 0; background: transparent;
  color: var(--blue); font-size: 17px; font-weight: 500; padding: 0 8px; box-shadow: none !important;
}
.chip-box input:focus { background: transparent; }
.g-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 6px 0 14px; border-radius: 999px;
  background: var(--blue); color: var(--gray); font-size: 16px; font-weight: 500;
}
.g-chip button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(200, 209, 217, .2); color: var(--gray); cursor: pointer; font-size: 15px; line-height: 1; }
.g-chip button:hover { background: rgba(255, 255, 255, .35); }

/* Dashboard */
.t-dash { align-items: stretch; top: 150px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 18px; margin: 0 40px 22px; min-height: 28px; }
.crumbs button { background: none; border: 0; color: var(--blue); font-size: 18px; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; padding: 0; }
.crumbs .sep { opacity: .5; }
.crumbs .here { font-weight: 500; }
.t-content { flex: 1; overflow-y: auto; padding: 4px 40px 10px; }
.t-content h2 { font-size: 30px; font-weight: 400; margin-bottom: 22px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; }
.card {
  position: relative; text-align: left;
  border: 0; border-radius: 26px; padding: 22px 22px 20px;
  background: rgba(255, 255, 255, .6); color: var(--blue);
  cursor: pointer; min-height: 150px;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s, background-color .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(28, 69, 147, .22); background: #fff; }
.card:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
.card svg { width: 54px; height: 54px; display: block; margin-bottom: 14px; }
.card .c-title { font-size: 22px; font-weight: 500; line-height: 1.2; }
.card .c-sub { font-size: 15px; opacity: .75; margin-top: 4px; }
.card.course { background: var(--blue); color: var(--gray); }
.card.course:hover { background: var(--blue-dark); }
.card.course .c-title { font-size: 28px; color: #fff; }

.tabs { display: flex; gap: 6px; border-bottom: 2px solid rgba(28, 69, 147, .2); margin-bottom: 18px; }
.tab {
  background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px;
  padding: 10px 18px; font-size: 18px; color: var(--blue); cursor: pointer;
}
.tab.on { border-bottom-color: var(--blue); font-weight: 500; }
.course-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.course-head h2 { margin: 0; }
.course-head .count { font-size: 16px; opacity: .8; }

.roster { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 16px; background: rgba(255, 255, 255, .7); border-radius: 18px; overflow: hidden; }
.roster th { position: sticky; top: 0; background: var(--blue); color: var(--gray); font-weight: 500; text-align: left; padding: 12px 16px; font-size: 15px; letter-spacing: .03em; }
.roster td { padding: 11px 16px; border-top: 1px solid rgba(28, 69, 147, .12); color: #1d2433; }
.roster tr:nth-child(even) td { background: rgba(28, 69, 147, .04); }
.roster td.num { width: 48px; color: rgba(28, 69, 147, .6); }
.pill { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 14px; background: rgba(28, 69, 147, .1); color: var(--blue); }
.pill.done { background: #e6f6ec; color: #146c3b; }
.empty { text-align: center; padding: 50px 20px; font-size: 18px; color: rgba(28, 69, 147, .8); line-height: 1.6; }
.notice {
  background: #fff7e8; color: #7a4b00; border-radius: 18px;
  padding: 18px 22px; font-size: 16px; line-height: 1.55; margin-bottom: 18px;
}
.t-foot .link-blue { margin-left: 16px; }

.portrait .t-view { left: 40px; right: 40px; top: 170px; bottom: 120px; }
.portrait .t-title { font-size: 38px; }
.portrait .q-grid { grid-template-columns: repeat(2, 300px); }
.portrait .q-chip { height: 70px; font-size: 26px; }
.portrait .g-list { width: 680px; max-height: 760px; }
.portrait .g-row { grid-template-columns: 1fr; gap: 8px; }
.portrait .btn-blue { height: 70px; font-size: 26px; }
.portrait .t-actions { flex-direction: column; }
.portrait .card-grid { grid-template-columns: repeat(2, 1fr); }
.portrait .t-content { padding: 4px 10px; }
.portrait .crumbs { margin: 0 10px 22px; font-size: 22px; }
.portrait .roster { font-size: 18px; }
.portrait .roster .hide-sm { display: none; }

/* ---------- Teacher home ("ARE YOU A TEACHER?" → its own CREATE ACCOUNT / LOG IN) ---------- */
.btn-main .lbl { transition: opacity .25s ease; }
.btn-main.swap .lbl { opacity: 0; }
[data-state="thome"] .logo { top: 104px; width: 290px; }
[data-state="thome"] .btn-teacher {
  left: 383px; top: 352px; width: 600px; height: 44px;
  font-size: 34px; letter-spacing: 0;
  border-color: rgba(200, 209, 217, 0); color: #fff;
  opacity: 1; cursor: default; pointer-events: none;
}
[data-state="thome"] .btn-main { opacity: 1; pointer-events: auto; }
[data-state="thome"] .btn-main:hover { box-shadow: 0 10px 30px rgba(0, 0, 0, .28); translate: 0 -2px; }
[data-state="thome"] .btn-create:hover { background-color: #fff; border-color: #fff; }
[data-state="thome"] .btn-login:hover  { background-color: rgba(255, 255, 255, .08); }
[data-state="thome"] .btn-back { opacity: 1; pointer-events: auto; transition-delay: .6s; }
[data-state="thome"] .txt { transition-duration: .3s; }

.portrait[data-state="thome"] .logo { top: 250px; width: 360px; }
.portrait[data-state="thome"] .btn-teacher { left: 84px; top: 620px; width: 600px; height: 60px; font-size: 42px; }

/* ---------- Teachers code ---------- */
.code-form { left: 433px; width: 500px; top: 428px; text-align: center; }
.code-label { display: block; font-size: 20px; letter-spacing: .14em; color: var(--gray); margin-bottom: 16px; }
.code-box {
  position: relative; height: 54px; border-radius: 999px;
  background: var(--gray); border: 2px solid var(--gray);
  transition: background-color .2s, border-color .2s, box-shadow .2s;
}
.code-box:focus-within { background: #fff; border-color: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .22); }
.code-box:has(.invalid) { border-color: var(--error); box-shadow: 0 0 0 4px rgba(255, 138, 128, .35); animation: shake .35s; }
/* the real input sits on top, invisible; the display draws the slots */
.code-box input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: text; padding: 0; border: 0;
}
.code-display {
  position: absolute; inset: 0; right: 64px; left: 24px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; color: var(--blue); font-weight: 500;
}
.code-display span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 28px; margin: 0 2px;
  font-size: 22px; line-height: 1;
}
.code-display .slot-empty { color: transparent; }
.code-display .slot-empty::before {
  content: ""; position: absolute; width: 14px; height: 2px; bottom: 3px;
  background: rgba(28, 69, 147, .35); border-radius: 2px;
}
.code-display span { position: relative; }
.code-display .dash { width: 14px; color: rgba(28, 69, 147, .7); }
.code-display .cur { position: relative; }
.code-box:focus-within .code-display .cur::after {
  content: ""; position: absolute; left: 50%; top: 1px; width: 2px; height: 22px; margin-left: -1px;
  background: var(--blue); animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.code-box .eye { z-index: 2; }
.code-form .btn-outline { width: 300px; margin-top: 26px; }
[data-state="thome"]:not(.code-ok) .btn-main { opacity: 0; pointer-events: none; transition-duration: .4s; }

.portrait .code-form { left: 109px; width: 550px; top: 740px; }
.portrait .code-label { font-size: 26px; }
.portrait .code-box { height: 70px; }
.portrait .code-display span { width: 26px; height: 34px; font-size: 28px; }
.portrait .code-display .slot-empty::before { width: 18px; }
.portrait .code-display .dash { width: 18px; }
.portrait .code-form .btn-outline { width: 380px; }

/* ==========================================================
   DIAGNOSTIC TEST
   ========================================================== */
.exam { z-index: 5; color: var(--blue); }
.x-progress { position: absolute; left: 383px; width: 600px; top: 84px; text-align: center; }
.x-bar { height: 8px; border-radius: 999px; background: rgba(28, 69, 147, .15); overflow: hidden; }
.x-bar span { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 999px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
#xStep { display: block; margin-top: 8px; font-size: 14px; letter-spacing: .04em; color: rgba(28, 69, 147, .75); min-height: 18px; }
.x-body { position: absolute; left: 80px; right: 80px; top: 150px; bottom: 60px; overflow-y: auto; }
.x-body.show > * { animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.x-center { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 960px; margin: 0 auto; }
.x-lead { font-size: 20px; line-height: 1.5; margin: 16px 0 10px; max-width: 760px; }
.x-facts { list-style: none; display: flex; gap: 14px; margin: 14px 0 18px; flex-wrap: wrap; justify-content: center; }
.x-facts li { background: rgba(255, 255, 255, .6); border-radius: 999px; padding: 10px 20px; font-size: 16px; }
.x-note { font-size: 15px; line-height: 1.6; color: rgba(28, 69, 147, .8); max-width: 760px; }
.x-note.warn { background: #fff7e8; color: #7a4b00; border-radius: 16px; padding: 12px 18px; margin-top: 10px; }
.x-q { font-size: 28px; line-height: 1.35; margin: 18px 0 26px; max-width: 900px; }
.x-blank { letter-spacing: .05em; color: rgba(28, 69, 147, .55); }
.x-options { display: grid; grid-template-columns: repeat(2, minmax(0, 420px)); gap: 14px 18px; width: 100%; justify-content: center; }
.x-options.one-col { grid-template-columns: 1fr; }
.x-opt {
  display: flex; align-items: center; gap: 14px; text-align: left;
  min-height: 60px; padding: 10px 18px 10px 12px;
  border: 2px solid rgba(28, 69, 147, .35); border-radius: 20px;
  background: rgba(255, 255, 255, .7); color: #1d2433; font-size: 18px; cursor: pointer;
  transition: border-color .15s, background-color .15s, transform .15s, box-shadow .15s;
}
.x-opt:hover:not(:disabled) { border-color: var(--blue); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(28, 69, 147, .15); }
.x-opt:disabled { opacity: .5; cursor: not-allowed; }
.x-opt.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.x-letter { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(28, 69, 147, .12); color: var(--blue); font-weight: 500; font-size: 15px; }
.x-opt.on .x-letter { background: rgba(255, 255, 255, .2); color: #fff; }
.x-opt:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.x-read { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: start; height: 100%; }
.x-passage {
  background: #fff; border-radius: 24px; padding: 26px 30px; font-size: 18px; line-height: 1.65; color: #1d2433;
  max-height: 100%; overflow-y: auto; box-shadow: 0 10px 30px rgba(28, 69, 147, .1); text-align: left;
}
.x-passage.small { font-size: 16px; max-width: 760px; margin-top: 10px; }
.x-side { text-align: left; }
.x-side .x-q { font-size: 23px; margin: 12px 0 18px; }
.x-side .t-actions { justify-content: flex-start; }

.x-audio { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 6px; }
.x-play { width: 92px; height: 92px; border-radius: 50%; border: 0; background: var(--blue); color: var(--gray); cursor: pointer; display: grid; place-items: center; transition: transform .2s, box-shadow .2s, opacity .2s; }
.x-play svg { width: 44px; height: 44px; margin-left: 6px; }
.x-play:hover:not(:disabled) { transform: scale(1.05); box-shadow: 0 14px 30px rgba(28, 69, 147, .35); }
.x-play:disabled { opacity: .45; cursor: default; }
.x-play.playing { animation: pulse 1.2s ease-in-out infinite; opacity: 1; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(28, 69, 147, .45); } 50% { box-shadow: 0 0 0 18px rgba(28, 69, 147, 0); } }
.x-plays { font-size: 15px; color: rgba(28, 69, 147, .8); }
.x-audio + .x-q { margin-top: 12px; }

.x-result { display: grid; grid-template-columns: 340px 1fr; gap: 40px; align-items: start; max-width: 1060px; margin: 0 auto; }
.x-badge { background: var(--blue); color: var(--gray); border-radius: 32px; padding: 30px 24px; text-align: center; }
.x-badge .t-kicker { color: rgba(200, 209, 217, .8); }
.x-big { font-size: 110px; line-height: 1; color: #fff; margin: 6px 0; }
.x-name { font-size: 24px; color: #fff; }
.x-band { font-size: 18px; margin-top: 14px; }
.x-small { font-size: 15px; opacity: .8; margin-top: 6px; }
.x-detail h3 { font-size: 20px; font-weight: 500; margin: 4px 0 14px; }
.x-detail h3 + .x-row { margin-top: 0; }
.x-row { display: grid; grid-template-columns: 130px 1fr 48px; align-items: center; gap: 14px; margin-bottom: 12px; font-size: 18px; }
.x-track { height: 14px; background: rgba(28, 69, 147, .12); border-radius: 999px; overflow: hidden; }
.x-track span { display: block; height: 100%; background: var(--blue); border-radius: 999px; animation: grow 1s cubic-bezier(.2, .8, .2, 1) both .2s; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.x-lvl { font-weight: 500; text-align: right; }
.x-practice { margin: 0 0 6px 20px; font-size: 16px; line-height: 1.7; }
.x-detail h3:nth-of-type(2) { margin-top: 24px; }
.t-actions.left { justify-content: flex-start; }

.portrait .x-progress { left: 134px; width: 500px; top: 150px; }
.portrait .x-body { left: 40px; right: 40px; top: 220px; bottom: 80px; }
.portrait .x-q { font-size: 32px; }
.portrait .x-options { grid-template-columns: 1fr; }
.portrait .x-opt { font-size: 22px; min-height: 72px; }
.portrait .x-read { grid-template-columns: 1fr; height: auto; }
.portrait .x-passage { max-height: 420px; font-size: 21px; }
.portrait .x-result { grid-template-columns: 1fr; }
.portrait .x-lead { font-size: 23px; }

/* ---------- Study plan ---------- */
.p-plan { max-width: 1120px; margin: 0 auto; }
.p-head { display: grid; grid-template-columns: 1fr 300px; gap: 30px; align-items: start; margin-bottom: 22px; }
.p-head .t-title { text-align: left; margin: 4px 0 8px; }
.p-head .x-note { max-width: none; }
.p-split { background: var(--blue); color: var(--gray); border-radius: 24px; padding: 18px 22px; }
.p-split-t { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; opacity: .8; margin-bottom: 8px; }
.p-split ul { list-style: none; }
.p-split li { display: grid; grid-template-columns: 1fr auto 34px; gap: 10px; padding: 5px 0; font-size: 16px; border-top: 1px solid rgba(200, 209, 217, .2); }
.p-split li:first-child { border-top: 0; }
.p-split strong { color: #fff; font-weight: 500; }
.p-split em { font-style: normal; text-align: right; opacity: .8; }
.p-weeks { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.p-week { position: relative; background: rgba(255, 255, 255, .7); border-radius: 24px; padding: 20px 22px 16px 70px; }
.p-num { position: absolute; left: 20px; top: 18px; width: 36px; height: 36px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 500; }
.p-week h3 { font-size: 19px; font-weight: 500; color: var(--blue); }
.p-focus { font-size: 14px; color: rgba(28, 69, 147, .75); margin: 2px 0 10px; }
.p-week ul { margin-left: 18px; font-size: 15px; line-height: 1.55; color: #1d2433; }
.p-week li { margin-bottom: 5px; }
.p-plan .t-actions { margin: 22px 0 6px; }
.portrait .p-head, .portrait .p-weeks { grid-template-columns: 1fr; }
.portrait .p-week ul { font-size: 18px; }

/* ==========================================================
   PHONES & TABLETS (portrait artboard) — larger text so it
   stays readable once the artboard is scaled down
   ========================================================== */
.portrait label { font-size: 28px; }
.portrait input, .portrait select { height: 66px; font-size: 28px; }
.portrait .pw-rules { font-size: 21px; }
.portrait .legend { font-size: 21px; }
.portrait .links { font-size: 23px; }
.portrait .eye { font-size: 17px; }
.portrait .diag-hello { font-size: 32px; }
.portrait .diag-foot { font-size: 24px; }
.portrait #toast { font-size: 26px; padding: 16px 30px; }

.portrait .t-kicker { font-size: 20px; }
.portrait .t-hint { font-size: 24px; }
.portrait .q-chip small { font-size: 18px; }
.portrait .g-row > span { font-size: 28px; }
.portrait .chip-box input { font-size: 24px; height: 44px; }
.portrait .g-chip { font-size: 22px; height: 42px; }
.portrait .t-content h2 { font-size: 36px; }
.portrait .card .c-title { font-size: 30px; }
.portrait .card.course .c-title { font-size: 34px; }
.portrait .card .c-sub { font-size: 21px; }
.portrait .tab { font-size: 24px; }
.portrait .course-head .count { font-size: 21px; }
.portrait .roster { font-size: 21px; }
.portrait .roster th { font-size: 19px; }
.portrait .pill { font-size: 18px; }
.portrait .empty { font-size: 24px; }
.portrait .notice { font-size: 22px; }

.portrait .x-progress { top: 172px; }
.portrait #xStep { font-size: 19px; }
.portrait .x-body { top: 228px; }
.portrait .x-q { font-size: 40px; }
.portrait .x-side .x-q { font-size: 34px; }
.portrait .x-opt { font-size: 29px; min-height: 84px; border-radius: 26px; }
.portrait .x-letter { width: 44px; height: 44px; font-size: 20px; }
.portrait .x-passage { font-size: 28px; }
.portrait .x-lead { font-size: 28px; }
.portrait .x-note { font-size: 22px; }
.portrait .x-facts li { font-size: 22px; }
.portrait .x-plays { font-size: 22px; }
.portrait .x-play { width: 120px; height: 120px; }
.portrait .x-big { font-size: 150px; }
.portrait .x-name { font-size: 32px; }
.portrait .x-band { font-size: 24px; }
.portrait .x-small { font-size: 21px; }
.portrait .x-detail h3 { font-size: 28px; }
.portrait .x-row { font-size: 25px; grid-template-columns: 170px 1fr 56px; }
.portrait .x-practice { font-size: 23px; }
.portrait .p-head .t-title { font-size: 42px; }
.portrait .p-split li { font-size: 24px; }
.portrait .p-split-t { font-size: 18px; }
.portrait .p-week h3 { font-size: 28px; }
.portrait .p-focus { font-size: 21px; }
.portrait .p-week ul { font-size: 23px; }
.portrait .p-num { width: 46px; height: 46px; font-size: 22px; }
.portrait .p-week { padding-left: 84px; }
.portrait .btn-blue { font-size: 28px; }
.portrait .mail-meta { font-size: 16px; }
