/* ─────────────────────────────────────────────────────────────────────────
   style.css — Mobile Line Termination Form
   Clean, trustworthy government-service aesthetic
───────────────────────────────────────────────────────────────────────── */

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

:root {
  --primary: #1a56db;
  --primary-dk: #1340aa;
  --danger: #c0392b;
  --danger-lt: #fdf2f1;
  --success: #1a7f4b;
  --success-lt: #f0faf4;
  --warning-lt: #fffbeb;
  --grey-50: #f9fafb;
  --grey-100: #f3f4f6;
  --grey-300: #d1d5db;
  --grey-500: #6b7280;
  --grey-700: #374151;
  --grey-900: #111827;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--grey-100);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 48px;
  color: var(--grey-900);
  line-height: 1.5;
}

/* ── Layout ────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 480px;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 32px;
}

/* ── Header ────────────────────────────────────────────────────────────── */
.header {
  text-align: center;
  margin-bottom: 28px;
}

.logo {
  font-size: 40px;
  margin-bottom: 12px;
  display: block;
}

h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--grey-900);
  margin-bottom: 6px;
}

.subtitle {
  color: var(--grey-500);
  font-size: 14px;
}

/* ── Progress bar ──────────────────────────────────────────────────────── */
.progress {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
}

.progress-step {
  flex: 1;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 4px;
  border-radius: 4px;
  background: var(--grey-100);
  color: var(--grey-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-step.done {
  background: #e8f5e9;
  color: var(--success);
}

.progress-step.active {
  background: var(--primary);
  color: #fff;
}

/* ── Inline mobile number & secondary subtitle ────────────────────────── */
/* .mobile-number  — emphasises the number inline within subtitle text     */
/* .subtitle-sub   — secondary line below the main subtitle                */
.mobile-number {
  font-weight: 700;
  color: var(--grey-900);
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.subtitle-sub {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--grey-500);
}

/* ── Alerts ────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 20px;
}

.alert-error {
  background: var(--danger-lt);
  border-left: 4px solid var(--danger);
  color: var(--danger);
}

.alert-warning {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  color: #78350f;
}

.alert-info {
  background: #eff6ff;
  border-left: 3px solid #93c5fd;
  color: #1e3a5f;
  margin-bottom: 24px;
}

.alert-info ul {
  font-weight: 400;
}

.alert-support {
  font-size: 12px;
  margin-top: 8px;
  opacity: 0.85;
}

/* ── Warning banner ────────────────────────────────────────────────────── */
.warning-banner {
  background: #fefce8;
  border-left: 3px solid #fde68a;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  color: #713f12;
  margin-bottom: 16px;
}

.warning-banner.danger {
  background: var(--danger-lt);
  border-color: var(--danger);
  color: var(--danger);
}

/* ── Form ──────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--grey-700);
  margin-bottom: 6px;
}

input[type="tel"],
input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--grey-300);
  border-radius: var(--radius);
  font-size: 16px;
  color: var(--grey-900);
  transition: border-color 0.15s;
  background: #fff;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

input::placeholder {
  color: var(--grey-300);
}

small {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--grey-500);
}

.attempts {
  color: var(--danger);
  font-weight: 600;
}

/* ── Input with prefix (+65) ───────────────────────────────────────────── */
.input-prefix-wrapper {
  display: flex;
  align-items: stretch;
}

.input-prefix {
  padding: 11px 12px;
  background: var(--grey-50);
  border: 1.5px solid var(--grey-300);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 15px;
  color: var(--grey-500);
  white-space: nowrap;
}

.input-prefix-wrapper input {
  border-radius: 0 var(--radius) var(--radius) 0;
  flex: 1;
}

/* ── Re-entry field validation states ─────────────────────────────────── */
.input-prefix-wrapper.is-match .input-prefix,
.input-prefix-wrapper.is-match input {
  border-color: var(--success);
}

.input-prefix-wrapper.is-match {
  box-shadow: 0 0 0 3px rgba(26, 127, 75, 0.12);
  border-radius: var(--radius);
}

.input-prefix-wrapper.is-mismatch .input-prefix,
.input-prefix-wrapper.is-mismatch input {
  border-color: var(--danger);
}

.input-prefix-wrapper.is-mismatch {
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.10);
  border-radius: var(--radius);
}

.validation-msg {
  font-size: 13px;
  margin-top: 7px;
  min-height: 18px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--grey-500);
}

.validation-msg.is-match {
  color: var(--success);
  font-weight: 500;
}

.validation-msg.is-mismatch {
  color: var(--danger);
}

/* ── OTP input ─────────────────────────────────────────────────────────── */
.otp-input {
  font-size: 28px !important;
  letter-spacing: 12px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dk);
}

.btn-primary:disabled {
  background: var(--grey-300);
  color: var(--grey-500);
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--grey-100);
  color: var(--grey-700);
  border: 1.5px solid var(--grey-300);
}

.btn-secondary:hover {
  background: var(--grey-300);
}

.btn-singpass {
  background: #d42027;
  color: #fff;
  font-size: 15px;
}

.btn-singpass:hover {
  background: #b71c1c;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #a93226;
}

.btn-danger:disabled {
  background: var(--grey-300);
  cursor: not-allowed;
  transform: none;
}

/* ── Loading states ─────────────────────────────────────────────────────── */
/* Inline spinner shown inside a button while waiting for a server response */
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
  flex-shrink: 0;
}

/* Secondary-style buttons use a dark spinner */
.btn-secondary .btn-spinner,
.btn-secondary[disabled] .btn-spinner {
  border-color: rgba(55, 65, 81, 0.3);
  border-top-color: var(--grey-700);
}

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

/* Full-page overlay for navigations that leave the page (e.g. Singpass redirect) */
.page-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(3px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.page-overlay.active {
  display: flex;
}

.page-overlay-spinner {
  width: 40px;
  height: 40px;
  border-width: 4px;
  border-color: rgba(26, 86, 219, 0.25);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

.page-overlay-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--grey-700);
}

/* ── Info / Summary boxes ──────────────────────────────────────────────── */
.info-box {
  background: var(--grey-50);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 14px;
  color: var(--grey-700);
  margin-bottom: 24px;
}

.info-box ul,
.info-box ol {
  margin-top: 8px;
  padding-left: 20px;
}

.info-box li {
  margin-bottom: 4px;
}

.success-box {
  background: var(--success-lt);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.summary-card {
  border: 1.5px solid var(--grey-300);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.summary-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--grey-700);
  margin-bottom: 12px;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.summary-table td {
  padding: 6px 0;
  vertical-align: top;
}

.summary-table td:first-child {
  color: var(--grey-500);
  width: 130px;
  font-size: 13px;
}

.danger-text {
  color: var(--danger);
}

/* ── Checkbox ──────────────────────────────────────────────────────────── */
.checkbox-group {
  margin-bottom: 20px;
}

.checkbox-label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--grey-700);
  cursor: pointer;
  font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  flex-shrink: 0;
  accent-color: var(--danger);
  cursor: pointer;
}

/* ── Brand logo (ZYM) ──────────────────────────────────────────────────── */
.brand-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.brand-logo-img {
  width: 40%;
  height: auto;
  display: block;
}

/* ── Myinfo button ─────────────────────────────────────────────────────── */
.myinfo-btn-link {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
}

.myinfo-btn-img {
  /* Scale to fill card width while respecting aspect ratio (318:48) */
  width: 100%;
  max-width: 318px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  transition: opacity 0.15s, transform 0.1s;
}

.myinfo-btn-link:hover .myinfo-btn-img {
  opacity: 0.88;
}

.myinfo-btn-link:active .myinfo-btn-img {
  transform: scale(0.98);
}

/* ── Singpass logo (legacy fallback) ───────────────────────────────────── */
.singpass-logo {
  height: 20px;
}

/* ── Steps preview ─────────────────────────────────────────────────────── */
.steps-preview {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--grey-100);
}

.steps-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--grey-500);
  margin-bottom: 8px;
}

.steps-list {
  padding-left: 18px;
  font-size: 13px;
  color: var(--grey-700);
}

.steps-list li {
  margin-bottom: 4px;
}

/* ── Divider ───────────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--grey-100);
  margin: 20px 0;
}

/* ── Countdown ─────────────────────────────────────────────────────────── */
.countdown-text {
  text-align: center;
  font-size: 12px;
  color: var(--grey-500);
  margin-top: 16px;
}

.countdown-text--expired {
  color: var(--danger);
  font-weight: 600;
}

.resend-hint {
  text-align: center;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--grey-500);
}

/* ── Error modal overlay ───────────────────────────────────────────────────
   Built as a plain div (not <dialog>) — native <dialog> has positioning
   bugs on Android Chrome that make it render as a block element at the top
   of the page rather than a centred modal. The div approach is universally
   reliable across all mobile and desktop browsers.
────────────────────────────────────────────────────────────────────────── */
.error-modal-overlay {
  /* Full-viewport fixed overlay — identical visual result to dialog::backdrop */
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(17, 24, 39, 0.60);
  backdrop-filter: blur(2px);
  /* Flexbox centring is the most reliable cross-browser centering method */
  display: flex;
  align-items: center;
  justify-content: center;
  /* Padding ensures card never touches screen edge on narrow phones */
  padding: 16px;
  /* Box-sizing so padding is included in size calculation */
  box-sizing: border-box;
}

.error-modal-card {
  /* Fluid width: fills available space minus the 16px padding each side,
     capped at 448px on large screens */
  width: 100%;
  max-width: 448px;
  /* Scroll internally if content is taller than viewport (zoomed or tiny screen) */
  max-height: calc(100vh - 32px);
  max-height: calc(100svh - 32px);
  overflow-y: auto;
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  /* em padding: scales when user changes OS font size or zooms */
  padding: 1.75em 1.5em 1.5em;
  /* Flex column so children stack and stretch correctly */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75em;
  box-sizing: border-box;
}

/* Icon wrapper */
.error-dialog-icon-wrap {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: var(--danger);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-dialog-icon-wrap svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
  flex-shrink: 0;
}

.error-dialog-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--grey-900);
  line-height: 1.3;
}

/* Mobile number pill */
.error-dialog-mobile {
  font-size: 1rem;
  font-weight: 600;
  color: var(--grey-700);
  background: var(--grey-100);
  border: 1.5px solid var(--grey-300);
  padding: 0.25em 0.875em;
  border-radius: 100px;
  display: inline-block;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.error-dialog-body {
  font-size: 0.9375rem;
  color: var(--grey-700);
  line-height: 1.65;
  word-break: break-word;
  overflow-wrap: break-word;
}

.error-dialog-support {
  font-size: 0.8125rem;
  color: var(--grey-500);
  line-height: 1.5;
}

.error-dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 0.625em;
  width: 100%;
  margin-top: 0.375em;
}

/* WCAG 2.5.5: minimum 44×44 px touch target */
.error-dialog-actions .btn {
  min-height: 44px;
}

/* Tighten card padding on very small phones (< 360px) */
@media (max-width: 360px) {
  .error-modal-card {
    padding: 1.25em 1em 1em;
  }
}

/* ── Policy consent modal ──────────────────────────────────────────────────
   Triggered from the landing page after mobile validation.
   Structure: overlay → card (flex-col) → header (sticky) + body (scroll) + footer (sticky)
────────────────────────────────────────────────────────────────────────── */
.policy-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(17, 24, 39, 0.65);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.policy-modal-overlay[hidden] {
  display: none;
}

.policy-modal-card {
  width: 100%;
  max-width: 448px;
  /* Limit height so content scrolls on short viewports */
  max-height: calc(100vh - 32px);
  max-height: calc(100svh - 32px);
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

/* Sticky header — always visible at top */
.policy-modal-header {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--grey-200);
}

.policy-modal-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.policy-modal-icon {
  flex-shrink: 0;
  color: var(--primary);
}

.policy-modal-title {
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--grey-900);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
  margin: 0;
}

.policy-modal-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--grey-300);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--grey-500);
  transition: background 0.15s, color 0.15s;
  padding: 0;
}

.policy-modal-close:hover {
  background: var(--grey-100);
  color: var(--grey-900);
}

.policy-modal-close svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Scrollable body — expands to fill available card height */
.policy-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  min-height: 0;
  /* required for flex overflow to work */
  -webkit-overflow-scrolling: touch;
}

/* Sticky footer — always visible at bottom */
.policy-modal-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--grey-200);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
}

/* Checkbox + label row */
.policy-modal-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  border: 1.5px solid var(--grey-300);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.8125rem;
  color: var(--grey-700);
  line-height: 1.55;
  transition: border-color 0.15s, background 0.15s;
}

.policy-modal-checkbox-row:has(input:checked) {
  border-color: var(--primary);
  background: #eff6ff;
}

.policy-modal-checkbox-row input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ── Badge ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-pending {
  background: #fef9c3;
  color: #854d0e;
}

/* ── Code ──────────────────────────────────────────────────────────────── */
code {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 12px;
  background: var(--grey-100);
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-all;
}

/* ── Mobile responsive ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
  body {
    padding: 12px 8px 32px;
  }

  .card {
    padding: 24px 20px;
  }

  .progress-step {
    font-size: 10px;
    padding: 5px 2px;
  }
}

/* ── Footer copyright ──────────────────────────────────────────────────── */
.footer-copyright {
  text-align: center;
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.8;
}
.footer-copyright a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer-copyright a:hover { color: var(--text-secondary); }

/* ── Landing two-column layout ─────────────────────────────────────────── */
/* On desktop: form card left (fixed width) + terms panel right (flex fill) */
/* On mobile:  single column, terms panel stacks below the form card         */
.landing-container {
  max-width: 520px;
}

.landing-wrap {
  display: flex;
  flex-direction: column;
}

.landing-wrap>.card {
  width: 100%;
}

/* Terms panel — same card aesthetic as .card */
.terms-panel {
  flex: 1;
  min-width: 0;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 26px 26px;
  border-left: 3px solid var(--primary);
  height: 100%;
  box-sizing: border-box;
}

.terms-panel-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--grey-100);
}

@keyframes terms-highlight {
  0% {
    background-color: transparent;
  }

  15% {
    background-color: rgba(26, 86, 219, 0.14);
  }

  55% {
    background-color: rgba(26, 86, 219, 0.14);
  }

  100% {
    background-color: transparent;
  }
}

.terms-highlight-flash {
  animation: terms-highlight 1100ms ease-out forwards;
}

.terms-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.terms-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--grey-700);
}

.terms-list li::before {
  content: "–";
  flex-shrink: 0;
  color: #9ca3af;
  margin-top: 1px;
  font-weight: 400;
}

.tl {
  font-weight: 700;
  color: var(--grey-900);
}

.terms-list a {
  color: var(--primary);
  text-decoration: none;
}

.terms-list a:hover {
  text-decoration: underline;
}

/* Terms accordion summary row (heading + chevron) */
.terms-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  cursor: default;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--grey-100);
  margin-bottom: 14px;
}

.terms-summary::-webkit-details-marker {
  display: none;
}

.terms-summary-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.terms-summary .terms-panel-heading {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.terms-chevron {
  display: none;
  flex-shrink: 0;
  color: var(--grey-500);
  transition: transform 0.2s ease;
}

details.terms-accordion[open] .terms-chevron {
  transform: rotate(180deg);
}

/* Policy acknowledgment nudge above Continue button */
.policy-ack {
  font-size: 12px;
  color: var(--grey-500);
  text-align: center;
  margin: 0 0 12px;
  line-height: 1.5;
}

.policy-ack a {
  color: var(--primary);
  text-decoration: none;
}

.policy-ack a:hover {
  text-decoration: underline;
}

/* Singpass-unavailable note — slim info strip above Continue button */
.singpass-unavailable-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 12px;
  color: #1e40af;
  line-height: 1.55;
}

.singpass-unavailable-note a {
  color: #1d4ed8;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.singpass-unavailable-note a:hover {
  text-decoration: underline;
}

/* Termination date strip — slim single-row callout above the form */
.termination-date-strip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 11px 14px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #78350f;
  line-height: 1.6;
}

.termination-date-strip p {
  margin: 0;
}

.termination-date-strip strong {
  color: #92400e;
}

.termination-date-strip a {
  color: #b45309;
  text-decoration: none;
  white-space: nowrap;
}

.termination-date-strip a:hover {
  text-decoration: underline;
}

/* ── Landing page: mobile reorder ──────────────────────────────────────── */
/* Move "What happens next" above the form on mobile so users see context
   before typing. The Continue button stays inline in the form (no sticky). */
@media (max-width: 760px) {
  .landing-container {
    max-width: 480px;
  }

  /* Flex column enables child reordering without touching HTML */
  .landing-wrap>.card {
    display: flex;
    flex-direction: column;
  }

  /* Steps → 5, form → 10 (all other children stay at order:0) */
  .steps-preview {
    order: 5;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    border-bottom: 1px solid var(--grey-100);
    padding-bottom: 16px;
    margin-bottom: 4px;
  }

  form#landing-form {
    order: 10;
  }
}
/* ── Singpass "Display As-Is" identity blocks (PDPA compliance) ─────── */
.verified-identity-box {
  background: var(--success-lt);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
  text-align: left;
}

.identity-received-box {
  border-left: 3px solid #fca5a5;
  text-align: left;
}

.identity-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.identity-badge--success { color: var(--success); }
.identity-badge--neutral { color: var(--grey-700); }

/* Stacked left-aligned rows — works identically on mobile and desktop */
.id-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.id-row:last-child {
  margin-bottom: 0;
}

.id-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.id-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--grey-900);
  word-break: break-word;
  line-height: 1.4;
}

/* ── Confirm page: select, textarea, misc ───────────────────────────────── */
.form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--grey-300);
  border-radius: 8px;
  font-size: 15px;
  color: var(--grey-900);
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
}

.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--grey-300);
  border-radius: 8px;
  font-size: 14px;
  color: var(--grey-900);
  background: #fff;
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.15s;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

.char-count { text-align: right; color: var(--grey-500); }
.required-star { color: var(--danger); }
.label-hint { font-weight: 400; color: var(--grey-500); }
.btn-mt { margin-top: 12px; }
.alert-sm { font-size: 13px; margin-bottom: 20px; }
.faq-link { color: var(--primary); }
.icon-inline { vertical-align: middle; flex-shrink: 0; }

/* ── Dark mode ─────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #3b82f6;
    --primary-dk: #2563eb;
    --grey-50: #1e293b;
    --grey-100: #0f172a;
    --grey-300: #334155;
    --grey-500: #94a3b8;
    --grey-700: #cbd5e1;
    --grey-900: #f1f5f9;
    --danger-lt: #3b0a09;
    --success-lt: #052e16;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  }

  body { background: #0f172a; }

  .card { background: #1e293b; }

  input[type="tel"],
  input[type="text"],
  .form-select,
  .form-textarea {
    background: #0f172a;
    color: #f1f5f9;
    border-color: #334155;
  }

  input::placeholder { color: #475569; }

  .input-prefix {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
  }

  .btn-secondary {
    background: #1e293b;
    color: #cbd5e1;
    border-color: #334155;
  }

  .btn-secondary:hover { background: #334155; }

  .progress-step { background: #1e293b; }
  .progress-step.done { background: #052e16; color: #4ade80; }

  .alert-error { background: #3b0a09; color: #fca5a5; }
  .alert-warning { background: #292110; color: #fbbf24; }
  .alert-info { background: #0c1a3a; color: #93c5fd; }

  .warning-banner { background: #292110; color: #fbbf24; border-left-color: #f59e0b; }
  .warning-banner.danger { background: #3b0a09; color: #fca5a5; }

  .info-box { background: #1e293b; color: #cbd5e1; }
  .success-box { background: #052e16; border-color: #166534; }
  .summary-card { border-color: #334155; }
  .divider { border-top-color: #334155; }

  .error-modal-card { background: #1e293b; }

  .policy-modal-card { background: #1e293b; }
  .policy-modal-footer { background: #1e293b; border-top-color: #334155; }
  .policy-modal-header { border-bottom-color: #334155; }
  .policy-modal-close { background: #0f172a; border-color: #334155; color: #94a3b8; }
  .policy-modal-close:hover { background: #334155; color: #f1f5f9; }
  .policy-modal-checkbox-row { border-color: #334155; color: #cbd5e1; }
  .policy-modal-checkbox-row:has(input:checked) { border-color: #3b82f6; background: #0c1a3a; }

  .terms-panel { background: #1e293b; }
  .terms-panel-heading { border-bottom-color: #334155; }
  .terms-summary { border-bottom-color: #334155; }

  code { background: #0f172a; color: #93c5fd; }

  .page-overlay { background: rgba(15, 23, 42, 0.92); }

  .singpass-unavailable-note { background: #0c1a3a; border-color: #1e40af; color: #93c5fd; }
  .singpass-unavailable-note a { color: #60a5fa; }

  .termination-date-strip { background: #292110; border-color: #78350f; color: #fde68a; }
  .termination-date-strip strong { color: #fbbf24; }
  .termination-date-strip a { color: #f59e0b; }

  .verified-identity-box { background: #052e16; border-color: #166534; }
  .badge-pending { background: #292110; color: #fbbf24; }
  .attempts { color: #fca5a5; }
  .countdown-text--expired { color: #fca5a5; }
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
