/* The results website. One file, no framework: fast on a village phone connection. */
@font-face { font-family: "Noto Sans Bengali"; src: url("fonts/bn-400.ttf") format("truetype"); font-weight: 400; font-display: swap; unicode-range: U+0980-09FF, U+200C-200D, U+0964-0965; }
@font-face { font-family: "Noto Sans Bengali"; src: url("fonts/bn-700.ttf") format("truetype"); font-weight: 600 800; font-display: swap; unicode-range: U+0980-09FF, U+200C-200D, U+0964-0965; }

:root {
  --navy: #12305a;
  --navy-2: #1d4b8f;
  --sky: #3d7be0;
  --gold: #f4b13f;
  --gold-2: #ffd88a;
  --ink: #162033;
  --ink-2: #4a5670;
  --line: #e3e8f1;
  --paper: #ffffff;
  --bg: #f3f6fb;
  --ok: #17915f;
  --ok-bg: #e5f6ee;
  --warn: #b25b05;
  --warn-bg: #fff3e0;
  --bad: #c0352b;
  --bad-bg: #fdecea;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(18, 48, 90, .06), 0 12px 32px -12px rgba(18, 48, 90, .22);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, "Noto Sans Bengali", "Nirmala UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.bn { font-family: "Noto Sans Bengali", var(--font); }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- hero ---------- */
.hero { position: relative; color: #fff; padding: 18px 0 120px; overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(244, 177, 63, .35), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(61, 123, 224, .55), transparent 60%),
    linear-gradient(135deg, #0d2445 0%, #12305a 45%, #1d4b8f 100%); }
.hero-bg::after { content: ""; position: absolute; inset: 0; opacity: .12;
  background-image: radial-gradient(rgba(255,255,255,.9) 1px, transparent 1.2px); background-size: 22px 22px;
  mask-image: linear-gradient(180deg, #000, transparent 85%); -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 56px; height: 56px; flex: none; border-radius: 16px; background: #fff; display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.4); }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.brand-mark span { font-weight: 800; font-size: 1.35rem; color: var(--navy); letter-spacing: .02em; }
.brand-text { display: grid; min-width: 0; }
.brand-text strong { font-size: 1.15rem; line-height: 1.25; }
.brand-text span { color: #c9d8f0; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-btn { margin-left: auto; font: inherit; font-size: .8rem; color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  padding: 7px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.chip-btn:hover { background: rgba(255,255,255,.2); }
.hero-copy { margin-top: 44px; max-width: 720px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--gold-2); }
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--gold); border-radius: 2px; }
.hero h1 { margin: 0; font-size: clamp(1.9rem, 4.6vw, 3.1rem); line-height: 1.12; letter-spacing: -.02em; font-weight: 800; }
.hero .accent { background: linear-gradient(90deg, var(--gold), var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin: 14px 0 0; color: #d6e2f5; font-size: 1.02rem; }
.exam-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.exam-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(4px); }
.exam-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.25); }
.exam-chip.none::before { background: var(--gold); box-shadow: 0 0 0 3px rgba(244,177,63,.25); }

/* ---------- shared blocks ---------- */
main { margin-top: -84px; position: relative; padding-bottom: 40px; }
.panel { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(18px, 3vw, 30px); border: 1px solid rgba(18,48,90,.05); }
h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.01em; color: var(--navy); }
h3 { margin: 0 0 12px; font-size: 1.02rem; color: var(--navy); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
h3 .bn { font-size: .85rem; font-weight: 500; color: var(--ink-2); }

/* ---------- the form ---------- */
.ask { display: grid; grid-template-columns: 1fr 1.25fr; gap: 22px; align-items: start; }
.how { background: linear-gradient(160deg, #ffffff, #f6f9ff); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(18px, 3vw, 30px); border: 1px solid rgba(18,48,90,.05); }
.how .bn.muted { margin: 2px 0 18px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: flex; gap: 14px; align-items: center; }
.steps .num { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: var(--navy);
  background: linear-gradient(135deg, var(--gold-2), var(--gold)); box-shadow: 0 6px 14px -6px rgba(244,177,63,.8); }
.steps b { display: block; font-size: .98rem; }
.steps small { color: var(--ink-2); }
.trust { display: flex; gap: 12px; margin-top: 22px; padding: 14px; border-radius: 14px; background: var(--ok-bg); color: #0f5e3e; font-size: .88rem; }
.trust p { margin: 0; }
.trust-icon svg { width: 26px; height: 26px; fill: var(--ok); }
.form-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.form-title .bn { font-size: .95rem; font-weight: 500; color: var(--ink-2); }
form { display: grid; gap: 16px; margin-top: 18px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 650; font-size: .9rem; color: var(--ink); display: flex; gap: 8px; align-items: baseline; }
.field em { font-style: normal; font-weight: 500; font-size: .8rem; color: var(--ink-2); }
input, select { font: inherit; width: 100%; min-height: 52px; padding: 12px 14px; color: var(--ink); background: #f8fafd; border: 1.5px solid var(--line);
  border-radius: 12px; transition: border-color .15s, box-shadow .15s, background .15s; appearance: none; -webkit-appearance: none; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234a5670'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 24px; padding-right: 40px; }
input:hover, select:hover { border-color: #c5cfe0; }
input:focus, select:focus { outline: none; border-color: var(--sky); background: #fff; box-shadow: 0 0 0 4px rgba(61,123,224,.15); }
.btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 12px 22px; border-radius: 12px;
  border: 0; cursor: pointer; font-weight: 700; text-decoration: none; transition: transform .1s, box-shadow .15s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(61,123,224,.45); outline-offset: 2px; }
.btn.primary { color: #fff; background: linear-gradient(135deg, var(--navy-2), var(--navy)); box-shadow: 0 10px 22px -10px rgba(18,48,90,.8); }
.btn.primary:hover { box-shadow: 0 14px 28px -10px rgba(18,48,90,.9); }
.btn.gold { color: var(--navy); background: linear-gradient(135deg, var(--gold-2), var(--gold)); box-shadow: 0 10px 22px -12px rgba(244,177,63,.9); }
.btn.ghost { color: var(--navy); background: #eef3fb; }
.btn.ghost:hover { background: #e3ebf8; }
.btn.block { width: 100%; min-height: 56px; font-size: 1.05rem; }
.btn-sub { font-weight: 500; opacity: .85; font-size: .9rem; }
.btn svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.btn[disabled] { opacity: .65; cursor: progress; }
.btn.loading .btn-label::before { content: ""; display: inline-block; width: 16px; height: 16px; margin-right: 10px; vertical-align: -2px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--bad-bg); color: var(--bad); font-weight: 600; font-size: .92rem; border: 1px solid #f6c9c4; }

/* ---------- the result ---------- */
.result { display: grid; gap: 22px; animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.student { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; }
.avatar { width: 68px; height: 68px; border-radius: 20px; display: grid; place-items: center; font-weight: 800; font-size: 1.5rem; color: #fff;
  background: linear-gradient(135deg, var(--sky), var(--navy)); box-shadow: 0 10px 22px -10px rgba(29,75,143,.9); }
.student h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); color: var(--ink); }
.session { font-size: .85rem; color: var(--ink-2); margin-top: 2px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fact { background: #f1f5fb; border-radius: 10px; padding: 5px 10px; font-size: .83rem; }
.fact b { color: var(--navy); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge svg { width: 18px; height: 18px; fill: currentColor; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.tile { display: flex; align-items: center; gap: 16px; background: var(--paper); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border: 1px solid rgba(18,48,90,.05); }
.ring { --p: 0; --c: var(--sky); width: 84px; height: 84px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), #e8eef8 0); }
.ring::before { content: ""; grid-area: 1 / 1; width: 66px; height: 66px; border-radius: 50%; background: #fff; }
.ring span { grid-area: 1 / 1; font-weight: 800; font-size: 1.02rem; color: var(--ink); z-index: 1; }
.tile .label { font-size: .78rem; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.tile .big { font-size: 1.25rem; font-weight: 800; color: var(--ink); }
.tile .sub { font-size: .85rem; color: var(--ink-2); }

.final { position: relative; overflow: hidden; color: #fff; border-radius: var(--radius); padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow);
  background: radial-gradient(500px 240px at 100% 0, rgba(244,177,63,.35), transparent 60%), linear-gradient(135deg, #0f2a50, #1d4b8f); }
.final h3 { color: #fff; }
.final h3 .bn { color: #c9d8f0; }
.final-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.final-item { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 12px 14px; }
.final-item .k { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: #c9d8f0; }
.final-item .v { font-size: 1.25rem; font-weight: 800; margin-top: 2px; }
.final-item.hero-item { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--navy); border: 0; }
.final-item.hero-item .k { color: #6b4a06; }
.final-item.hero-item .v { font-size: 1.9rem; line-height: 1.1; }

.marks-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table.marks { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .93rem; }
.marks th, .marks td { padding: 10px 8px; text-align: center; white-space: nowrap; }
.marks thead th { background: #f1f5fb; color: var(--navy); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.marks thead tr:first-child th:first-child { border-top-left-radius: 12px; }
.marks thead tr:first-child th:last-child { border-top-right-radius: 12px; }
.marks thead th.exam { font-size: .82rem; text-transform: none; letter-spacing: 0; border-left: 3px solid #fff; }
.marks thead tr + tr th { font-size: .72rem; color: var(--ink-2); padding-top: 0; }
.marks tbody td { border-bottom: 1px solid var(--line); }
.marks tbody tr:hover td { background: #f8fbff; }
.marks td.subj { text-align: left; font-weight: 600; white-space: normal; min-width: 150px; }
.marks td.tot { font-weight: 800; color: var(--navy); }
.marks td.first { border-left: 3px solid #f1f5fb; }
.marks tfoot td { font-weight: 800; background: #f8fafd; color: var(--navy); }

.subject-cards { display: none; gap: 10px; }
.subject-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.subject-card b { display: block; margin-bottom: 6px; }
.subject-card .line { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; padding: 4px 0; border-top: 1px dashed var(--line); }
.subject-card .line:first-of-type { border-top: 0; }
.subject-card .line strong { color: var(--navy); }

.remarks { display: grid; gap: 12px; }
.remark { position: relative; padding: 14px 16px 14px 46px; background: #fbf8f1; border-radius: 14px; border: 1px solid #f1e5c8; }
.remark::before { content: "\201C"; position: absolute; left: 14px; top: 2px; font-size: 2.6rem; color: var(--gold); font-family: Georgia, serif; }
.remark b { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: #8a6514; margin-bottom: 2px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.notice { display: flex; gap: 16px; align-items: flex-start; }
.notice .icon { width: 52px; height: 52px; flex: none; border-radius: 16px; display: grid; place-items: center; background: var(--warn-bg); }
.notice .icon svg { width: 28px; height: 28px; fill: var(--warn); }
.notice h2 { color: var(--ink); }
.notice p { margin: 6px 0 0; }

/* ---------- the card check ---------- */
.verify { max-width: 820px; margin-inline: auto; }
.seal { display: flex; align-items: center; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.seal .mark { width: 72px; height: 72px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--ok-bg);
  box-shadow: 0 0 0 8px rgba(23,145,95,.08); }
.seal .mark svg { width: 38px; height: 38px; fill: var(--ok); }
.seal.bad .mark { background: var(--bad-bg); box-shadow: 0 0 0 8px rgba(192,53,43,.08); }
.seal.bad .mark svg { fill: var(--bad); }
.seal h2 { color: var(--ink); font-size: 1.35rem; }
.seal p { margin: 2px 0 0; }
.skeleton { height: 14px; border-radius: 8px; background: linear-gradient(90deg, #eef2f8, #f8fafd, #eef2f8); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin: 10px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- footer ---------- */
.footer { padding: 26px 0 36px; border-top: 1px solid var(--line); background: #fff; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.footer p { margin: 4px 0 0; }
.footer .small:last-child { text-align: right; }

/* ---------- phones ---------- */
@media (max-width: 860px) {
  .ask { grid-template-columns: 1fr; }
  .how { order: 2; }
}
@media (max-width: 640px) {
  .hero { padding-bottom: 100px; }
  .hero-copy { margin-top: 28px; }
  .brand-mark { width: 46px; height: 46px; border-radius: 13px; }
  .brand-text strong { font-size: 1rem; }
  .row-2 { grid-template-columns: 1fr; }
  .student { grid-template-columns: auto 1fr; }
  .student .badge { grid-column: 1 / -1; justify-self: start; }
  .avatar { width: 56px; height: 56px; border-radius: 16px; font-size: 1.2rem; }
  .marks-wrap { display: none; }
  .subject-cards { display: grid; }
  .actions .btn { flex: 1 1 100%; }
  .footer .small:last-child { text-align: left; }
  .tile { padding: 14px; }
}

/* ---------- printing ---------- */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 12px; }
  .hero { color: var(--ink); padding: 0 0 8px; }
  .hero-bg, .hero-copy, .chip-btn, #ask, .actions, .footer, .skip { display: none !important; }
  .brand-text span { color: var(--ink-2); }
  main { margin-top: 0; }
  .panel, .tile, .how { box-shadow: none; border: 1px solid var(--line); }
  .final { color: var(--ink); background: #fff; border: 1px solid var(--line); box-shadow: none; }
  .final h3, .final-item .k, .final-item .v { color: var(--ink) !important; }
  .final-item { border-color: var(--line); background: #fff; }
  .marks-wrap { display: block !important; overflow: visible; }
  .subject-cards { display: none !important; }
  .result { animation: none; gap: 12px; }
  .ring { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
