/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --deep-sea: #0b6e4f;
  --sea: #148a63;
  --lime: #8bd346;
  --lime-deep: #6cb52e;
  --mint-bg: #eaf7ee;
  --mint-card: #ffffff;
  --mint-line: #d8efdf;
  --ink: #12261e;
  --muted: #5c7268;
  --gold: #d99a2b;
  --red: #c0392b;

  --shadow-soft: 0 18px 40px -18px rgba(11, 110, 79, 0.35);
  --shadow-tight: 0 8px 20px -10px rgba(11, 110, 79, 0.4);

  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --font-head: 'Manrope', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-num: 'Space Grotesk', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--mint-bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(circle at 12% 8%, rgba(139, 211, 70, 0.16), transparent 45%),
    radial-gradient(circle at 88% 92%, rgba(11, 110, 79, 0.12), transparent 40%);
}

a { color: var(--deep-sea); }

.page { min-height: 100vh; display: flex; flex-direction: column; }

/* ==========================================================================
   Letterhead band
   ========================================================================== */
.brandband {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--deep-sea) 0%, var(--sea) 55%, #1fae76 100%);
  padding: 30px 20px 46px;
}

.brandband__sheen {
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 140%;
  background: linear-gradient(115deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 32%);
  pointer-events: none;
}

.brandband__inner {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.seal {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

.brandband__eyebrow {
  margin: 0;
  color: #cdf5df;
  font-size: 13px;
  font-weight: 500;
}

.brandband__title {
  margin: 2px 0 0;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(24px, 5vw, 30px);
  color: #ffffff;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.wrap {
  flex: 1;
  max-width: 640px;
  width: 100%;
  margin: -28px auto 40px;
  padding: 0 20px;
  position: relative;
}

.card {
  background: var(--mint-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--mint-line);
  box-shadow: var(--shadow-soft);
  padding: 30px 26px 26px;
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139,211,70,0.55), transparent);
}

.card__title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 21px;
  margin: 0 0 8px;
  color: var(--ink);
}

.card__hint {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}

/* ==========================================================================
   Form fields
   ========================================================================== */
.field { display: block; margin-bottom: 6px; }

.field__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--deep-sea);
  margin-bottom: 6px;
}

#roll_number,
#dob {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-family: var(--font-num);
  letter-spacing: 0.02em;
  border: 1.5px solid var(--mint-line);
  border-radius: var(--radius-md);
  background: #f7fdf9;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}

#roll_number:focus,
#dob:focus {
  outline: none;
  border-color: var(--lime-deep);
  box-shadow: 0 0 0 4px rgba(139, 211, 70, 0.22);
}

.field + .field {
  margin-top: 16px;
}

.field__error {
  min-height: 18px;
  margin: 6px 0 16px;
  color: var(--red);
  font-size: 13.5px;
}

/* ==========================================================================
   Buttons — glossy sheen
   ========================================================================== */
.btn {
  --btn-h: 50px;
  position: relative;
  overflow: hidden;
  width: 100%;
  height: var(--btn-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15.5px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.btn--primary {
  color: #ffffff;
  background: linear-gradient(180deg, #a7e05c 0%, var(--lime) 34%, var(--lime-deep) 100%);
  box-shadow: var(--shadow-tight), inset 0 1px 0 rgba(255,255,255,0.6);
}

.btn--primary .btn__label { color: #0d3b23; }

.btn--primary::after {
  content: "";
  position: absolute;
  top: 0; left: -10%;
  width: 45%;
  height: 100%;
  background: linear-gradient(115deg, rgba(255,255,255,0.55), rgba(255,255,255,0));
  transform: skewX(-18deg);
}

.btn--primary:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn--primary:active { transform: translateY(0); filter: brightness(0.98); }

.btn--sm { height: 44px; font-size: 14.5px; }

.btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.btn:focus-visible {
  outline: 3px solid var(--deep-sea);
  outline-offset: 2px;
}

.btn__spinner {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(13,59,35,0.35);
  border-top-color: #0d3b23;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.link-btn {
  background: none;
  border: none;
  color: var(--deep-sea);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 2px;
}
.link-btn:disabled { color: #9db3a9; cursor: not-allowed; }
.link-btn:focus-visible { outline: 2px solid var(--deep-sea); outline-offset: 2px; border-radius: 4px; }

.card__footer {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   OTP boxes
   ========================================================================== */
.otp-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 6px;
}

.otp-box {
  width: 46px;
  height: 56px;
  text-align: center;
  font-family: var(--font-num);
  font-size: 24px;
  font-weight: 700;
  color: var(--deep-sea);
  border: 1.5px solid var(--mint-line);
  border-radius: var(--radius-sm);
  background: #f7fdf9;
}

.otp-box:focus {
  outline: none;
  border-color: var(--lime-deep);
  box-shadow: 0 0 0 4px rgba(139, 211, 70, 0.22);
}

/* ==========================================================================
   Report card
   ========================================================================== */
.card--report { padding: 0; overflow: hidden; }

.report__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 26px 20px;
  background: linear-gradient(180deg, #f2fbf5, #ffffff);
  border-bottom: 1px dashed var(--mint-line);
}

.report__eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.report__title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 22px;
  color: var(--ink);
}

.report__seal {
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 32% 28%, #d9f5b0, var(--lime) 55%, var(--lime-deep) 100%);
  color: #0d3b23;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 20px;
  box-shadow: var(--shadow-tight);
  border: 2px solid #ffffff;
}

.report__grid {
  margin: 0;
  padding: 18px 26px;
}

.report__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dotted var(--mint-line);
  font-size: 14.5px;
}
.report__row:last-child { border-bottom: none; }

.report__row dt { color: var(--muted); }
.report__row dd { margin: 0; font-weight: 600; text-align: right; color: var(--ink); }

.marks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--mint-line);
  margin: 4px 26px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.marks__cell {
  background: #f7fdf9;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.marks__cell--accent { background: linear-gradient(180deg, #eafce1, #f7fdf9); }

.marks__label {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}

.marks__value {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 22px;
  color: var(--deep-sea);
}

.stamp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 22px 26px 26px;
}

.stamp {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--deep-sea);
  border: 3px solid var(--deep-sea);
  border-radius: 10px;
  padding: 8px 16px;
  transform: rotate(-6deg);
  opacity: 0.9;
}

.stamp[data-status="FAIL"] {
  color: var(--red);
  border-color: var(--red);
}

.report__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Toast
   ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #eafff2;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,0.4);
  z-index: 20;
}
.toast[data-tone="error"] { background: #4a1414; color: #ffe1de; }

/* ==========================================================================
   Footer
   ========================================================================== */
.foot {
  text-align: center;
  padding: 18px 20px 30px;
  color: var(--muted);
  font-size: 13px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 480px) {
  .wrap { margin-top: -22px; }
  .card { padding: 24px 18px 20px; }
  .otp-box { width: 40px; height: 50px; font-size: 20px; }
  .report__head, .report__grid, .stamp-row { padding-left: 18px; padding-right: 18px; }
  .marks { margin-left: 18px; margin-right: 18px; grid-template-columns: repeat(3, 1fr); }
  .marks__value { font-size: 18px; }
  .report__actions { width: 100%; flex-direction: column; align-items: stretch; }
  .btn--sm { width: 100%; }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .btn--primary:hover { transform: none; }
  .btn__spinner { animation: none; }
}

[hidden] { display: none !important; }
