/* NKF Patient Portal — CSS
   Brand spec source: FDD Annex "Response from marketing comms" (v0.3).
   Font: Lato (marketing spec) — Open Sans kept nowhere; Lato throughout.
   Page header colour: #FEECD1 (yellow, per marketing spec).
   Heading Lato 38 / Body Lato 16 / Footer Lato 12 / Table header Lato 24 / Table content Lato 16.
   Table header and button colours: light blue #D9EDF7 background / dark blue #2A6B9B text,
   confirmed by Ravi (previously TBC, falling back to NKF red).
   ---------------------------------------------------------------- */
:root {
  --red:    #e8372b;
  --red-dk: #c0392b;
  --dark:   #1a1a2e;
  --grey:   #5a6378;
  --light:  #f5f6f8;
  --border: #dde3ec;
  --white:  #ffffff;
  --font:   "Lato", system-ui, sans-serif;
  --radius: 6px;
  --shadow: 0 2px 8px rgba(0,0,0,.07);

  /* Marketing comms brand tokens */
  --page-header-bg:      #FEECD1;  /* Page Header Color — confirmed */
  --heading-size:        38px;     /* Heading Font Size — confirmed */
  --body-size:           16px;     /* Body/Content Size — confirmed */
  --footer-size:         12px;     /* Footer Font size — confirmed */
  --table-header-bg:     #D9EDF7;  /* Table header background — confirmed by Ravi */
  --table-header-fg:     #2A6B9B;  /* Table header text — confirmed by Ravi */
  --table-header-size:   24px;     /* Table View Header Font Size — confirmed */
  --table-content-bg:    #ffffff;  /* Table View Content background — confirmed */
  --table-content-size:  16px;     /* Table View Content Font Size — confirmed */
  --btn-text-size:       11px;     /* Buttons Font Size — confirmed */
  --btn-bg:              #D9EDF7;  /* Button background — confirmed by Ravi */
  --btn-fg:              #2A6B9B;  /* Button text — confirmed by Ravi */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font); color: var(--dark); background: var(--light); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; font-size: var(--body-size); }
a { color: var(--red); }
a:hover { color: var(--red-dk); }
ul { list-style: none; }
img { max-width: 100%; }

/* ── Nav / Page header (yellow, per marketing spec) ─────────────── */
.nav { background: var(--page-header-bg); border-bottom: 3px solid var(--red); position: sticky; top: 0; z-index: 100; }
.nav-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1.25rem;
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: nowrap;
}

.nav-brand {
    flex-shrink: 0;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 1.5rem;
    flex-wrap: nowrap;
}

.nav-links {
    display: flex;
    gap: .25rem;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
}

    .nav-links a {
        padding: .3rem .75rem;
        border-radius: var(--radius);
        color: var(--dark);
        font-size: .88rem;
        font-weight: 700;
        text-decoration: none;
        transition: background .15s, color .15s;
        white-space: nowrap;
    }

.nav-end {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex-shrink: 0;
}

/* Signed-in navigation only */
.nav-menu > .nav-end {
    padding-left: 2rem;
}

.nav-name {
    font-size: .85rem;
    color: var(--dark);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.btn-logout { background: var(--btn-bg); border: 1px solid var(--btn-fg); border-radius: var(--radius); padding: .3rem .75rem; font-size: var(--btn-text-size); cursor: pointer; color: var(--btn-fg); font-family: var(--font); }
.btn-logout:hover { background: #c3e2f2; border-color: var(--btn-fg); color: var(--btn-fg); }
.nav-toggle { display: none; flex-direction: column; justify-content: center; align-items: center; width: 40px; height: 40px; margin-left: auto; background-color: transparent; -webkit-appearance: none; appearance: none; border: 1px solid var(--dark); border-radius: var(--radius); cursor: pointer; padding: 0; }
.nav-toggle span { display: block; width: 20px; height: 2px; background-color: var(--dark); border-radius: 2px; }
.nav-toggle span + span { margin-top: 5px; }
/* ── Navigation logo ────────────────────────────────────────── */
.nav-brand img {
    height: 60px;
    width: auto;
    display: block;
}

.nav-title-group {
    position: absolute;
    left: 48%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
}

    .nav-title-group .nav-brand {
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

        .nav-title-group .nav-brand img {
            height: 60px;
            width: auto;
            display: block;
        }

.nav-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
    white-space: nowrap;
}

/* ── Main / Footer ──────────────────────────────────────────── */
.main {
    max-width: 1140px;
    width: 100%;
    margin: 0 auto;
    padding: 1.75rem 1.25rem;
    flex: 1;
}

.footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: .9rem 1.25rem;
}

.footer-inner {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .75rem;
    font-size: var(--footer-size);
    color: var(--dark);
}

    .footer-inner a {
        color: var(--red);
        text-decoration: underline;
    }

        .footer-inner a:hover {
            color: var(--red-dk);
        }

/* ── Live session-expiry countdown, footer right corner (signed-in users only) ── */
.footer-session-countdown { flex: 0 0 auto; margin-left: auto; font-size: 12px; font-weight: 700; color: var(--grey); white-space: nowrap; }
.footer-session-countdown.warning { color: var(--red); }


@keyframes footer-scroll {

    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-100%);
    }
}
/* ── Alerts ─────────────────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .875rem; font-weight: 600; }
.alert-ok { background: #edf7f0; color: #1a7a40; border-left: 4px solid #1a7a40; }
.alert-err { background: #fdf0ee; color: var(--red-dk); border-left: 4px solid var(--red); }

/* ── Page header (content heading, e.g. h1/h2) ─────────────────── */
.page-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; flex-wrap: wrap; gap: .75rem; }
.page-hdr h2 { font-size: var(--heading-size); font-weight: 700; line-height: 1.15; }
.page-title { font-size: var(--heading-size); font-weight: 700; text-align: center; margin-bottom: 1.5rem; color: var(--grey); }

/* ── Brand-new applicant landing page (NewApplicant.cshtml) ─────────────── */
.landing-intro { max-width: 700px; margin: 0 auto 1.5rem; font-size: var(--body-size); color: var(--dark); }
.landing-intro p { margin-bottom: .75rem; }
.landing-programme-list { margin: 0 0 .75rem 1.25rem; }
.landing-programme-list li { margin-bottom: .25rem; }
.sub { color: var(--grey); font-size: .875rem; margin-top: .2rem; }
.muted { color: var(--grey); font-size: .875rem; }

/* ── Cards ─────────────────────────────────────────────────── */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.1rem; overflow: hidden; }
.card-hdr { padding: .9rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.card-hdr h3 { font-size: .95rem; font-weight: 700; flex: 1; }
.card-body { padding: 1.25rem; }
.card-foot { padding: .85rem 1.25rem; border-top: 1px solid var(--border); background: #fafbfd; display: flex; gap: .6rem; flex-wrap: wrap; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.1rem; }
.cards .card { margin-bottom: 0; }

/* ── Buttons — confirmed by Ravi: light blue bg (#D9EDF7) / dark blue text (#2A6B9B),
   sized to their own text rather than a fixed/generous padding ─────────────────── */
.btn { display: inline-flex; align-items: center; gap: .35rem; width: fit-content; padding: .3rem .6rem; border-radius: var(--radius); font-size: var(--btn-text-size); font-weight: 700; text-decoration: none; border: 1px solid transparent; cursor: pointer; font-family: var(--font); white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.btn-primary:hover { background: #c3e2f2; color: var(--btn-fg); }
.btn-outline { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-fg); }
.btn-outline:hover { background: #c3e2f2; }
.btn-sm { padding: .2rem .5rem; font-size: var(--btn-text-size); }

/* ── Singpass button ────────────────────────────────────────── */
.btn-singpass { display: flex; align-items: center; justify-content: center; gap: .65rem; width: 100%; padding: .85rem 1rem; background: #e62438; color: #fff; border-radius: var(--radius); font-size: .975rem; font-weight: 700; text-decoration: none; border: none; cursor: pointer; font-family: var(--font); transition: background .15s; margin: 1rem 0; }
.btn-singpass:hover { background: #c01d2e; color: #fff; text-decoration: none; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.fg { display: flex; flex-direction: column; gap: .3rem; }
.fg.full { grid-column: 1 / -1; }
.fg label { font-size: .82rem; font-weight: 700; color: var(--grey); text-transform: uppercase; letter-spacing: .03em; }
.fc { padding: .5rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: .9rem; font-family: var(--font); color: var(--dark); background: var(--white); width: 100%; }
.fc:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(232,55,43,.1); }
.fc.invalid { border-color: var(--red-dk); }
textarea.fc { resize: vertical; min-height: 80px; }
.ferr { font-size: .78rem; color: var(--red-dk); }
.kld-coordinator-field label {
    white-space: nowrap;
}
/* ── Validation ─────────────────────────────────────────────── */
.field-error { display: block; color: var(--red-dk); font-size: .78rem; margin-top: .2rem; }
.input-validation-error { border-color: var(--red-dk) !important; }
.field-validation-error { display: block; color: var(--red-dk); font-size: .78rem; margin-top: .2rem; }
.field-validation-valid { display: none; }
/* ── Definition list ────────────────────────────────────────── */
.dl { display: flex; flex-direction: column; gap: .5rem; font-size: .9rem; }
.dl dt { color: var(--grey); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin-top: .35rem; }
.dl dd { color: var(--dark); }
.dl.dl-grid { display: grid; grid-template-columns: 160px 1fr; gap: .4rem .75rem; }
.dl.dl-grid dt { margin-top: 0; align-self: center; }

/* ── Badge ──────────────────────────────────────────────────── */
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 20px; font-size: .75rem; font-weight: 700; background: #edf7f0; color: #1a7a40; }
.badge-sp { background: #e8f0fb; color: #0057a8; }
.badge-crm { background: #fef3e2; color: #b35900; }
.editable-tag { font-size: .75rem; color: var(--red); background: #fdf1f0; padding: .15rem .5rem; border-radius: 20px; font-weight: 600; }

/* ── Table ──────────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: var(--table-content-size); background: var(--table-content-bg); }
.tbl thead th { background: var(--table-header-bg); color: var(--table-header-fg); font-size: 1rem; font-weight: 700; letter-spacing: .02em; padding: .7rem 1rem; text-align: left; }
.tbl tbody td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: var(--table-content-size); background: var(--table-content-bg); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: #fafbff; }
.tbl tbody tr.row-muted td { color: var(--grey); }
.tbl-caption { font-size: var(--table-header-size); font-weight: 700; text-align: center; margin-bottom: .75rem; color: var(--dark); }
.tbl .reference-no-col {
    min-width: 160px;
    white-space: nowrap;
}
.tbl .auto-width-column {
    width: 1%;
    white-space: nowrap;
}

/* ── Appointments ───────────────────────────────────────────── */
.appt-list { display: flex; flex-direction: column; gap: .6rem; }
.appt-item { display: flex; align-items: center; gap: .85rem; padding: .65rem; border: 1px solid var(--border); border-radius: var(--radius); }
.appt-cal { display: flex; flex-direction: column; align-items: center; background: var(--red); color: #fff; border-radius: var(--radius); padding: .3rem .55rem; min-width: 40px; font-size: .8rem; font-weight: 700; line-height: 1.2; }

/* ── Upload dropzone ────────────────────────────────────────── */
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 2.25rem 1.5rem; text-align: center; position: relative; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag-over { border-color: var(--red); background: #fdf1f0; }
.file-hidden { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dz-label { display: flex; flex-direction: column; align-items: center; gap: .4rem; cursor: pointer; color: var(--grey); font-size: .9rem; }
.dz-icon { font-size: 2rem; color: var(--red); }
.dz-preview { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: .5rem; }
.btn-rm { background: none; border: 1px solid var(--border); border-radius: 50%; width: 24px; height: 24px; cursor: pointer; font-size: 1rem; line-height: 1; display: flex; align-items: center; justify-content: center; color: var(--grey); }
.btn-rm:hover { border-color: var(--red); color: var(--red); }

/* ── Login page ─────────────────────────────────────────────── */
.login-bg { background: var(--dark); display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.login-wrap { width: 100%; max-width: 420px; }
.login-card { background: var(--white); border-radius: 10px; overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,.25); }
.login-top { background: var(--red); color: #fff; padding: 2rem 2rem 1.5rem; text-align: center; }
.login-top h1 { font-size: 1.35rem; font-weight: 700; margin: .75rem 0 .25rem; }
.login-top p { font-size: .875rem; opacity: .9; }
.login-logo { height: 48px; filter: brightness(0) invert(1); }
.login-body { padding: 1.75rem; }
.login-desc { font-size: .875rem; color: var(--grey); margin-bottom: .25rem; line-height: 1.6; }
.login-steps { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }
.step { display: flex; align-items: center; gap: .65rem; font-size: .85rem; color: var(--grey); }
.step-n { width: 22px; height: 22px; border-radius: 50%; background: var(--red); color: #fff; font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.login-foot { padding: .9rem 1.75rem; border-top: 1px solid var(--border); text-align: center; font-size: .82rem; color: var(--grey); }

/* ── Utility ────────────────────────────────────────────────── */
.hidden { display: none !important; }
.linklike { background: none; border: none; padding: 0; cursor: pointer; font-family: var(--font); text-decoration: underline; }

/* ── Modal popup (e.g. Singpass MyInfo preview) ─────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
.modal-overlay.open { display: flex; }
.modal-box { background: var(--white); border-radius: var(--radius); max-width: 340px; width: 100%; padding: 1.5rem; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.25); position: relative; }
.modal-close { position: absolute; top: .5rem; right: .75rem; background: none; border: none; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--grey); padding: .25rem; }
.modal-close:hover { color: var(--red); }

/* ── Landing tiles (Page 8 / Page 9) ───────────────────────────── */
.tile-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; max-width: 700px; margin: 2rem auto 0; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .65rem;
  text-align: center; flex: 0 0 300px; padding: 2rem 1.25rem;
  border: 1px solid var(--border); border-radius: 14px; background: var(--white); color: var(--dark);
  font-size: 1.1rem; font-weight: 700; text-decoration: none;
  box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s, border-color .15s;
}
.tile-description {
    display: block;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--grey);
}
.tile:hover { box-shadow: 0 8px 20px rgba(0,0,0,.1); transform: translateY(-3px); border-color: var(--red); color: var(--dark); text-decoration: none; }
.tile-icon {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: #fdeee9; color: var(--red);
}
.tile-icon svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── Programme type selector (Page 2 / Page 4) ─────────────────── */
.type-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; margin: 2rem 0; }
.type-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; width: 220px; min-height: 170px; padding: 1.25rem 1rem; border: 2px solid #f0a500; border-radius: var(--radius); background: var(--white); font-size: 1.05rem; font-weight: 800; letter-spacing: .01em; line-height: 1.3; text-align: center; color: var(--dark); cursor: pointer; transition: box-shadow .15s, background .15s; }
.type-card:hover { box-shadow: var(--shadow); }
.type-card input { position: absolute; opacity: 0; }
.type-card.selected { background: #fff6e6; border-color: var(--red); color: var(--red); }
.type-card .tile-icon { background: #fdeee9; color: var(--red); }
.type-card.selected .tile-icon { background: var(--red); color: var(--white); }

/* ── Wizard (Page 3 / 6 — Applicant Details / Application Details / Family Info / Additional Documents) ── */
.wizard { display: flex; gap: 1.5rem; align-items: flex-start; }
.wizard-nav { display: flex; flex-direction: column; gap: .6rem; width: 200px; flex-shrink: 0; }
.wizard-nav a { display: block; padding: .9rem 1rem; border-radius: var(--radius); background: #fafbfc; color: var(--grey); font-weight: 700; text-align: center; text-decoration: none; font-size: .95rem; border: 1px solid var(--border); transition: background .15s, color .15s; }
.wizard-nav a:hover { background: #eef0f3; color: var(--dark); text-decoration: none; }
.wizard-nav a.completed { background: #1a7a40; color: var(--white); border-color: #1a7a40; }
.wizard-nav a.completed::before { content: "✓ "; }
.wizard-nav a.completed:hover { background: #156534; color: var(--white); }
/* PLACEHOLDER — active step recolored to standard btn-bg/btn-fg per Ravi's request (2026-08-18).
   Ravi to revisit: this currently makes "active" look identical to a plain button; consider
   keeping a distinct border/shadow so it's still visually distinct from "upcoming" tabs. */
.wizard-nav a.active { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-fg); box-shadow: inset 0 0 0 2px var(--btn-fg); }
.wizard-nav a.active:hover { background: #c3e2f2; color: var(--btn-fg); }
.wizard-body { flex: 1; min-width: 0; }

/* ── Login QR panel (Page 1) ────────────────────────────────────── */
.singpass-panel { width: 100%; max-width: 300px; margin-left: auto; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; text-align: center; }
.singpass-tabs { display: flex; gap: 1rem; justify-content: center; margin-bottom: 1rem; font-size: .85rem; font-weight: 700; }
.singpass-tabs .active { color: var(--red); border-bottom: 2px solid var(--red); padding-bottom: .3rem; }
.singpass-tabs .inactive { color: var(--grey); padding-bottom: .3rem; }
.qr-box { border: 2px solid var(--red); border-radius: var(--radius); padding: .75rem; margin: .75rem auto; max-width: 220px; }
.login-hero { display: flex; align-items: center; gap: 3rem; flex-wrap: wrap; padding: 3rem 0; }
.login-hero-left { display: flex; align-items: center; gap: 1rem; flex: 1; min-width: 260px; }
.scam-banner { background: #f5f6f8; border-bottom: 1px solid var(--border); padding: .75rem 1.25rem; font-size: .85rem; }
.scam-banner strong { display: block; margin-bottom: .2rem; }

/* ── Consent block (Page 3 declaration) ─────────────────────────── */
.consent-box { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; background: #fafbfd; font-size: .85rem; line-height: 1.6; margin-bottom: 1rem; }
.consent-box p { margin-bottom: .6rem; }


/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    display: none; flex-direction: column; align-items: stretch; width: 100%;
    flex-basis: 100%; gap: 0; margin-top: .5rem; padding-bottom: .75rem;
  }
  .nav-menu.open { display: flex; }
  .nav-links { flex-direction: column; gap: 0; width: 100%; }
  .nav-links a { display: block; padding: .65rem .5rem; border-radius: 0; border-bottom: 1px solid rgba(0,0,0,.06); }
  .nav-end { margin-left: 0; margin-top: .5rem; flex-direction: column; align-items: flex-start; gap: .6rem; width: 100%; }
  .nav-end form { width: 100%; }
  .btn-logout { width: 100%; }
  .cards { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .dl.dl-grid { grid-template-columns: 1fr; }
  .page-hdr { flex-direction: column; align-items: flex-start; }
  .card-foot { flex-direction: column; }
  .btn { justify-content: center; }
  .tbl thead th, .tbl tbody td { padding: .5rem .6rem; font-size: .82rem; }
  .card-body[style*="overflow-x"] { -webkit-overflow-scrolling: touch; }
  .appt-item { flex-wrap: wrap; }
  .wizard { flex-direction: column; }
  .wizard-nav { flex-direction: row; overflow-x: auto; width: 100%; }
  .wizard-nav a { white-space: nowrap; }
  .tile { flex-basis: 100%; }
  .type-card { width: 100%; }
  .login-hero { flex-direction: column; }
  .singpass-panel { margin: 0 auto; }
  .login-topbar { flex-direction: column; text-align: center; gap: .35rem; padding: .75rem 0; min-height: 0; }
  .login-topbar h1 { font-size: 1.05rem; white-space: normal; }
  .login-topbar .contact-mirror { display: none; } /* only needed to balance centering on wide screens */
}
/* ── Site-wide page-loading overlay (shown while saving/submitting/navigating) ── */
.page-freeze-overlay { position: fixed; inset: 0; background: rgba(255,255,255,.6); backdrop-filter: blur(1px); z-index: 1300; display: flex; align-items: center; justify-content: center; }
.page-freeze-overlay.hidden { display: none; }
.page-freeze-box { background: var(--white); border-radius: var(--radius); padding: 1.5rem 2rem; box-shadow: 0 10px 40px rgba(0,0,0,.25); text-align: center; min-width: 260px; }
.page-freeze-spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--red); border-radius: 50%; margin: 0 auto .75rem; animation: page-freeze-spin .8s linear infinite; }
.page-freeze-spinner.hidden { display: none; }
.page-freeze-error-icon { color: var(--red); margin: 0 auto .5rem; width: 40px; height: 40px; }
.page-freeze-error-icon svg { width: 40px; height: 40px; }
.page-freeze-error-icon.hidden { display: none; }
.page-freeze-msg { margin: 0; font-weight: 600; color: var(--dark); font-size: .9rem; }
.page-freeze-box .upload-progress-wrap { display: flex; align-items: center; gap: .6rem; margin-top: 1rem; min-width: 220px; }
.page-freeze-box .upload-progress-wrap.hidden { display: none; }
.page-freeze-box .upload-progress-bar { flex: 1; height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.page-freeze-box .upload-progress-fill { height: 100%; width: 0%; background: var(--red); transition: width .15s ease; }
.page-freeze-box .upload-progress-pct { font-size: .78rem; color: var(--grey); min-width: 34px; text-align: right; }
@keyframes page-freeze-spin { to { transform: rotate(360deg); } }

/* ── Application wizard (New.cshtml) — extracted from inline styles ────────── */
.required-mark { color: var(--red); }
.checkbox-label { display: flex; align-items: center; gap: .5rem; text-transform: none; }
.checkbox-label-top { display: flex; align-items: flex-start; gap: .5rem; }
.form-section { margin-bottom: 1.5rem; }
.form-section-hdr { font-size: .85rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #000; border-bottom: 2px solid #000; padding-bottom: .4rem; margin-bottom: 1rem; }
.form-section-divider { border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1rem; }
.btn-group-right { display: flex; gap: .6rem; margin-left: auto; }
.btn-group-center { display: flex; gap: .6rem; justify-content: center; }
.modal-title-spacing { margin: .5rem 0 .25rem; font-size: 1.05rem; }
.delete-modal-filename { font-weight: 700; color: var(--red); word-break: break-all; margin-bottom: 1rem; }
.qr-box-inline { margin: 1rem auto; max-width: 170px; }
.singpass-verify-caption { font-weight: 700; font-size: .9rem; margin-top: .5rem; }
.center-block { display: block; margin: 0 auto; }

/* Small spacing/utility helpers */
.mt-1 { margin-top: 1rem; }
.mt-sm { margin-top: .3rem; }
.mb-sm { margin-bottom: .4rem; }
.ml-1 { margin-left: 1rem; }
.text-lg { font-size: 1.4rem; }
.text-xs { font-size: .78rem; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }

/* ── Application New/Edit page (New.cshtml) — moved from an inline <style> block ── */
.field-error {
    display: block;
    color: var(--red, #c0392b);
    font-size: 0.78rem;
    margin-top: 0.2rem;
}

/* ── Additional Documents: upload block ─────────────────────────── */
.doc-upload-block { border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; margin-bottom: .9rem; }
.doc-upload-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

.doc-info {
    flex: 0 0 320px;
    min-width: 260px;
}

.doc-upload-controls {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
}
.doc-label { width: 260px; max-width: 100%; font-size: .9rem; font-weight: 600; }
.doc-upload-row .uploadFile { flex: 1 1 220px; max-width: 280px; }
.doc-description {
    margin-top: 6px;
    margin-left: 20px;
    padding-left: 20px;
}
.doc-uploaded-tick {
    color: #198754;
    font-size: 1.1rem;
    font-weight: 700;
    margin-left: 6px;
}

.doc-uploaded-tick[hidden] {
    display: none;
    }

.doc-description-item {
    margin-bottom: 4px;
    padding-left: 6px;
}

/* File grid */
.doc-hdr { font-weight: 700; font-size: .95rem; margin: 1rem 0 .5rem; color: var(--dark); }
.doc-file-grid { display: flex; flex-direction: column; gap: .5rem; margin-top: .25rem; }
.doc-file-row { display: flex; align-items: center; gap: .65rem; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: var(--radius); background: #fafbfd; }
.doc-file-thumb { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 4px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--white); border: 1px solid var(--border); font-size: 1.1rem; }
.doc-file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-file-name { flex: 0 1 auto; max-width: 60%; font-size: .87rem; color: var(--dark); text-decoration: none; word-break: break-all; cursor: pointer; }
.doc-file-spacer { flex: 1; }
.doc-file-name:hover { text-decoration: underline; }
.doc-file-size { flex: 0 0 auto; font-size: .78rem; }
.doc-file-delete { flex: 0 0 auto; background: #fff; border: 1px solid #f3d6d6; border-radius: 50%; width: 40px; height: 40px; cursor: pointer; color: var(--red); display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.doc-file-delete svg { width: 20px; height: 20px; }
.doc-file-delete:hover { background: #fdeaea; border-color: var(--red); }
.doc-empty-msg { margin: 0; }

/* Hover preview popup */
.doc-preview-popup { position: fixed; z-index: 1200; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(0,0,0,.22); padding: .6rem; max-width: 220px; pointer-events: none; text-align: center; }
.doc-preview-popup.hidden { display: none; }
.doc-preview-popup img { max-width: 200px; max-height: 200px; display: block; margin: 0 auto; border-radius: 4px; }
.doc-preview-icon { font-size: 2.5rem; line-height: 1; }
.doc-preview-name { font-size: .8rem; font-weight: 600; margin-top: .3rem; word-break: break-all; }
.doc-preview-hint { margin-top: .15rem; }

/* Note: the page-loading overlay (.page-freeze-*, .upload-progress-*) now lives in
   portal.css and _Layout.cshtml — shared site-wide — rather than duplicated here. */

/* Delete confirmation modal */
.delete-modal-icon { width: 56px; height: 56px; border-radius: 50%; background: #fde7e9; color: var(--red); display: flex; align-items: center; justify-content: center; margin: 0 auto; }
.delete-modal-icon svg { width: 26px; height: 26px; }

/* Consent page — rendered from the Word template */

.consent-box .consent-list {
    margin: 0 0 0.6rem 1.25rem;
    padding: 0;
}

    .consent-box .consent-list li {
        margin-bottom: 0.3rem;
    }

.consent-box p.consent-list-item,
.consent-box p.consent-sub-list-item {
    margin: 0;
}

.consent-list-item,
.consent-sub-list-item {
    display: flex;
    align-items: flex-start;
}

.consent-list-number {
    flex: 0 0 24px;
}

.consent-sub-list-item {
    padding-left: 24px;
}
