:root{
  /* Denim blue theme — matches shared/style.css used by the consoles. */
  --sidebar-bg:#103760; --sidebar-bg-deep:#0b2440; --sidebar-text:#e2e8f0; --sidebar-muted:#c3c9d9;
  --accent:#1d5fa8; --accent-deep:#103760; --accent-light:#dbeafe;
  --content-bg:#f5f9ff; --card-bg:#ffffff;
  --ink:#1e2233; --slate:#6b7280; --line:#e4e6f2; --error:#ef4444;
}
/* ===== DARK MODE ===== */
:root[data-theme="dark"] {
  --content-bg:#0b0f1a; --card-bg:#141a2b;
  --ink:#e8eaf4; --slate:#9aa4bd; --line:#26304a;
  --sidebar-bg:#08172a; --sidebar-bg-deep:#050d18; --sidebar-muted:#9aa4bd;
  --accent:#4a8fd4; --accent-deep:#1d5fa8; --accent-light:#17304d;
}
body, .form-container, .field input, .field select, .privacy-notice,
.review-group, .certificate-border, .btn-ghost {
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
:root[data-theme="dark"] .field input::placeholder { color:#5c6480; }
:root[data-theme="dark"] .field input, :root[data-theme="dark"] .field select { color-scheme: dark; color: var(--ink); }
:root[data-theme="dark"] .field { background: var(--card-bg); border-color: var(--line); }
:root[data-theme="dark"] .field label { background: rgba(255,255,255,0.02); color: var(--ink); border-right-color: var(--line); }
:root[data-theme="dark"] .field input:focus, :root[data-theme="dark"] .field select:focus { box-shadow: inset 0 0 0 1px rgba(74,143,212,0.55); }
:root[data-theme="dark"] .section-block { background: rgba(20,26,43,0.80); border-color: var(--line); }
:root[data-theme="dark"] .privacy-notice { border-color: var(--line); }
:root[data-theme="dark"] .privacy-notice h3, :root[data-theme="dark"] .privacy-notice p,
:root[data-theme="dark"] .field.consent-field .checkbox-label { color: var(--ink); }
:root[data-theme="dark"] .field.consent-field { background: var(--card-bg); border-color: var(--line); }
:root[data-theme="dark"] .field.consent-field .checkbox-label { background: rgba(255,255,255,0.01); }
:root[data-theme="dark"] .form-error-banner { background:#3a1616; border-color:#7f1d1d; color:#fecaca; }

/* Sidebar dark-mode toggle button */
.theme-toggle {
  display:flex; align-items:center; gap:8px; margin:0 0 24px; padding:8px 14px;
  background: rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.12); border-radius:999px;
  color: var(--sidebar-text); font: inherit; font-size:12.5px; font-weight:600; cursor:pointer;
  transition: background-color .15s ease;
}
.theme-toggle:hover { background: rgba(255,255,255,0.12); }
.theme-toggle-icon { font-size:14px; line-height:1; }

/* The hidden attribute must always win over any class's display property below —
   without this, any class that sets display:flex/grid/etc. silently overrides
   [hidden]'s default display:none (equal CSS specificity, author stylesheet
   loads after the UA default), making "hidden" elements render anyway. */
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }
body {
  margin:0; font-family:'Public Sans', sans-serif; background: var(--content-bg);
  color: var(--ink); line-height:1.5;
}

.page { max-width: 100%; margin: 0; padding: 0; }

@media (min-width: 961px) {
  .page { display:flex; align-items:stretch; min-height:100vh; }
}

/* ===== HEADER / SIDEBAR ===== */
.masthead {
  text-align:left; margin-bottom:0; background: var(--sidebar-bg); color: var(--sidebar-text);
  padding: 44px 32px 32px;
}
@media (min-width: 961px) {
  .masthead {
    flex: 0 0 300px; max-width:300px; position:sticky; top:0; height:100vh;
    display:flex; flex-direction:column; overflow-y:auto;
  }
  .masthead::after {
    content: "© 2025 Alumni Office. All Rights Reserved.";
    margin-top:auto; padding-top:32px; font-size:11.5px; color: var(--sidebar-muted); line-height:1.5;
  }
}
.masthead .seal { color: var(--accent); margin: 0 0 14px; width:40px; }
.masthead .seal svg { width:40px; height:40px; }
.masthead .eyebrow {
  font-family:'IBM Plex Mono', monospace; font-size:10.5px; letter-spacing:.14em;
  color: var(--sidebar-muted); text-transform:uppercase; margin: 0 0 6px;
}
.masthead h1 {
  font-family:'Public Sans', sans-serif; font-weight:700; font-size:21px;
  color:#fff; margin: 0 0 10px; letter-spacing:-.01em;
}
.masthead .subtitle { color: var(--sidebar-muted); font-size:13px; margin: 0 0 6px; font-weight:600; }
.masthead .instruction {
  max-width: none; margin: 8px 0 0; color: var(--sidebar-muted); font-size:12.5px; line-height:1.7;
  padding-top:20px; border-top:1px solid rgba(255,255,255,0.08);
}

/* ===== PROGRESS RIBBON (kept for compatibility, unused by current markup) ===== */
.ribbon { margin-bottom: 40px; overflow-x:auto; }
#ribbon-list { display:flex; list-style:none; padding:0; margin:0; gap:4px; min-width: 560px; }
.ribbon-step { flex:1; display:flex; flex-direction:column; align-items:center; gap:6px; position:relative; text-align:center; }
.ribbon-step:not(:last-child)::after {
  content:''; position:absolute; top:15px; left:calc(50% + 20px); right:calc(-50% + 20px);
  height:2px; background: var(--line);
}
.ribbon-step[data-status="complete"]:not(:last-child)::after { background: var(--accent); }
.ribbon-node {
  width:30px; height:30px; border-radius:999px; display:flex; align-items:center; justify-content:center;
  background:#fff; border:2px solid var(--line); font-family:'IBM Plex Mono', monospace; font-size:12px;
  font-weight:600; color: var(--slate); z-index:1; transition: all .2s ease;
}
.ribbon-step[data-status="current"] .ribbon-node { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.ribbon-step[data-status="complete"] .ribbon-node { border-color: var(--accent); background: var(--accent); color:#fff; }
.ribbon-label { font-size:11px; color: var(--slate); font-weight:500; }
.ribbon-step[data-status="current"] .ribbon-label { color: var(--ink); font-weight:700; }

/* ===== FORM CONTENT AREA ===== */
.form-container {
  background: var(--content-bg); border:none; border-radius:0;
  padding: 44px 40px 64px; box-shadow:none; flex:1; min-width:0;
}
.form-error-banner {
  background:#fef2f2; border:1px solid #fecaca; color:#991b1b; border-radius:10px;
  padding:12px 16px; font-size:13px; margin-bottom:24px;
}
.section-head { display:flex; gap:16px; align-items:flex-start; margin-bottom:28px; }
.section-number {
  display:none !important;
}
.section-head h2 { font-family:'Public Sans', sans-serif; font-weight:800; font-size:26px; margin:0 0 4px; color: var(--ink); letter-spacing:-.01em; }
.section-hint { font-size:14px; color: var(--slate); margin:0; }

.section-block {
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 18px 12px;
  margin-bottom: 28px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.03);
}

.field-grid {
  display: block;
  width: calc(100% + 12px);
  margin-left: -12px;
}
.field {
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  position: relative;
  margin-bottom: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  overflow: hidden;
  background: var(--card-bg);
  width: 100%;
}
.field:first-child { border-top: 1px solid var(--line); }
.field-wide { grid-column: inherit; }
.field label {
  font-size:14.5px; font-weight:700; color: var(--ink); display:flex; align-items:center; gap:8px;
  padding: 14px 14px 14px 18px;
  background: #f8fafc;
  border-right: 1px solid var(--line);
  min-height: 100%;
  justify-content: flex-start;
  text-align: left;
}
.field .req { color: var(--error); }

 .field input, .field select {
  font: inherit; font-size:15px; padding: 14px 18px 14px 16px; border:none; border-bottom:none;
  border-radius:0; background: var(--card-bg); color: var(--ink); width:100%;
  min-height: 54px;
}
.field select {
  background-color: var(--card-bg);
  color: var(--ink);
  color-scheme: light;
  appearance: auto;
}
.field select option {
  background-color: #ffffff;
  color: #1e2233;
}
:root[data-theme="dark"] .field select {
  background-color: var(--card-bg);
  color: var(--ink);
  color-scheme: dark;
}
:root[data-theme="dark"] .field select option {
  background-color: #141a2b;
  color: #e8eaf4;
}
.field select:disabled {
  opacity: 0.72;
  color: var(--slate);
}
.field input::placeholder { color:#b7bccb; }
.field input:focus, .field select:focus {
  outline:none; box-shadow: inset 0 0 0 1px rgba(29, 95, 168, 0.15);
}
.field input.is-invalid, .field select.is-invalid,
.field input.field-invalid, .field select.field-invalid { box-shadow: inset 0 0 0 1px rgba(239,68,68,0.30); }
.other-input { margin-top:0; border: none !important; }

.field .error-msg {
  grid-column: 2;
  padding: 0 18px 12px 16px;
  margin: 0;
  min-height: 0;
}

/* ===== NICER DATE OF BIRTH FIELD (still a native type="date" input — function unchanged) ===== */
.field input[type="date"] {
  cursor: pointer;
}
.field input[type="date"]::-webkit-datetime-edit {
  color: var(--ink); padding: 0;
}
.field input[type="date"]::-webkit-datetime-edit-fields-wrapper { padding: 0; }
.field input[type="date"]::-webkit-datetime-edit-text {
  color: var(--slate); padding: 0 4px;
}
.field input[type="date"]::-webkit-datetime-edit-month-field,
.field input[type="date"]::-webkit-datetime-edit-day-field,
.field input[type="date"]::-webkit-datetime-edit-year-field {
  color: var(--ink); font-weight:600;
}
.field input[type="date"]::-webkit-datetime-edit-month-field:focus,
.field input[type="date"]::-webkit-datetime-edit-day-field:focus,
.field input[type="date"]::-webkit-datetime-edit-year-field:focus {
  background-color: var(--accent-light); color: var(--accent-deep); border-radius:3px; outline:none;
}
.field input[type="date"]::-webkit-inner-spin-button { display: none; }
.field input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer; opacity: .5; width:18px; height:18px; padding:5px; border-radius:7px;
  transition: opacity .15s ease, background-color .15s ease;
}
.field input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1; background-color: var(--accent-light);
}
:root[data-theme="dark"] .field input[type="date"]::-webkit-datetime-edit-month-field:focus,
:root[data-theme="dark"] .field input[type="date"]::-webkit-datetime-edit-day-field:focus,
:root[data-theme="dark"] .field input[type="date"]::-webkit-datetime-edit-year-field:focus {
  background-color: rgba(14,165,233,0.18); color:#7dd3fc;
}
:root[data-theme="dark"] .field input[type="date"]::-webkit-calendar-picker-indicator:hover {
  background-color: rgba(14,165,233,0.18);
}
.error-msg { font-size:12px; color: var(--error); margin:0; min-height:14px; }
.checkbox-label { display:flex; gap:10px; align-items:flex-start; font-size:13.5px; color: var(--ink); font-weight:400; }
.checkbox-label input { width:auto; margin-top:2px; accent-color: var(--accent); }
.consent-field { margin-top:8px; }

.privacy-notice {
  background: transparent; border:1px solid var(--line); border-left:0; border-right:0; border-radius:0;
  padding:24px 0; margin-bottom:18px; box-shadow:none;
}
.privacy-notice h3 { font-size:14px; margin:0 0 8px; color: var(--ink); font-weight:700; }
.privacy-notice p { font-size:15px; color: var(--slate); margin:0; line-height:1.8; }

.section-block[data-section="5"] {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 12px 0 0;
}

.section-block[data-section="5"] .section-head {
  margin-bottom: 18px;
}

.field.consent-field {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card-bg);
  margin-top: 8px;
  overflow: hidden;
}

.field.consent-field .checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 400;
  color: var(--ink);
  background: transparent;
}

.field.consent-field .checkbox-label input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}

.field.consent-field .error-msg {
  padding: 0 22px 16px;
}

/* ===== REVIEW (unused by current markup, kept in matching palette) ===== */
.review-body { display:flex; flex-direction:column; gap:20px; }
.review-group { border:1px solid var(--line); border-radius:10px; padding:16px 18px; background: var(--card-bg); }
.review-group h4 {
  font-family:'IBM Plex Mono', monospace; font-size:11px; letter-spacing:.08em; text-transform:uppercase;
  color: var(--accent); margin:0 0 12px;
}
.review-row { display:flex; justify-content:space-between; gap:16px; padding:6px 0; font-size:13.5px; border-top:1px solid #f1f5f9; }
.review-row:first-child { border-top:none; }
.review-row dt { color: var(--slate); }
.review-row dd { margin:0; font-weight:600; color: var(--ink); text-align:right; }
.review-footer { display:flex; justify-content:flex-end; gap:12px; margin-top:28px; }

/* ===== NAV BUTTONS ===== */
.form-nav { display:flex; justify-content:flex-end; margin-top:36px; padding-top:0; border-top:none; }
.btn {
  font: inherit; font-size:14.5px; font-weight:700; padding:13px 30px; border-radius:10px;
  border:1px solid transparent; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center;
  transition: all .15s ease;
}
.btn-primary { background: var(--accent); color:#fff; box-shadow:0 4px 14px rgba(91,82,246,0.35); }
.btn-primary:hover { background: var(--accent-deep); }
.btn-primary:disabled { opacity:.6; cursor:not-allowed; box-shadow:none; }
.btn-ghost { background: var(--card-bg); color: var(--slate); border-color: var(--line); }
.btn-ghost:hover { filter: brightness(0.97); }

/* ===== SUCCESS SCREEN ===== */
.success-screen {
  position:fixed; inset:0; background: rgba(17,24,39,0.6); align-items:center;
  justify-content:center; padding:24px; z-index:100; display:none;
}
.success-screen:not([hidden]) { display:flex; }
.certificate { max-width:480px; width:100%; }
.certificate-border {
  background: var(--card-bg); border:none; border-radius:18px; padding:40px 32px;
  text-align:center; box-shadow: 0 20px 60px rgba(0,0,0,0.25); border-top:4px solid var(--accent);
}
.certificate .seal { color: var(--accent); margin:0 auto 12px; width:64px; }
.certificate .eyebrow {
  font-family:'IBM Plex Mono', monospace; font-size:10px; letter-spacing:.16em; color: var(--accent);
  text-transform:uppercase; margin:0 0 10px;
}
.certificate h1 { font-family:'Public Sans', sans-serif; font-weight:800; font-size:22px; color: var(--ink); margin:0 0 12px; }
.success-text { font-size:13.5px; color: var(--slate); margin:0 0 24px; line-height:1.6; }
.success-details { text-align:left; margin:0 0 20px; border-top:1px solid var(--line); padding-top:16px; }
.success-details > div { display:flex; justify-content:space-between; padding:6px 0; font-size:13px; }
.success-details dt { color: var(--slate); }
.success-details dd { margin:0; font-weight:600; color: var(--ink); }
.success-details .mono { font-family:'IBM Plex Mono', monospace; }
.status-pill {
  background: var(--accent-light); color: var(--accent-deep); font-size:11px; font-weight:700; padding:3px 10px; border-radius:999px;
}
.success-note { font-size:12.5px; color: var(--slate); margin:0 0 24px; line-height:1.6; }

@media (max-width: 640px) {
  .form-container { padding: 28px 20px 56px; }
  .field-grid { width: 100%; margin-left: 0; }
  .field {
    grid-template-columns: 1fr;
    border-radius: 10px;
  }
  .field label {
    border-right: none;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
    justify-content: flex-start;
    text-align: left;
  }
  .field .error-msg {
    grid-column: 1;
    padding: 0 14px 10px;
  }
  .ribbon-label { display:none; }
  .masthead { padding: 32px 24px 24px; }
}

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