/* ============================================================================
   EVSU Ormoc Campus - Smart ID & RFID Lifecycle Management System
   Public Design System & Stylesheet (Mobile-Responsive, Rich Aesthetics)
   ============================================================================ */

:root {
  /* Official EVSU Colors */
  --evsu-maroon: #7B2D3B;
  --evsu-maroon-deep: #54181B;
  --evsu-maroon-soft: #923439;
  --evsu-maroon-pale: #F8EEEF;
  --evsu-gold: #B8963E;
  --evsu-gold-soft: #EFD5A6;
  --evsu-gold-deep: #9E7530;
  --evsu-gold-pale: #FDF9F0;

  /* Neutrals & Surfaces */
  --paper: #F4EFE8;
  --paper-soft: #FAF7F2;
  --panel: #FFFFFF;
  --ink: #1F1C1C;
  --ink-muted: #5C5555;
  --ink-faint: #8E8787;
  --line: #E2D9CA;
  --line-soft: #EDE5D8;

  /* Status Tokens */
  --status-pending: #B8792A;
  --status-pending-bg: #FDF4E5;
  --status-approved: #2E5AAC;
  --status-approved-bg: #EAF0FB;
  --status-correction: #6B3FA0;
  --status-correction-bg: #F3EAFB;
  --status-printed: #5E3D8F;
  --status-printed-bg: #EFE9F8;
  --status-rfid: #247551;
  --status-rfid-bg: #E5F4ED;
  --status-ready: #C2651B;
  --status-ready-bg: #FEEFE4;
  --status-released: #1A6344;
  --status-released-bg: #E1F1E9;
  --status-rejected: #B23A48;
  --status-rejected-bg: #FCEBEB;

  /* Geometry & Elevation */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 999px;
  --shadow-sm: 0 2px 6px rgba(84, 24, 27, 0.05);
  --shadow-md: 0 8px 24px rgba(84, 24, 27, 0.08);
  --shadow-lg: 0 16px 40px rgba(84, 24, 27, 0.14);
  --shadow-card3d: 0 24px 50px rgba(84, 24, 27, 0.22);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5 {
  color: var(--evsu-maroon);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

p {
  color: var(--ink-muted);
}

a {
  color: var(--evsu-maroon);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--evsu-maroon-deep);
}

/* ================= HEADER & NAVIGATION ================= */
.header-wrapper {
  background: linear-gradient(135deg, var(--evsu-maroon-deep) 0%, var(--evsu-maroon) 70%, #8A3338 100%);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  border-bottom: 3px solid var(--evsu-gold);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px clamp(24px, 3vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #ffffff;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: contain;
  background: #ffffff;
  padding: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text .uni-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #ffffff;
}

.brand-text .sub-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--evsu-gold-soft);
  letter-spacing: 0.05em;
}

/* Desktop Navigation */
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.25vw, 16px);
  white-space: nowrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #F8EEEF;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.nav-link.active {
  background: var(--evsu-gold);
  color: #2D1A08;
  font-weight: 700;
}

/* Mobile Hamburger Menu */
.burger-btn {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(45, 15, 19, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(280px, 84vw);
  height: 100%;
  background: #ffffff;
  z-index: 210;
  box-shadow: -6px 0 20px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.3s;
  padding: 24px;
}

.mobile-drawer.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.mobile-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 0;
  color: var(--ink-muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.mobile-drawer-close:hover,
.mobile-drawer-close:focus-visible {
  color: var(--evsu-maroon);
  background: #F5EFE6;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper-soft);
}

.mobile-nav-link.active {
  background: var(--evsu-maroon-pale);
  color: var(--evsu-maroon);
}

/* ================= MAIN CONTAINER & LAYOUT ================= */
.main-wrapper {
  flex: 1;
  width: 100%;
  min-width: 0;
  max-width: min(1200px, 100%);
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.narrow-wrapper {
  max-width: min(820px, 100%);
}

/* ================= BUTTONS & PILLS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  text-align: center;
  line-height: 1.35;
}

.btn-primary {
  background: var(--evsu-maroon);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--evsu-maroon-deep);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 44, 48, 0.3);
}

.btn-primary:disabled {
  background: #C4BAC1;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-gold {
  background: var(--evsu-gold);
  color: #2D1A08;
}

.btn-gold:hover {
  background: #C6954B;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(218, 168, 92, 0.35);
}

.btn-secondary {
  background: #ffffff;
  color: var(--evsu-maroon);
  border-color: var(--line);
}

.btn-secondary:hover {
  border-color: var(--evsu-maroon);
  background: var(--paper-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
}

.btn-ghost:hover {
  color: var(--evsu-maroon);
  background: var(--evsu-maroon-pale);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12.5px;
}

.btn-block {
  width: 100%;
}

/* ================= HERO SECTION (index.html) ================= */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 40px;
  align-items: center;
  margin-bottom: 56px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--evsu-gold-deep);
  background: var(--evsu-gold-pale);
  border: 1px solid var(--evsu-gold-soft);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}

.hero-title {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--evsu-maroon);
  margin-bottom: 18px;
  overflow-wrap: anywhere;
}

.hero-title em {
  font-style: normal;
  color: var(--evsu-gold-deep);
}

.hero-desc {
  font-size: 16px;
  color: var(--ink-muted);
  line-height: 1.65;
  margin-bottom: 28px;
  max-width: 52ch;
  text-align: justify;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-card-previews {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px 24px;
}

.hero-card-previews > .tilt-hint {
  grid-column: 1 / -1;
  justify-content: center;
  margin: 0;
  text-align: center;
}

.hero-card-previews:not(:has([data-preview-ready])) > .tilt-hint {
  visibility: hidden;
}

@media (max-width: 768px), (pointer: coarse) {
  .hero-card-previews { grid-template-columns: minmax(0, 1fr); }
}

/* Process Steps Grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 48px;
}

.step-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.step-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.step-card .num-badge {
  font-size: 24px;
  font-weight: 800;
  color: var(--evsu-gold-deep);
  line-height: 1;
  margin-bottom: 12px;
}

.step-card h3 {
  font-size: 15px;
  margin-bottom: 6px;
  color: var(--evsu-maroon);
}

.step-card p {
  font-size: 12.5px;
  line-height: 1.5;
}

/* Feature Trust Badges */
.trust-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
}

.trust-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.trust-item .icon-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--evsu-maroon-pale);
  color: var(--evsu-maroon);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.trust-item h4 {
  font-size: 13.5px;
  margin-bottom: 3px;
  color: var(--evsu-maroon);
}

.trust-item p {
  font-size: 12px;
  line-height: 1.45;
}

/* ================= WIZARD & FORM CARDS (apply.html) ================= */
.wizard-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  box-shadow: var(--shadow-md);
  min-width: 0;
}

/* Step Bar / Stepper */
.wizard-stepper-card {
  margin-bottom: 24px;
  padding: 22px 36px;
}

#applicationSessionNotice,
#draftStorageWarning {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
}

#applicationSessionTimer {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}

.stepper-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stepper-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--line-soft);
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  transition: all 0.25s ease;
}

.stepper-item.active .stepper-dot {
  background: var(--evsu-maroon);
  color: #ffffff;
}

.stepper-item.done .stepper-dot {
  background: var(--status-rfid);
  color: #ffffff;
}

.stepper-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-faint);
  overflow-wrap: normal;
  word-break: normal;
}

.stepper-item.active .stepper-label,
.stepper-item.done .stepper-label {
  color: var(--evsu-maroon);
}

.stepper-divider {
  flex: 1;
  height: 2px;
  background: var(--line-soft);
  margin: 0 14px;
}

.stepper-divider.done {
  background: var(--status-rfid);
}

/* Form Fields */
.form-section-title {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--evsu-gold-deep);
  background: var(--evsu-gold-pale);
  padding: 4px 10px;
  border-radius: 4px;
  margin: 18px 0 12px;
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
}

.form-group {
  margin-bottom: 20px;
  min-width: 0;
  max-width: 100%;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--evsu-maroon);
  margin-bottom: 7px;
  overflow-wrap: normal;
  word-break: normal;
}

.form-group label span.req {
  color: var(--status-rejected);
}

.form-control {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--ink);
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="date"].form-control {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 45px;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
}

input[type="date"].form-control::-webkit-date-and-time-value {
  text-align: left;
}

.form-control:focus {
  outline: none;
  border-color: var(--evsu-gold);
  box-shadow: 0 0 0 3px rgba(218, 168, 92, 0.2);
}

.form-hint {
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-top: 5px;
  display: block;
}

#empPositionSearchStatus:empty {
  margin-top: 0;
}

.employee-position-results {
  max-height: 14rem;
  overflow-y: auto;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.employee-position-results li + li {
  border-top: 1px solid var(--line);
}

.employee-position-results button {
  display: block;
  width: 100%;
  padding: 9px 14px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.employee-position-results button:hover,
.employee-position-results button:focus-visible {
  background: var(--evsu-gold-pale);
}

.employee-position-results button:focus-visible {
  outline: 2px solid var(--evsu-maroon);
  outline-offset: -2px;
}

.employee-position-results small {
  display: block;
  color: var(--evsu-maroon);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid-2 > *,
.form-grid-3 > *,
.address-grid > *,
.media-upload-grid > * {
  min-width: 0;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* Radio Toggles */
.radio-toggle-group {
  display: flex;
  gap: 10px;
}

.radio-toggle-label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  min-width: 0;
  min-height: 44px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
  background: var(--paper-soft);
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.applicant-category-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  min-width: 0;
}

.applicant-category-row > * {
  max-width: 100%;
}

.radio-toggle-label input {
  display: none;
}

.radio-toggle-label:hover {
  border-color: var(--evsu-maroon);
}

.radio-toggle-label:has(input:checked) {
  border-color: var(--evsu-maroon);
  background: var(--evsu-maroon-pale);
  color: var(--evsu-maroon);
}

/* Section 123 Alert Box */
.section123-alert {
  background: #FFF8EB;
  border: 1.5px solid #F0C379;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: none;
}

.section123-alert.show {
  display: block;
}

.section123-alert h4 {
  font-size: 14px;
  color: #925807;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.section123-alert p {
  font-size: 12.5px;
  color: #72460B;
  line-height: 1.5;
}

.section123-alert ul {
  margin: 8px 0 0 18px;
  font-size: 12px;
  color: #72460B;
}

.replacement-upload {
  margin: 0 0 20px;
  padding: 18px;
  border: 1.5px solid #E2C693;
  border-radius: var(--radius-md);
  background: #FFF8EB;
  color: #72460B;
  font-size: 13px;
}

.replacement-upload h4 {
  color: #925807;
  margin-bottom: 4px;
  font-size: 15px;
}

.replacement-upload-header p {
  margin: 0;
  font-size: 12.5px;
  color: #72460B;
}

.replacement-file-field {
  position: relative;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1.5px dashed #DAA85C;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.88);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.replacement-file-field.filled {
  border-style: solid;
  border-color: var(--status-rfid);
  background: var(--status-rfid-bg);
}

.replacement-field-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.replacement-field-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 700;
  color: var(--ink);
  font-size: 13.5px;
}

.replacement-tag {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 999px;
}

.replacement-tag.required {
  background: var(--evsu-maroon-pale);
  color: var(--evsu-maroon);
}

.replacement-tag.optional {
  background: var(--paper);
  color: var(--ink-muted);
}

.replacement-status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-muted);
}

.replacement-file-field.filled .replacement-status-pill {
  background: #ffffff;
  color: var(--status-rfid);
  border: 1px solid rgba(36, 117, 81, 0.28);
}

.replacement-field-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--ink-muted);
}

.replacement-field-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.replacement-file-field input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.replacement-file-field input:focus-visible + label {
  outline: 3px solid var(--evsu-gold);
  outline-offset: 2px;
}

.replacement-file-field label {
  white-space: normal;
  text-align: center;
}

.replacement-file-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid rgba(36, 117, 81, 0.25);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}

.replacement-file-chip[hidden] {
  display: none;
}

.replacement-chip-icon {
  color: var(--status-rfid);
  flex-shrink: 0;
}

.replacement-file-chip p {
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.replacement-remove-btn {
  padding: 4px 10px;
  font-size: 11.5px;
  color: var(--status-rejected);
  flex-shrink: 0;
}

.replacement-file-field ul {
  margin: 10px 0 0;
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.replacement-file-field ul:empty {
  display: none;
}

.replacement-file-field li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid rgba(36, 117, 81, 0.25);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.replacement-supporting-item-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.replacement-supporting-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--status-rfid-bg);
  color: var(--status-rfid);
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

/* ================= STEP 2: PHOTO & SIGNATURE ================= */
.media-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.media-box {
  border: 2px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 24px 18px;
  text-align: center;
  background: var(--paper-soft);
  position: relative;
  transition: all 0.2s ease;
}

.media-box.filled {
  border-style: solid;
  border-color: var(--status-rfid);
  background: var(--status-rfid-bg);
}

.media-preview-container {
  width: 140px;
  height: 140px;
  margin: 0 auto 14px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.media-preview-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.webcam-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.signature-canvas {
  width: 100%;
  height: 160px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  touch-action: none;
}

.signature-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

/* Privacy Consent Box */
.consent-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--evsu-maroon-pale);
  border: 1px solid #E6C8CB;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 20px 0;
}

.consent-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--evsu-maroon);
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}

.consent-card p {
  font-size: 12.5px;
  color: var(--evsu-maroon-deep);
  line-height: 1.55;
}

/* ================= STEP 3: 3D CARD PREVIEW ================= */
.card3d-stage {
  perspective: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0 30px;
  user-select: none;
}

.card3d-wrapper {
  height: auto;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out;
  cursor: grab;
}

.card3d-wrapper:active {
  cursor: grabbing;
}

.card3d-inner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card3d-inner.flipped {
  transform: rotateY(180deg);
}

.card3d-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-card3d);
  background: #ffffff;
}

/* Draw the border over the artwork without reducing its available canvas size. */
.card3d-face::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid #D5CCBD;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
}

.card3d-back {
  transform: rotateY(180deg);
}

.hero-card-stage {
  position: relative;
  padding-bottom: 6px;
}

.hero-card-title {
  color: var(--evsu-maroon);
  font-size: 15px;
  margin: 0 0 12px;
}

.hero-card-status {
  position: absolute;
  inset-inline: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
}

.hero-card-stage:not([data-preview-ready]) > :is(.card3d-wrapper, .card3d-controls) {
  visibility: hidden;
}

.hero-card-stage .card3d-wrapper,
.hero-card-stage .card3d-inner {
  transition: none;
}

.hero-card-stage .card3d-inner {
  transform-style: flat;
}

/* Paint one complete face before applying the shared 3D rotation. */
.hero-card-stage .card3d-face {
  -webkit-backface-visibility: visible;
  backface-visibility: visible;
}

.hero-card-stage .card3d-back {
  transform: scaleX(-1);
  visibility: hidden;
}

.hero-card-stage [data-visible-side="back"] .card3d-front {
  visibility: hidden;
}

.hero-card-stage[data-preview-ready] [data-visible-side="back"] .card3d-back {
  visibility: visible;
}

/* Semester Validation Table in CR-80 Cards */
.semester-table-placeholder {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  font-size: 7px;
  font-weight: 700;
  color: #1F1C1C;
  border: 1px solid #7C2C30 !important;
  background: #FFFFFF;
}

.semester-table-placeholder th,
.semester-table-placeholder td {
  border: 1px solid #7C2C30 !important;
  padding: 2px 3px;
  text-align: center;
  box-sizing: border-box;
}

.semester-table-placeholder th {
  background: #7C2C30 !important;
  color: #FFFFFF !important;
  font-size: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 800;
}

.card3d-controls {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.tilt-hint {
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Review Table */
.review-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
}

.review-summary-table tr {
  border-bottom: 1px solid var(--line-soft);
}

.review-summary-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-faint);
  text-transform: uppercase;
  padding: 10px 0;
  width: 35%;
}

.review-summary-table td {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  padding: 10px 0;
}

/* Wizard Navigation Footer */
.wizard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}

/* ================= STATUS TRACKER (status.html) ================= */
.status-search-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 30px;
}

#statusOtpInput {
  margin: 0 auto 10px;
}

.status-code-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.timeline-card {
  --timeline-section-gap: 32px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  box-shadow: var(--shadow-md);
  display: none;
}

.timeline-card.show {
  display: block;
}

.timeline-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 24px 0 var(--timeline-section-gap);
}

.timeline-actions .btn {
  min-height: 44px;
  justify-content: center;
  text-align: center;
  white-space: normal;
  flex-shrink: 0;
}

.digital-id-intro {
  text-align: center;
  margin-bottom: 24px;
}

.digital-id-intro h1,
.digital-id-card h2 {
  color: var(--evsu-maroon);
}

.digital-id-intro p {
  max-width: 46ch;
  margin: 6px auto 0;
}

.digital-id-card {
  text-align: center;
  margin: 24px 0 0;
  padding: 24px clamp(16px, 4vw, 36px) 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.digital-id-reference {
  color: var(--ink-muted);
  font-family: monospace;
  margin: 4px 0 8px;
  overflow-wrap: anywhere;
}

.digital-id-retry {
  text-align: center;
}

.digital-id-card .card3d-controls .btn {
  min-height: 44px;
}

.digital-id-card [hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .digital-id-card .card3d-inner {
    transition: none;
  }
}

@media print {
  #digitalIdResult,
  body[data-digital-id-page] #statusSearchForm,
  body[data-digital-id-page] #statusOtpForm {
    display: none;
  }
}

@media (max-width: 480px) {
  .timeline-actions > .btn {
    width: 100%;
    max-width: 320px;
  }
}

/* 3-Stage Timeline Component */
.timeline-stages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  position: relative;
}

.stage-item {
  text-align: center;
  position: relative;
}

.stage-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--line);
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: var(--ink-faint);
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

.stage-item .stage-line {
  position: absolute;
  top: 18px;
  left: -50%;
  width: 100%;
  height: 3px;
  background: var(--line);
  z-index: 1;
}

.stage-item:first-child .stage-line {
  display: none;
}

.stage-item.done .stage-dot,
.timeline-swatch.completed {
  background: var(--status-rfid);
  border-color: var(--status-rfid);
  color: #ffffff;
}

.stage-item.done .stage-line {
  background: var(--status-rfid);
}

.stage-item.current .stage-dot,
.timeline-swatch.current {
  background: var(--evsu-gold);
  border-color: var(--evsu-gold);
}

.stage-item.current .stage-dot {
  color: #2D1A08;
  box-shadow: 0 0 0 5px rgba(218, 168, 92, 0.25);
}

.stage-item.current .stage-line {
  background: var(--status-rfid);
}

.stage-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-faint);
  line-height: 1.3;
  overflow-wrap: normal;
  word-break: normal;
}

.stage-item.done .stage-name,
.stage-item.current .stage-name {
  color: var(--evsu-maroon);
}

.stage-description {
  margin: 4px 8px 0;
  font-size: 12px;
  color: var(--ink-muted);
}

.stage-date {
  font-size: 10.5px;
  color: var(--ink-faint);
  margin-top: 4px;
}

.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  list-style: none;
  margin: var(--timeline-section-gap) 0 0;
  padding: 0;
  font-size: 12px;
  color: var(--ink-muted);
}

.timeline-legend li {
  display: flex;
  align-items: center;
  gap: 7px;
}

.timeline-swatch {
  flex: 0 0 12px;
  height: 12px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
}

/* Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
}

#displayApplicantType,
#gateApplicantType {
  flex: 0 0 auto;
  white-space: nowrap;
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 6px;
}

.badge-pending { background: var(--status-pending-bg); color: var(--status-pending); }
.badge-approved { background: var(--status-approved-bg); color: var(--status-approved); }
.badge-correction { background: var(--status-correction-bg); color: var(--status-correction); }
.badge-printed { background: var(--status-printed-bg); color: var(--status-printed); }
.badge-rfid { background: var(--status-rfid-bg); color: var(--status-rfid); }
.badge-ready { background: var(--status-ready-bg); color: var(--status-ready); }
.badge-released { background: var(--status-released-bg); color: var(--status-released); }
.badge-rejected { background: var(--status-rejected-bg); color: var(--status-rejected); }

/* ================= FOOTER ================= */
.public-footer {
  background: #251214;
  color: #D4B2B6;
  padding: 48px 24px 28px;
  margin-top: auto;
  border-top: 3px solid var(--evsu-gold);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.footer-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.footer-col h4 {
  color: var(--evsu-gold-soft);
  font-size: 13.5px;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-col p, .footer-col li {
  font-size: 12.5px;
  color: #CBB0B3;
  line-height: 1.6;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-bottom {
  max-width: 1200px;
  margin: 20px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: #9C7D81;
}

/* ================= RESPONSIVENESS ================= */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .trust-bar {
    grid-template-columns: 1fr;
  }
  .timeline-stages {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .stage-item .stage-line {
    display: none;
  }
  .stage-item {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
  }
  .stage-description {
    margin-inline: 0;
  }
  .stage-dot {
    flex-shrink: 0;
    margin: 0;
  }
}

@media (min-width: 961px) and (max-width: 1120px) {
  .nav-container,
  .nav-links {
    gap: 8px;
  }

  .nav-link {
    padding-inline: 10px;
  }
}

@media (max-width: 960px) {
  .nav-links {
    display: none;
  }
  .burger-btn {
    display: block;
  }
}

@media (max-width: 768px) {
  .form-grid-2, .form-grid-3, .media-upload-grid {
    grid-template-columns: 1fr;
  }
  .wizard-card {
    padding: 24px 18px;
  }
  .wizard-stepper-card {
    padding: 18px;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .hero-title {
    font-size: 32px;
  }
}

/* ================= REQUEST POLICY NOTICE ================= */
.request-policy-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding: 10px 16px;
  background: rgba(124, 44, 48, 0.06);
  border: 1px solid rgba(124, 44, 48, 0.18);
  border-radius: var(--radius-sm);
}

.request-policy-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--evsu-maroon);
  font-size: 12.5px;
  font-weight: 600;
}

.request-policy-summary svg {
  flex: none;
}

.request-policy-button {
  padding: 4px 10px;
  font-size: 11px;
}

/* ================= VERIFICATION GATE & LOCKED FIELDS ================= */
.verification-gate-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-sm);
  max-width: 620px;
  margin: 0 auto 30px;
  text-align: left;
}

.gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--evsu-maroon);
  background: rgba(124, 44, 48, 0.08);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
}

.gate-alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 18px;
  display: none;
  align-items: flex-start;
  gap: 10px;
}

.gate-alert.error {
  background: #FDF2F2;
  border: 1.5px solid #F5C6CB;
  color: #721C24;
}

.gate-alert.success {
  background: #F0F9F4;
  border: 1.5px solid #C3E6CB;
  color: #155724;
}

.gate-alert[style*="display:none"],
.gate-alert[style*="display: none"] {
  display: none !important;
}

.locked-field-wrapper {
  position: relative;
}

.locked-field-wrapper input[readonly],
.locked-field-wrapper select:disabled {
  background: #F9F7F4 !important;
  color: #4A4444 !important;
  border-color: #E2DACF !important;
  cursor: not-allowed;
  font-weight: 700;
}

.badge-locked {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8C6212;
  background: #FFF8EB;
  border: 1px solid #EED7A1;
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 6px;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}

.applicant-category-row .badge-locked {
  margin-left: 0;
}

/* ================= HIERARCHICAL ADDRESS DROPDOWNS ================= */
.address-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

@media (max-width: 600px) {
  .main-wrapper {
    padding: 24px 16px 40px;
  }

  .hero-desc {
    margin-bottom: 40px;
  }

  .hero-actions {
    gap: 16px;
  }

  .request-policy-notice {
    flex-wrap: nowrap;
    margin-bottom: 12px;
    padding: 5px 10px;
  }

  .request-policy-summary {
    font-size: 12px;
    line-height: 1.35;
  }

  .request-policy-summary svg {
    display: none;
  }

  .request-policy-button {
    flex: none;
  }

  .verification-gate-card {
    padding: 24px 16px;
  }

  .verification-gate-card #gateStepId .form-group > div,
  .verification-gate-card #gateStepEmail > div:last-child {
    flex-direction: column;
    align-items: stretch;
  }

  .verification-gate-card #gateStepId .form-group > div .btn,
  .verification-gate-card #gateStepEmail > div:last-child .btn {
    width: 100%;
  }

  #btnVerifyId {
    min-height: 48px;
  }

  .stepper {
    align-items: flex-start;
    gap: 4px;
  }

  .stepper-item {
    min-width: 0;
    flex: 1 1 0;
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }

  .stepper-label {
    font-size: clamp(10px, 2.8vw, 12px);
    line-height: 1.25;
  }

  .stepper-divider {
    flex: 0 0 8px;
    margin: 15px 0 0;
  }

  .radio-toggle-group {
    flex-direction: column;
  }

  .radio-toggle-label {
    flex: 1 1 auto;
    width: 100%;
  }

  .wizard-card {
    padding: 20px 14px;
  }

  .wizard-stepper-card {
    padding: 16px 10px;
  }

  .wizard-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .wizard-footer .btn {
    width: 100%;
  }

  .consent-card {
    padding: 14px;
    gap: 10px;
  }

  .same-address-card {
    align-items: flex-start;
    padding: 12px;
  }

  .same-address-card label {
    line-height: 1.45;
  }

  .address-grid {
    grid-template-columns: 1fr;
  }
}

/* ================= GUARDIAN / EMERGENCY CONTACT STANDALONE CARD ================= */
.wizard-flow-wrapper {
  display: flex;
  flex-direction: column;
}

.guardian-main-card {
  /* Inherits standard .wizard-card styling seamlessly for complete UI consistency */
}

/* ================= VALIDATION & MISSING FIELD INDICATORS ================= */
@keyframes shakeField {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@keyframes pulseInvalidRing {
  0% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(192, 57, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0); }
}

.form-control.field-invalid,
select.form-control.field-invalid,
input.form-control.field-invalid {
  border-color: var(--status-rejected) !important;
  background-color: #FFF6F6 !important;
  animation: shakeField 0.4s ease-in-out, pulseInvalidRing 1.8s ease-out;
  box-shadow: 0 0 0 3.5px rgba(192, 57, 43, 0.22) !important;
}

.media-box.field-invalid {
  border-color: var(--status-rejected) !important;
  background-color: #FFF6F6 !important;
  animation: shakeField 0.4s ease-in-out, pulseInvalidRing 1.8s ease-out;
  box-shadow: 0 0 0 3.5px rgba(192, 57, 43, 0.22) !important;
}

.consent-card.field-invalid {
  border-color: var(--status-rejected) !important;
  background: #FFF6F6 !important;
  animation: shakeField 0.4s ease-in-out, pulseInvalidRing 1.8s ease-out;
  box-shadow: 0 0 0 3.5px rgba(192, 57, 43, 0.22) !important;
}

.field-error-msg {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--status-rejected);
  margin-top: 6px;
  animation: fadeIn 0.2s ease;
}

.field-error-msg svg {
  flex-shrink: 0;
}

/* Floating Toast Indicator for Missing Fields */
.validation-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-24px);
  background: #2D1417;
  color: #FFFFFF;
  border-left: 5px solid var(--status-rejected);
  border-radius: var(--radius-sm);
  padding: 13px 22px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.32);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 600;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  max-width: 90vw;
}

.validation-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.validation-toast .toast-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FF6B6B;
  flex-shrink: 0;
}

.same-address-card {
  background: #FAF8F5;
  border: 1.5px dashed var(--evsu-gold);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.same-address-card:hover {
  background: #F5EFE6;
}

.same-address-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--evsu-maroon);
  cursor: pointer;
}

.same-address-card label {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--evsu-maroon);
  cursor: pointer;
}

/* ================= FLOATING TERMS & PRIVACY MODAL ================= */
.modal-floating-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 12, 12, 0.65);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.modal-floating-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 740px;
  max-width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.32);
  overflow: hidden;
  border: 1px solid var(--line);
}

.modal-floating-header {
  background: var(--evsu-maroon);
  color: #ffffff;
  padding: 16px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--evsu-gold);
}

.modal-floating-close {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.modal-floating-close:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.55);
  transform: scale(1.05);
}

.modal-floating-close:active {
  transform: scale(0.95);
}

.modal-floating-tabs {
  display: flex;
  flex-shrink: 0;
  background: #F5EFE6;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  gap: 6px;
}

.modal-tab-btn {
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.modal-tab-btn:hover {
  color: var(--evsu-maroon);
}

.modal-tab-btn svg {
  flex-shrink: 0;
}

.modal-tab-btn:disabled {
  color: #898989;
  cursor: not-allowed;
  opacity: 0.55;
}

.modal-tab-btn.active {
  color: var(--evsu-maroon);
  border-bottom-color: var(--evsu-maroon);
  background: #ffffff;
}

.modal-floating-body {
  padding: 24px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.modal-floating-body h4 {
  font-size: 15px;
  color: var(--evsu-maroon);
  margin: 18px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-floating-body h4:first-child {
  margin-top: 0;
}

.modal-floating-body p {
  margin-bottom: 12px;
}

.modal-floating-body ul, .modal-floating-body ol {
  padding-left: 20px;
  margin-bottom: 14px;
}

.modal-floating-body li {
  margin-bottom: 6px;
}

.modal-floating-footer {
  padding: 14px 22px;
  background: #FAF8F5;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-consent-step {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.modal-consent-step label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.modal-consent-step input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--evsu-maroon);
  flex: 0 0 auto;
}

.modal-consent-required {
  margin: 0;
  padding: 0 24px 12px;
  color: var(--evsu-maroon);
  font-size: 12px;
  font-weight: 750;
}

#acceptTermsButton:disabled {
  background: #b8b8b8 !important;
  color: #fff;
  cursor: not-allowed;
  opacity: 1;
}


/* Applicant face verification */
#faceBox .media-preview-container {
  width: min(100%, 320px);
  height: 240px;
  background: #f5f3f1;
}
#faceBox .media-preview-container img,
#faceBox .webcam-video,
#photoBox .media-preview-container img,
#photoBox .webcam-video { object-fit: contain; }
.face-instructions { font-size: 13px; line-height: 1.6; margin: 0 auto 16px; max-width: 520px; }
.face-footnote { font-size: 12px; color: var(--ink-muted); margin-top: 12px; }
.face-result {
  text-align: left;
  max-width: 520px;
  margin: 0 auto 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--evsu-maroon);
  border-radius: 10px;
  background: #faf8f6;
  color: var(--ink);
}
.face-result[hidden], .face-score-group[hidden] { display: none; }
.face-result-title { display: block; font-size: 14px; line-height: 1.5; }
.face-result-message { font-size: 13px; line-height: 1.6; margin: 4px 0 0; font-weight: 400; }
.face-result--success { border-color: #aacfb9; border-left-color: #247347; background: #f1f8f4; }
.face-result--success .face-result-title { color: #205e3c; }
.face-result--error { border-color: #e5bfbb; border-left-color: #a32b25; background: #fff7f6; }
.face-result--error .face-result-title { color: #92271f; }
.face-result--loading {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 1000;
  box-sizing: border-box;
  width: min(440px, calc(100vw - 32px));
  margin: 0;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 12px;
  border-color: var(--evsu-maroon);
  background: #fff8eb;
  box-shadow: 0 8px 32px #0003;
}
.face-result--loading::before {
  content: "";
  grid-row: 1 / span 2;
  align-self: center;
  width: 32px;
  height: 32px;
  box-sizing: border-box;
  border: 4px solid #dfd4c2;
  border-top-color: var(--evsu-maroon);
  border-radius: 50%;
  animation: processing-spinner 800ms linear infinite;
}
.face-score-group { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.face-score-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12px; }
.face-score-heading label { margin: 0; font-weight: 500; }
#faceScore { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--evsu-maroon); }
#faceScoreMeter { display: block; width: 100%; height: 12px; margin: 6px 0; }
#faceScoreMeter::-webkit-meter-bar { background: #e6e0de; border: 0; }
#faceScoreMeter::-webkit-meter-optimum-value { background: var(--evsu-maroon); }
#faceScoreMeter::-moz-meter-bar { background: var(--evsu-maroon); }
.face-score-note { margin: 6px 0 0; font-size: 11px; line-height: 1.5; color: var(--ink-muted); }

/* Components can be mounted into any request-form host. */
[data-photo-editor] { text-align: left; }
[data-photo-editor][hidden], [data-liveness][hidden], #editPhotoBtn[hidden] { display: none; }
.photo-editor-dialog { box-sizing: border-box; width: min(940px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px);
  margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: #fff;
  box-shadow: 0 24px 80px #0004; overflow: hidden; }
.photo-editor-dialog[open] { display: flex; flex-direction: column; animation: photo-editor-appear 160ms ease-out; }
.photo-editor-dialog::backdrop { background: #17121bbb; }
.photo-editor-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.photo-editor-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 22px;
  border-bottom: 1px solid var(--line); }
.photo-editor-header > div { min-width: 0; }
.photo-editor-header h2 { margin: 0 0 4px; font-size: 20px; color: var(--evsu-maroon); }
.photo-editor-header > button { font-size: 24px; flex: 0 0 44px; }
.photo-editor-body { padding: 16px 22px; }
.photo-editor-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.photo-editor-toolbar label { flex: 1; min-width: 110px; font-size: 12px; }
.photo-editor-toolbar input[type="range"] { display: block; width: 100%; accent-color: var(--evsu-maroon); }
.photo-editor-toolbar button[aria-pressed="true"] { background: var(--evsu-maroon); border-color: var(--evsu-maroon); color: #fff; }
.photo-editor-view-controls output { min-width: 44px; font-size: 12px; font-variant-numeric: tabular-nums; }
.photo-editor-workspace { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 10px; background: #eeebea; border-radius: 10px; }
.photo-editor-canvas { display: block; width: auto; max-width: 100%; height: auto; max-height: min(48dvh, 540px); margin: 0 auto; touch-action: none; cursor: grab;
  background: repeating-conic-gradient(#e7e3e1 0% 25%, #fff 0% 50%) 0 0 / 16px 16px; border: 1px solid var(--line); border-radius: 8px; }
.photo-editor-canvas:active { cursor: grabbing; }
.photo-editor-canvas--manual, .photo-editor-canvas--manual:active { cursor: crosshair; }
.photo-editor-canvas:focus-visible { outline: 3px solid var(--evsu-maroon); outline-offset: 3px; }
.photo-editor-path-tools[hidden], .photo-editor-dialog button[hidden], .photo-editor-original-toggle[hidden] { display: none; }
.photo-editor-original-toggle { display: flex; align-items: center; gap: 8px; }
.photo-editor-status {
  font-size: 13px;
  line-height: 1.5;
  text-align: justify;
  overflow-wrap: anywhere;
}
.photo-editor-status--loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: #fff8eb;
  color: var(--evsu-maroon);
  border-left: 4px solid var(--evsu-maroon);
  font-weight: 600;
}
.photo-editor-status--loading::before {
  content: "";
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  box-sizing: border-box;
  border: 4px solid #dfd4c2;
  border-top-color: var(--evsu-maroon);
  border-radius: 50%;
  animation: processing-spinner 800ms linear infinite;
}

@keyframes processing-spinner { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .face-result--loading::before,
  .photo-editor-status--loading::before { animation: none; }
}
.photo-editor-actions { display: flex; flex: none; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 14px 22px;
  border-top: 1px solid var(--line); background: #faf8f6; }
.photo-editor-dialog button:disabled { opacity: .55; cursor: default; }
.photo-editor-popup-toast {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #2D1417;
  color: #FFFFFF;
  border-left: 5px solid #FF6B6B;
  border-radius: 8px;
  padding: 12px 20px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  max-width: min(560px, calc(100% - 40px));
}
.photo-editor-popup-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
@keyframes photo-editor-appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .photo-editor-dialog[open] { animation: none; } }
@media (max-width: 520px) {
  .photo-editor-dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); border-radius: 12px; }
  .photo-editor-header, .photo-editor-body, .photo-editor-actions { padding: 12px; }
  .photo-editor-status { font-size: 12px; }
  .photo-editor-toolbar { gap: 8px; }
  .photo-editor-dialog button { min-height: 40px; }
  .photo-editor-view-controls label { min-width: 90px; }
}
#faceBox .media-preview-container {
  position: relative;
  width: min(100%, 280px);
  aspect-ratio: 1;
  height: auto;
  border: 4px solid #49a9df;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 20px;
}
#faceBox .media-preview-container img, #faceBox .webcam-video { width: 100%; height: 100%; object-fit: cover; }
/* Mirror the live view and its guides. Canvas capture reads the original video frames. */
.camera-preview-mirrored { transform: scaleX(-1); }
.liveness-overlay { visibility: hidden; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
[data-liveness] { max-width: 560px; margin: 12px auto; font-size: 13px; }
[data-liveness] > p { min-height: 2.8em; font-weight: 600; font-size: 17px; color: #2478aa; }
.liveness-steps { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; justify-content: center; }
.liveness-steps li { padding: 7px 10px; border: 1px solid var(--line); border-radius: 20px; font-size: 12px; }
.liveness-steps li::before { content: '○ '; }
.liveness-steps li.passed { color: #205e3c; background: #f1f8f4; border-color: #aacfb9; }
.liveness-steps li.passed::before { content: '✓ '; }

/* ================= SYSTEM-WIDE RESPONSIVE HARDENING ================= */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body.mobile-nav-open {
  overflow: hidden;
}

.main-wrapper,
.nav-container,
.footer-inner,
.footer-bottom,
.wizard-card,
.timeline-card,
.status-search-card,
.verification-gate-card {
  min-width: 0;
}

.mobile-drawer {
  width: min(84vw, 280px);
  height: 100dvh;
  overflow-y: auto;
}

.review-summary-table {
  table-layout: fixed;
  width: 100%;
}

.review-summary-table th,
.review-summary-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.status-search-row > *,
.verify-token-form > * {
  min-width: 0 !important;
}

@media (max-width: 768px) {
  .nav-container {
    gap: 12px;
    padding: 10px 16px;
  }

  .burger-btn {
    flex: 0 0 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .mobile-menu-overlay {
    inset: 0;
  }

  .main-wrapper {
    width: 100%;
  }

  .modal-floating-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-floating-dialog {
    width: 100%;
    max-width: none;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
  }

  .modal-floating-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 8px;
    gap: 4px;
  }

  .modal-tab-btn {
    min-width: 0;
    min-height: 48px;
    padding: 10px 8px;
    gap: 6px;
    line-height: 1.4;
    white-space: normal;
    text-align: left;
  }

  .modal-floating-body {
    padding: 20px 18px;
  }

  .confirmation-actions {
    flex-wrap: wrap;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

@media (max-width: 520px) {
  .brand-badge {
    min-width: 0;
    gap: 9px;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
  }

  .brand-text {
    min-width: 0;
  }

  .brand-text .uni-title {
    font-size: 12px;
    line-height: 1.25;
  }

  .brand-text .sub-title {
    max-width: 190px;
    overflow: hidden;
    font-size: 9.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .wizard-card,
  .timeline-card,
  .status-search-card,
  .verification-gate-card {
    padding: 20px 16px !important;
    border-radius: 12px;
  }

  .hero-title {
    font-size: clamp(28px, 9vw, 34px);
  }

  .hero-actions .btn {
    min-height: 48px;
  }

  .status-search-row,
  .verify-token-form,
  .confirmation-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .status-search-row .btn,
  .verify-token-form .btn,
  .confirmation-actions .btn {
    justify-content: center;
    width: 100%;
  }

  .review-summary-table th,
  .review-summary-table td {
    padding: 9px 7px;
    font-size: 11.5px;
  }

  .modal-floating-header,
  .modal-floating-footer {
    padding-inline: 14px;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

/* Public interaction feedback shared by the request, status, and QR pages. */
.main-wrapper,
.main-wrapper > * {
  min-width: 0;
}

.hero-grid > *,
.steps-grid > *,
.trust-bar > *,
.status-search-row > *,
.verify-token-form > * {
  min-width: 0;
}

.main-wrapper img,
.main-wrapper svg,
.main-wrapper video,
.main-wrapper canvas {
  max-width: 100%;
}

.hero-desc,
.step-card,
.trust-item,
.status-search-card,
.timeline-card,
.wizard-card,
.verification-gate-card {
  overflow-wrap: anywhere;
}

.btn,
.burger-btn,
.mobile-drawer-close,
.mobile-nav-link,
.nav-link,
.radio-toggle-label {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn:active,
.burger-btn:active,
.mobile-drawer-close:active,
.mobile-nav-link:active,
.nav-link:active,
.radio-toggle-label:active {
  transform: scale(0.97);
  opacity: 0.86;
}

@media (hover: hover) {
  .btn:not(:disabled):hover {
    transform: translateY(-1px) scale(1.015);
    opacity: 0.96;
  }
}

.btn:focus-visible,
.burger-btn:focus-visible,
.mobile-drawer-close:focus-visible,
.mobile-nav-link:focus-visible,
.nav-link:focus-visible,
.radio-toggle-label:focus-within {
  outline: 3px solid var(--evsu-gold);
  outline-offset: 3px;
}

.btn[aria-busy="true"] {
  cursor: progress;
}

.btn[aria-busy="true"]:not([data-loading])::after {
  content: "";
  width: 1em;
  height: 1em;
  flex: 0 0 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: public-spin 0.7s linear infinite;
}

.public-loading-indicator::before {
  content: "";
  display: block;
  width: 2rem;
  height: 2rem;
  margin: 0 auto 1rem;
  border: 3px solid var(--evsu-gold-soft);
  border-right-color: var(--evsu-maroon);
  border-radius: 50%;
  animation: public-spin 0.7s linear infinite;
}

.wizard-progress {
  height: 4px;
  margin-top: 16px;
  background: var(--line-soft);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.wizard-progress-bar {
  height: 100%;
  width: 33.333%;
  background: var(--evsu-gold);
  border-radius: inherit;
  transition: width 0.3s ease;
}

.stepper-item.done .stepper-dot {
  animation: public-check-pop 0.35s ease-out;
}

.wizard-step-enter,
.confirmation-enter {
  animation: public-enter 0.35s ease-out;
}

.page-enter {
  animation: public-page-enter 0.35s ease-out;
}

.confirmation-enter svg polyline {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: public-check-draw 0.55s ease-out 0.18s forwards;
}

.reveal-ready {
  opacity: 0;
  transform: translateY(12px);
}

.reveal-ready.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

@keyframes public-spin { to { transform: rotate(360deg); } }
@keyframes public-enter { from { opacity: 0; transform: translateY(10px); } }
@keyframes public-page-enter { from { opacity: 0.65; } }
@keyframes public-check-pop { 50% { transform: scale(1.13); } }
@keyframes public-check-draw { to { stroke-dashoffset: 0; } }

@media (max-width: 480px) {
  .hero-grid,
  .steps-grid,
  .trust-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
  }

  .status-search-row,
  .verify-token-form {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mobile-drawer { transition: none !important; }
  .btn,
  .mobile-drawer,
  .wizard-progress-bar,
  .stepper-dot,
  .reveal-ready,
  .reveal-ready.is-visible {
    transition-duration: 0.01ms !important;
  }
  .btn[aria-busy="true"]:not([data-loading])::after,
  .public-loading-indicator::before,
  .stepper-item.done .stepper-dot,
  .wizard-step-enter,
  .page-enter,
  .confirmation-enter,
  .confirmation-enter svg polyline {
    animation: none !important;
  }
  .reveal-ready {
    opacity: 1;
    transform: none;
  }
  .confirmation-enter svg polyline {
    stroke-dashoffset: 0;
  }
}

@media (max-width: 360px) {
  .brand-text .sub-title {
    display: none;
  }

  .brand-text .uni-title {
    font-size: 11px;
  }

  .mobile-drawer {
    padding: 20px 16px;
    width: 88vw;
  }
}
