:root {
  --green-950: #043c31;
  --green-900: #075241;
  --green-800: #08654d;
  --green-700: #0b7a59;
  --green-600: #0b9364;
  --blue-950: #062d59;
  --blue-900: #073a71;
  --blue-800: #0a4c8e;
  --ink: #14231f;
  --muted: #66766f;
  --line: #dfe8e3;
  --surface: #ffffff;
  --background: #f3f7f5;
  --danger: #b42318;
  --danger-soft: #fff1ef;
  --warning: #9a6700;
  --warning-soft: #fff8df;
  --shadow: 0 22px 60px rgba(7, 74, 55, 0.13);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--background);
  font-family: Tahoma, Arial, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.shell { width: min(100% - 32px, 920px); margin-inline: auto; }

.hero {
  position: relative;
  overflow: hidden;
  min-height: 390px;
  color: #fff;
  background:
    radial-gradient(circle at 18% 12%, rgba(255,255,255,.17), transparent 31%),
    linear-gradient(135deg, var(--blue-950) 0%, var(--blue-800) 45%, var(--green-800) 78%, var(--green-600) 100%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .18;
  background-image:
    linear-gradient(45deg, transparent 46%, rgba(255,255,255,.18) 47%, transparent 49%),
    linear-gradient(-45deg, transparent 46%, rgba(255,255,255,.10) 47%, transparent 49%);
  background-size: 70px 70px;
  pointer-events: none;
}
.hero__content { position: relative; z-index: 2; padding-top: 30px; padding-bottom: 115px; }
.hero__glow { position: absolute; border-radius: 999px; filter: blur(6px); opacity: .28; }
.hero__glow--one { width: 310px; height: 310px; background: #65e6a8; left: -120px; top: -140px; }
.hero__glow--two { width: 240px; height: 240px; background: #5db5ff; right: -80px; bottom: -40px; }
.hero__wave { position: absolute; z-index: 3; right: 0; left: 0; bottom: -1px; width: 100%; height: 100px; fill: var(--background); }

.identity { display: flex; align-items: center; gap: 14px; }
.flag {
  position: relative;
  width: 74px;
  height: 48px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  background: #fff;
}
.flag__green, .flag__white { position: absolute; inset-block: 0; width: 50%; }
.flag__green { right: 0; background: #087a4b; }
.flag__white { left: 0; background: #fff; }
.flag__moon { position: absolute; color: #d82232; font-size: 34px; left: 23px; top: 5px; transform: rotate(-18deg); line-height: 1; }
.flag__star { position: absolute; color: #d82232; font-size: 12px; left: 34px; top: 18px; }
.eyebrow { margin: 0 0 4px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; opacity: .82; }
.authority { margin: 0; font-size: .95rem; }

.hero__title-wrap { text-align: center; margin-top: 40px; }
.year-pill { display: inline-flex; padding: 7px 15px; border: 1px solid rgba(255,255,255,.4); border-radius: 99px; background: rgba(255,255,255,.11); backdrop-filter: blur(10px); font-weight: 700; font-size: .87rem; }
h1 { margin: 15px 0 10px; font-size: clamp(1.8rem, 5vw, 3.15rem); line-height: 1.25; }
.hero__title-wrap > p { max-width: 690px; margin: 0 auto; color: rgba(255,255,255,.82); line-height: 1.8; }
.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 760px;
  margin: 24px auto 0;
  padding: 13px 16px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 14px;
  background: rgba(2,30,41,.32);
  backdrop-filter: blur(8px);
  font-size: .9rem;
  line-height: 1.75;
}
.notice p { margin: 0; }
.notice__icon { flex: 0 0 24px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #ffe78c; color: #5b4300; font-weight: 900; }

.main-content { position: relative; z-index: 5; margin-top: -44px; padding-bottom: 60px; }
.card { background: var(--surface); border: 1px solid rgba(7, 82, 65, .08); border-radius: var(--radius); box-shadow: var(--shadow); }
.lookup-card { padding: clamp(22px, 5vw, 42px); }
.card__heading { display: flex; gap: 14px; align-items: center; padding-bottom: 22px; margin-bottom: 25px; border-bottom: 1px solid var(--line); }
.card__heading h2 { margin: 0 0 6px; font-size: 1.45rem; }
.card__heading p { margin: 0; color: var(--muted); font-size: .92rem; }
.section-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: #e6f6ef; color: var(--green-800); font-size: 1.45rem; font-weight: 900; }

.field { margin-bottom: 23px; }
.field label { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; font-weight: 800; font-size: .94rem; }
.label-badge { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--green-800); color: #fff; font-size: .76rem; }
.input-wrap { position: relative; }
.input-wrap input {
  width: 100%;
  height: 58px;
  padding: 0 48px 0 90px;
  border: 1.5px solid #cad9d1;
  border-radius: 13px;
  background: #fbfdfc;
  color: var(--ink);
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
  direction: rtl;
}
.input-wrap input::placeholder { color: #9ba9a2; }
.input-wrap input:focus { border-color: var(--green-600); box-shadow: 0 0 0 4px rgba(11,147,100,.12); background: #fff; }
.input-icon { position: absolute; right: 17px; top: 50%; transform: translateY(-50%); color: var(--green-700); font-weight: 900; }
.reveal-button { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); border: 0; border-radius: 9px; padding: 8px 11px; color: var(--green-800); background: #e9f6f0; font-size: .8rem; font-weight: 800; }
.field-hint { margin: 8px 2px 0; color: var(--danger); font-size: .78rem; }

.verification-box { padding: 20px; margin-bottom: 24px; border: 1px dashed #b9d1c5; border-radius: 16px; background: linear-gradient(135deg, #f7fbf9, #eff8f4); }
.verification-box__field { margin: 0; }
.challenge-line { display: flex; align-items: center; gap: 10px; margin: 3px 0 13px; color: var(--muted); }
.challenge { display: inline-flex; min-width: 92px; justify-content: center; padding: 8px 14px; border-radius: 9px; background: var(--green-950); color: #fff; letter-spacing: .12em; direction: ltr; }
.refresh { border: 0; width: 34px; height: 34px; border-radius: 50%; background: #dfeee7; color: var(--green-800); font-size: 1.1rem; }
.input-wrap--short { max-width: 330px; }

.form-message { min-height: 0; margin-bottom: 14px; border-radius: 12px; font-size: .9rem; line-height: 1.65; }
.form-message:not(:empty) { padding: 12px 14px; color: var(--danger); background: var(--danger-soft); border: 1px solid #ffc9c2; }
.primary-button, .secondary-button {
  border: 0;
  border-radius: 13px;
  min-height: 56px;
  padding: 0 20px;
  font-weight: 900;
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.primary-button { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; color: #fff; background: linear-gradient(135deg, var(--green-800), var(--green-600)); box-shadow: 0 12px 24px rgba(11,122,89,.22); }
.primary-button:hover, .secondary-button:hover { transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: .7; transform: none; }
.button-icon { font-size: 1.3rem; }
.spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.42); border-top-color: #fff; animation: spin .7s linear infinite; }
.primary-button.is-loading .spinner { display: inline-block; }
.primary-button.is-loading .button-icon { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.demo-credentials { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--warning-soft); color: #755000; font-size: .84rem; text-align: center; }
.demo-credentials p { margin: 0; }

.result-card { overflow: hidden; }
.status-banner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 15px; padding: 24px clamp(20px, 5vw, 38px); color: #fff; background: linear-gradient(135deg, var(--green-900), var(--green-600)); }
.status-banner.is-failed { background: linear-gradient(135deg, #841d17, #c43b2f); }
.status-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.17); border: 1px solid rgba(255,255,255,.28); font-size: 1.65rem; font-weight: 900; }
.status-label { margin: 0 0 3px; opacity: .75; font-size: .8rem; }
.status-banner h2 { margin: 0; font-size: 1.75rem; }
.average-bubble { min-width: 105px; padding: 10px 14px; border-radius: 14px; text-align: center; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.23); }
.average-bubble span { display: block; font-size: .72rem; opacity: .8; }
.average-bubble strong { font-size: 1.75rem; direction: ltr; display: block; }
.result-body { padding: clamp(22px, 5vw, 40px); }
.result-title { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.eyebrow--dark { color: var(--green-800); opacity: 1; }
.result-title h3 { margin: 5px 0 8px; font-size: clamp(1.45rem, 5vw, 2rem); }
.mention { margin: 0; color: var(--muted); }
.result-stamp { flex: 0 0 86px; height: 86px; display: grid; place-items: center; text-align: center; border: 3px double rgba(11,122,89,.28); border-radius: 50%; color: rgba(11,122,89,.55); font-size: .76rem; font-weight: 900; transform: rotate(-7deg); }
.identity-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin: 24px 0; }
.identity-grid > div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfc; }
.identity-grid dt { color: var(--muted); font-size: .77rem; margin-bottom: 6px; }
.identity-grid dd { margin: 0; font-weight: 800; }
.grades-section { margin-top: 24px; }
.grades-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.grades-heading h4 { margin: 0; font-size: 1.05rem; }
.grades-heading span { color: var(--muted); font-size: .75rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 13px 16px; text-align: right; border-bottom: 1px solid var(--line); }
th { background: #f1f7f4; color: var(--green-950); font-size: .82rem; }
tbody tr:last-child td { border-bottom: 0; }
td:last-child, th:last-child { text-align: center; direction: ltr; font-weight: 800; }
.result-disclaimer { margin-top: 22px; padding: 13px 15px; border-radius: 12px; background: var(--warning-soft); color: #755000; border: 1px solid #f3df99; font-size: .82rem; line-height: 1.7; }
.result-actions { display: flex; gap: 12px; margin-top: 22px; }
.secondary-button { flex: 1; color: var(--green-800); background: #e6f4ee; border: 1px solid #c7e3d5; }
.primary-button--compact { flex: 1.25; width: auto; }

footer { padding: 24px 0 32px; color: #6d7d75; font-size: .78rem; }
.footer-content { text-align: center; }
.footer-content p { margin: 5px 0; }

@media (max-width: 640px) {
  .shell { width: min(100% - 22px, 920px); }
  .hero { min-height: 430px; }
  .hero__content { padding-top: 20px; }
  .identity { align-items: flex-start; }
  .flag { width: 62px; height: 41px; }
  .flag__moon { font-size: 29px; left: 19px; top: 5px; }
  .flag__star { left: 29px; top: 15px; font-size: 10px; }
  .hero__title-wrap { margin-top: 33px; }
  .notice { font-size: .82rem; }
  .main-content { margin-top: -38px; }
  .lookup-card { padding: 20px 17px; }
  .card__heading { align-items: flex-start; }
  .input-wrap input { height: 55px; padding-left: 80px; }
  .verification-box { padding: 16px; }
  .input-wrap--short { max-width: none; }
  .status-banner { grid-template-columns: auto 1fr; }
  .average-bubble { grid-column: 1 / -1; width: 100%; }
  .result-title { flex-direction: column; }
  .result-stamp { align-self: flex-end; margin-top: -72px; }
  .identity-grid { grid-template-columns: 1fr; }
  .result-actions { flex-direction: column-reverse; }
}

@media print {
  body { background: #fff; }
  .hero, .lookup-card, footer, .result-actions { display: none !important; }
  .main-content { margin: 0; padding: 0; }
  .shell { width: 100%; }
  .result-card { box-shadow: none; border: 0; }
  .result-disclaimer { border: 1px solid #bbb; }
}
