/* StudyFlow access website + admin panel.
 * Values come from `StudyFlow Access.dc.html`; the palette is the app's
 * (lib/theme/app_colors.dart). Flat: borders and fills only — no shadows,
 * no gradients (CLAUDE.md #4). Only IRANYekanX and Hasti (CLAUDE.md #2). */

@font-face { font-family: 'YekanX'; src: url('/assets/fonts/YekanX-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'YekanX'; src: url('/assets/fonts/YekanX-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'YekanX'; src: url('/assets/fonts/YekanX-DemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'YekanX'; src: url('/assets/fonts/YekanX-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'YekanX'; src: url('/assets/fonts/YekanX-ExtraBold.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'YekanX'; src: url('/assets/fonts/YekanX-Black.woff2') format('woff2'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'Hasti'; src: url('/assets/fonts/Hasti-Heavy.woff') format('woff'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'HastiNum'; src: url('/assets/fonts/HastiFaNum-Heavy.woff') format('woff'); font-weight: 900; font-display: swap; }

:root, [data-theme="light"] {
  --bg: #F5F6FA; --card: #FFFFFF; --card2: #FAFAFD; --line: #ECEDF4; --line2: #E2E4EE;
  --ink: #101223; --ink2: #5B6174; --ink3: #5F6578;
  --acc: #18227A; --accSoft: #E9EBF7; --accInk: #FFFFFF;
  --mint: #0A6E63; --mintInk: #FFFFFF; --mintSoft: #E3F5F2; --amber: #96590A; --amberSoft: #FBF0DF;
  --rose: #C42630; --roseSoft: #FBEAEB; --track: #EFF0F6; --field: #FFFFFF;
  --backdrop: rgba(16, 18, 35, .42);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0A0B12; --card: #12141F; --card2: #171A27; --line: #232739; --line2: #2C3145;
  --ink: #F7F8FC; --ink2: #9AA1B8; --ink3: #8E96AE;
  --acc: #4DA3FF; --accSoft: #052659; --accInk: #021024;
  --mint: #2BD3B4; --mintInk: #06231F; --mintSoft: rgba(43, 211, 180, .15); --amber: #F0B23F; --amberSoft: rgba(240, 178, 63, .15);
  --rose: #FF6069; --roseSoft: rgba(255, 96, 105, .15); --track: #1D2130; --field: #0E1018;
  --backdrop: rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: 'YekanX'; font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--acc); text-decoration: none; }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.hasti { font-family: 'HastiNum', 'Hasti'; font-weight: 900; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* Icons: one Hugeicons sprite (scripts/build-icons.py). */
.i { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-14 { width: 14px; height: 14px; } .i-15 { width: 15px; height: 15px; } .i-16 { width: 16px; height: 16px; }
.i-17 { width: 17px; height: 17px; } .i-18 { width: 18px; height: 18px; } .i-20 { width: 20px; height: 20px; }
.i-23 { width: 23px; height: 23px; } .i-26 { width: 26px; height: 26px; } .i-38 { width: 38px; height: 38px; } .i-40 { width: 40px; height: 40px; }
.sw-19 { stroke-width: 1.9; } .sw-2 { stroke-width: 2; } .sw-21 { stroke-width: 2.1; }

/* Small controls keep the design's size; the hit area grows to 44×44 (CLAUDE.md #8). */
.hit { position: relative; }
.hit::after { content: ''; position: absolute; inset: 50% auto auto 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%); }

/* ---------- Public frame (560 wide) ---------- */
.frame { width: 100%; max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--bg); }
@media (min-width: 620px) {
  body.public { padding: 32px 0 56px; }
  .frame { min-height: 0; border: 1px solid var(--line2); border-radius: 26px; overflow: hidden; }
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-tile { width: 34px; height: 34px; border-radius: 11px; background: var(--acc); display: flex; align-items: center; justify-content: center; flex: none; }
.brand-tile img { width: 19px; height: 19px; object-fit: contain; }
.brand-name { font-family: 'HastiNum', 'Hasti'; font-weight: 900; font-size: 16px; color: var(--ink); line-height: 1.5; }
.brand-sub { font-size: 11.5px; color: var(--ink3); margin-top: 2px; line-height: 1.4; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--track); color: var(--ink2); padding: 7px 11px; border-radius: 10px; font-size: 12px; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.chip.mint { background: var(--mintSoft); color: var(--mint); font-size: 12.5px; padding: 7px 12px; gap: 7px; }
.chip.tid { font-size: 12.5px; padding: 7px 12px; }
.chip.soft { font-weight: 600; gap: 7px; padding: 7px 12px; }

.body { padding: 26px 24px 24px; display: flex; flex-direction: column; gap: 18px; }
.body.status { padding: 30px 24px 26px; gap: 20px; }
.body.result { padding: 34px 24px 26px; gap: 22px; }
.h1 { font-family: 'HastiNum', 'Hasti'; font-weight: 900; font-size: 25px; color: var(--ink); line-height: 1.4; margin: 0; }
.lead { font-size: 14px; color: var(--ink2); margin-top: 8px; line-height: 1.85; }

/* Form */
.note-row { display: flex; align-items: center; gap: 10px; background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; color: var(--ink3); }
.note-row .t { flex: 1; font-size: 12.5px; color: var(--ink2); line-height: 1.7; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.label { font-size: 13px; font-weight: 700; color: var(--ink2); }
.label-row { display: flex; align-items: baseline; gap: 8px; }
.label-row .label { flex: 1; }
.counter { font-size: 12px; color: var(--ink3); font-weight: 600; }
.input { display: flex; align-items: center; gap: 10px; background: var(--field); border: 1px solid var(--line2); border-radius: 14px; padding: 14px 15px; color: var(--ink3); position: relative; min-height: 52px; }
.input:focus-within { border: 2px solid var(--acc); padding: 13px 14px; }
.input.invalid { border: 2px solid var(--rose); padding: 13px 14px; }
.input input, .input select, .input textarea { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; font-weight: 600; color: var(--ink); padding: 0; }
.input input::placeholder, .input textarea::placeholder { color: var(--ink3); font-weight: 500; }
.input input[type=tel] { font-size: 16px; font-weight: 700; letter-spacing: .02em; direction: ltr; text-align: right; }
.input select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-left: 26px; }
.input select:invalid { color: var(--ink3); font-weight: 500; }
.input select option { color: var(--ink); background: var(--card); }
.input .chev { position: absolute; left: 15px; pointer-events: none; color: var(--ink3); }
.input.area { align-items: stretch; min-height: 104px; }
.input textarea { resize: none; min-height: 74px; font-size: 14.5px; font-weight: 500; line-height: 1.95; }
.help { font-size: 12px; color: var(--ink3); }
.row2 { display: flex; gap: 11px; }
.row2 > .field:first-child { flex: 1; }
.row2 > .field.narrow { width: 170px; flex: none; }
@media (max-width: 420px) { .row2 > .field.narrow { width: 42%; } }
.err { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--rose); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { padding: 9px 14px; min-height: 44px; border-radius: 11px; background: var(--card); color: var(--ink2); border: 1px solid var(--line2); font-size: 13.5px; font-weight: 600; }
.opt[aria-checked=true], .opt[aria-pressed=true] { background: var(--accSoft); color: var(--acc); border-color: var(--acc); font-weight: 700; }

/* Buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; border-radius: 16px; font-weight: 700; text-align: center; }
.btn-primary { background: var(--acc); color: var(--accInk); font-size: 17px; padding: 17px; }
.btn-primary.md { font-size: 16px; padding: 16px; }
.btn-primary[disabled], .btn-primary[aria-disabled=true] { background: var(--track); color: var(--ink3); cursor: default; }
.btn-secondary { background: var(--card); border: 1px solid var(--line2); color: var(--ink2); font-size: 15px; padding: 15px; border-radius: 15px; gap: 9px; }
.btn-text { color: var(--acc); font-size: 14px; font-weight: 700; padding: 10px; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.btn .spin { width: 18px; height: 18px; border-radius: 99px; border: 2px solid currentColor; border-top-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn .spin { animation-duration: 2.4s; } }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; }
.foot .t { font-size: 12.5px; color: var(--ink3); line-height: 1.8; }
.support-link { display: inline-flex; align-items: center; gap: 7px; color: var(--ink2); font-size: 12.5px; font-weight: 700; }

/* Banners (status = colour + icon + label) */
.banner { display: flex; align-items: flex-start; gap: 10px; border-radius: 14px; padding: 13px 14px; font-size: 13px; line-height: 1.8; color: var(--ink); }
.banner .i { margin-top: 2px; }
.banner.rose { background: var(--roseSoft); } .banner.rose .i { color: var(--rose); }
.banner.amber { background: var(--amberSoft); } .banner.amber .i { color: var(--amber); }
.banner.acc { background: var(--accSoft); } .banner.acc .i { color: var(--acc); }
.banner.mint { background: var(--mintSoft); } .banner.mint .i { color: var(--mint); }
.banner .t { flex: 1; }
.banner b { font-weight: 800; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.card.r20 { border-radius: 20px; padding: 18px; gap: 12px; }
.divider { height: 1px; background: var(--line); }
.head-row { display: flex; align-items: center; gap: 14px; }
.tile { display: flex; align-items: center; justify-content: center; flex: none; }
.tile-52 { width: 52px; height: 52px; border-radius: 17px; }
.tile-78 { width: 78px; height: 78px; border-radius: 26px; }
.tile-38 { width: 38px; height: 38px; border-radius: 13px; }
.tile-46 { width: 46px; height: 46px; border-radius: 15px; }
.t-amber { background: var(--amberSoft); color: var(--amber); }
.t-mint { background: var(--mintSoft); color: var(--mint); }
.t-acc { background: var(--accSoft); color: var(--acc); }
.t-track { background: var(--track); color: var(--ink2); }
.t-rose { background: var(--roseSoft); color: var(--rose); }
.title-21 { font-family: 'HastiNum', 'Hasti'; font-weight: 900; font-size: 21px; color: var(--ink); line-height: 1.4; }
.dot-label { display: flex; align-items: center; gap: 7px; margin-top: 7px; font-size: 13.5px; font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 99px; flex: none; }
.steps { display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; align-items: center; gap: 12px; }
.step .n { flex: 1; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.step .n.b { font-weight: 700; }
.step .n.later { color: var(--ink3); }
.step .m { font-size: 12.5px; color: var(--ink3); }
.live { display: flex; align-items: center; gap: 9px; background: var(--track); border-radius: 13px; padding: 12px 14px; }
.live .t { flex: 1; font-size: 12.5px; color: var(--ink2); line-height: 1.8; }
.sum { display: flex; gap: 10px; }
.sum > div { flex: 1; min-width: 0; background: var(--card2); border: 1px solid var(--line); border-radius: 13px; padding: 12px; }
.sum .k { font-size: 11.5px; color: var(--ink3); }
.sum .v { font-size: 14px; font-weight: 700; color: var(--ink); margin-top: 4px; }
@media (max-width: 440px) { .sum { flex-direction: column; } }
.help-card { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 15px 17px; }
.help-card .x { flex: 1; min-width: 0; }
.help-card .a { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.help-card .b { font-size: 12.5px; color: var(--ink2); margin-top: 3px; }
.handle { font-size: 13px; font-weight: 700; color: var(--acc); background: var(--accSoft); padding: 8px 12px; border-radius: 11px; white-space: nowrap; }
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; }
.hero .h { font-family: 'HastiNum', 'Hasti'; font-weight: 900; font-size: 27px; color: var(--ink); line-height: 1.4; }
.hero .p { font-size: 14.5px; color: var(--ink2); margin-top: 10px; line-height: 1.9; max-width: 42ch; }
.rows { background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.rows > .r { display: flex; align-items: center; gap: 11px; padding: 14px 16px; }
.rows > .r + .r { border-top: 1px solid var(--line); }
.rows .k { flex: 1; font-size: 13.5px; color: var(--ink2); }
.rows .v { font-size: 14px; font-weight: 700; color: var(--ink); }
.tip { display: flex; align-items: center; gap: 11px; background: var(--accSoft); border-radius: 16px; padding: 15px 16px; color: var(--acc); }
.tip .t { flex: 1; font-size: 13px; color: var(--ink); line-height: 1.8; }
.fine { text-align: center; font-size: 12.5px; color: var(--ink3); line-height: 1.8; }

/* Verification code card */
.code-card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.code-card .cap { text-align: center; font-size: 13px; font-weight: 700; color: var(--ink2); }
.code-line { display: flex; align-items: center; justify-content: center; gap: 8px; }
.code { direction: ltr; font-size: 40px; font-weight: 900; letter-spacing: .12em; line-height: 1.25; color: var(--ink); }
.code.dead { color: var(--ink3); text-decoration: line-through; }
.to-line { display: flex; align-items: center; gap: 4px; }
.to-line .k { flex: 1; font-size: 13px; color: var(--ink2); }
.to-line .v { font-size: 16px; font-weight: 900; color: var(--ink); }
.wait { display: flex; align-items: center; gap: 8px; }
.wait .t { flex: 1; font-size: 13px; font-weight: 700; }
.wait .clock { font-size: 16px; font-weight: 900; color: var(--ink); }
.copy { width: 36px; height: 36px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; color: var(--acc); background: var(--accSoft); flex: none; }
.copy[disabled] { color: var(--ink3); background: var(--track); cursor: default; }
.c-amber { color: var(--amber); } .c-rose { color: var(--rose); } .c-mint { color: var(--mint); } .c-ink3 { color: var(--ink3); } .c-acc { color: var(--acc); }
.bg-amber { background: var(--amber); } .bg-mint { background: var(--mint); } .bg-rose { background: var(--rose); } .bg-ink3 { background: var(--ink3); }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 13px; font-size: 13.5px; font-weight: 700; z-index: 50; max-width: calc(100% - 32px); display: flex; align-items: center; gap: 8px; }

/* Loading */
.loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 60px 24px; color: var(--ink2); font-size: 13.5px; font-weight: 700; }
.ring { width: 34px; height: 34px; border-radius: 99px; border: 3px solid var(--track); border-top-color: var(--acc); animation: spin 1s linear infinite; }
