:root {
  --navy: #12355b;
  --navy-dark: #0b2744;
  --blue: #1769aa;
  --ink: #182433;
  --muted: #64748b;
  --line: #d9e1ea;
  --surface: #ffffff;
  --page: #f4f7fb;
  --danger: #b42318;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

/* Login */
.login-page { min-height: 100vh; background: radial-gradient(circle at 80% 10%, #e7f0fa 0, transparent 35%), var(--page); display: flex; flex-direction: column; }
.site-header { background: linear-gradient(120deg, var(--navy-dark), var(--navy)); color: #fff; box-shadow: 0 8px 24px rgba(15, 39, 67, .16); }
.brand-wrap { width: min(1120px, calc(100% - 32px)); margin: auto; padding: 22px 0; display: flex; align-items: center; gap: 18px; }
.brand-logo { width: 190px; height: auto; max-height: 72px; object-fit: contain; background: #fff; border-radius: 8px; }
.brand-kicker { text-transform: uppercase; letter-spacing: .09em; font-size: 11px; opacity: .8; }
.brand-wrap h1 { margin: 4px 0; font-size: clamp(20px, 3vw, 29px); line-height: 1.15; font-weight: 700; }
.brand-sub { font-size: 13px; opacity: .78; }
.login-main { flex: 1; display: grid; place-items: center; padding: 48px 16px; }
.login-card { width: min(500px, 100%); background: var(--surface); border: 1px solid #e2e8f0; border-radius: 18px; box-shadow: 0 22px 55px rgba(15, 39, 67, .12); overflow: hidden; }
.card-topline { height: 5px; background: linear-gradient(90deg, #0d3b66, #3c8dcc); }
.card-heading { padding: 30px 32px 18px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.card-heading h2 { margin: 7px 0 8px; font-size: 28px; color: var(--navy-dark); }
.card-heading p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 14px; }
.login-card form { padding: 0 32px 24px; }
.field-group { margin: 18px 0; }
.field-group label { display: block; font-weight: 650; font-size: 13px; margin-bottom: 8px; }
.field-group input { width: 100%; height: 48px; border: 1px solid #cbd5e1; border-radius: 10px; padding: 0 13px; font: inherit; color: var(--ink); background: #fff; outline: none; transition: .15s ease; }
.field-group input:focus { border-color: #3285c6; box-shadow: 0 0 0 4px rgba(50, 133, 198, .12); }
.mobile-input { display: flex; }
.country-code { display: grid; place-items: center; width: 64px; border: 1px solid #cbd5e1; border-right: 0; border-radius: 10px 0 0 10px; color: var(--muted); background: #f8fafc; font-size: 14px; }
.mobile-input input { border-radius: 0 10px 10px 0; }
.field-invalid input, .field-invalid .country-code { border-color: #e2a8a4; }
.field-error, .alert-error { color: var(--danger); font-size: 13px; margin-top: 7px; }
.alert { margin: 0 32px 16px; padding: 12px 14px; border-radius: 10px; background: #fff4f2; border: 1px solid #f0c3be; }
.primary-btn, .secondary-btn { width: 100%; height: 48px; border-radius: 10px; font: 700 14px inherit; cursor: pointer; }
.primary-btn { border: 0; background: var(--navy); color: white; box-shadow: 0 7px 18px rgba(18, 53, 91, .18); }
.primary-btn:hover { background: #0d4779; }
.primary-btn span { margin-left: 8px; }
.secondary-btn { margin-top: 10px; background: white; color: var(--navy); border: 1px solid #cbd5e1; }
.security-note { margin: 0 32px 30px; display: flex; gap: 10px; padding: 12px 13px; border-radius: 10px; background: #f6f9fc; color: #64748b; font-size: 12px; line-height: 1.45; }
.lock-icon { color: #1f7a4d; font-size: 10px; padding-top: 3px; }
.site-footer { text-align: center; color: #7b8797; font-size: 12px; padding: 20px; }

/* Admit card */
.admit-page { background: #eef2f6; padding: 24px 12px 50px; }
.screen-toolbar { width: min(820px, 100%); margin: 0 auto 14px; display: flex; justify-content: space-between; align-items: center; }
.back-link { color: var(--navy); text-decoration: none; font-weight: 650; font-size: 14px; }
.print-btn { border: 0; border-radius: 8px; padding: 10px 15px; background: var(--navy); color: white; font-weight: 700; cursor: pointer; }
.admit-sheet { width: 794px; max-width: 100%; margin: auto; background: #fff; padding: 28px 34px; box-shadow: 0 10px 30px rgba(15, 23, 42, .12); color: #111; font-family: "Times New Roman", Times, serif; }
.admit-header { display: flex; gap: 14px; align-items: center; text-align: center; border-bottom: 2px solid #111; padding-bottom: 10px; }
.admit-logo { width: 150px; height: 100px; object-fit: contain; }
.admit-institution { flex: 1; font-size: 11px; line-height: 1.35; }
.admit-institution h1 { margin: 2px 0; font-size: 17px; }
.regional { font-size: 12px; }
.regional-s { font-size: 10px; }
.admit-title { text-align: center; font-weight: 700; font-size: 14px; padding: 11px 5px; border-bottom: 1px solid #111; }
.candidate-grid { display: grid; grid-template-columns: 29% 51% 20%; border-left: 1px solid #111; border-top: 1px solid #111; }
.candidate-grid > * { min-height: 31px; padding: 5px 6px; border-right: 1px solid #111; border-bottom: 1px solid #111; font-size: 12px; }
.label { font-weight: 700; }
.value { font-size: 13px !important; }
.full-row { grid-column: 2 / 4; }
.candidate-media { grid-column: 3; grid-row: 1 / 7; min-height: 185px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px; }
.candidate-media + * { }
.candidate-photo { width: 110px; height: 135px; object-fit: cover; border: 1px solid #777; }
.candidate-sign { max-width: 100px; max-height: 35px; object-fit: contain; }
.media-placeholder { width: 110px; height: 135px; border: 1px dashed #888; display: grid; place-items: center; text-align: center; font-size: 11px; color: #777; }
.signature-placeholder { font-size: 10px; color: #777; }
.venue-grid { display: grid; grid-template-columns: 29% 51% 20%; border-left: 1px solid #111; }
.venue-grid > * { border-right: 1px solid #111; border-bottom: 1px solid #111; padding: 6px; font-size: 12px; }
.venue-value { line-height: 1.4; }
.location-link { color: #0645ad; }
.venue-qr { display: grid; place-items: center; }
.venue-qr img { width: 70px; height: 75px; object-fit: contain; }
.authority-row { display: grid; grid-template-columns: 70% 30%; min-height: 70px; border-left: 1px solid #111; border-right: 1px solid #111; border-bottom: 1px solid #111; }
.authority-sign { text-align: center; padding: 5px; font-size: 11px; font-weight: 700; }
.authority-sign img { display: block; width: 120px; height: 35px; object-fit: contain; margin: 0 auto 3px; }
.venue-sign-title { text-align: center; font-weight: 700; font-size: 11px; border: 1px solid #111; border-top: 0; padding: 5px; }
.venue-sign-grid { display: grid; grid-template-columns: 1fr 1fr; border-left: 1px solid #111; border-right: 1px solid #111; border-bottom: 1px solid #111; font-size: 11px; font-weight: 700; }
.venue-sign-grid > div { min-height: 75px; padding: 8px; border-right: 1px solid #111; }
.venue-sign-grid > div:last-child { border-right: 0; }
.venue-sign-grid small { font-weight: 400; }
.blank-sign { border-bottom: 1px solid #555; margin-top: 45px; }
.instructions { border: 1px solid #111; border-top: 0; padding: 9px 11px; font-size: 11px; line-height: 1.3; }
.instructions h2 { font-size: 13px; margin: 0 0 5px; text-decoration: underline; }
.instructions ol { margin: 4px 0 8px 18px; padding: 0; }
.instructions li { margin-bottom: 3px; }
.instructions p { margin: 6px 0 0; }

@media (max-width: 600px) {
  .brand-wrap { align-items: flex-start; padding: 16px 0; }
  .brand-logo { width: 110px; max-height: 55px; }
  .brand-kicker { font-size: 9px; }
  .brand-wrap h1 { font-size: 17px; }
  .brand-sub { font-size: 11px; }
  .card-heading, .login-card form { padding-left: 20px; padding-right: 20px; }
  .alert, .security-note { margin-left: 20px; margin-right: 20px; }
  .login-main { padding-top: 28px; }
  .admit-page { padding: 8px 4px 30px; }
  .screen-toolbar { padding: 0 4px; }
  .admit-sheet { padding: 16px 12px; box-shadow: none; }
  .admit-header { gap: 7px; }
  .admit-logo { width: 55px; }
  .admit-institution { font-size: 8px; }
  .admit-institution h1 { font-size: 11px; }
  .regional { font-size: 9px; }
  .regional-s { font-size: 7px; }
  .admit-title { font-size: 10px; }
  .candidate-grid > *, .venue-grid > * { font-size: 9px; padding: 4px; }
  .value { font-size: 10px !important; }
  .candidate-photo { width: 70px; height: 85px; }
  .media-placeholder { width: 70px; height: 85px; font-size: 8px; }
  .candidate-media { min-height: 125px; }
  .instructions { font-size: 8px; }
  .instructions h2 { font-size: 10px; }
}

@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body.admit-page { background: #fff; padding: 0; }
  .screen-toolbar { display: none; }
  .admit-sheet { width: 100%; max-width: none; padding: 0; box-shadow: none; break-after: page; page-break-after: always; }
  .admit-sheet:last-of-type { break-after: auto; page-break-after: auto; }
  a { color: #111; text-decoration: none; }
  .location-link { display: none; }
}
