@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* ═══════════════════════════════════════════════════════════
   REGISTER PAGE — styled to match the login page
   Sections:
     1. Tokens            6. Cards + fields
     2. Base              7. Step 0 (consent + uploads)
     3. Page shell        8. Reminders, certification, footer
     4. Ticket (left)     9. Buttons
     5. Form panel (right) 10. Dropdowns + document rows
                          11. Modals
                          12. Responsive
═══════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════
   1. TOKENS
═══════════════════════════════════════ */
:root {
    --ink: #0a1730;
    --ink-soft: #101f42;
    --page-bg: #172c5f;
    --cream: #faf7f0;
    --cream-dim: #f3eee2;

    --orange: #f26a1b;
    --orange-hover: #ff7a2b;
    --amber: #ffb703;
    --blue: #1554b3;
    --green: #1c8a4f;
    --danger: #e53935;
    --danger-dark: #b8302d;

    --text-dark: #1a2033;
    --slate: #6b7690;
    --border: rgba(26, 32, 51, 0.09);
    --border-strong: rgba(26, 32, 51, 0.16);

    --ticket-ink: #14285a;
    --ticket-muted: #5d6b8a;
    --stamp-blue: #2c4f9e;

    --font-body: 'Inter', sans-serif;
    --font-display: 'Space Grotesk', sans-serif;
    --font-mono: 'DM Mono', monospace;
}


/* ═══════════════════════════════════════
   2. BASE
═══════════════════════════════════════ */
* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    background: var(--page-bg);
    color: var(--text-dark);
}


/* ═══════════════════════════════════════
   3. PAGE SHELL — ticket left, form right
═══════════════════════════════════════ */
.reg-shell {
    display: grid;
    grid-template-columns: minmax(300px, 380px) 1fr;
    min-height: 100vh;
}


/* ═══════════════════════════════════════
   4. TICKET (left panel) — the whole panel is the ticket
═══════════════════════════════════════ */
.reg-aside {
    position: sticky;
    top: 0;
    z-index: 2;
    height: 100vh;
    color: var(--ticket-ink);
}

.aside-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ticket {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    filter: drop-shadow(8px 0 30px rgba(0, 0, 0, 0.4));
}

/* ── stub (upper, smaller) — notches cut from the bottom corners ── */
.ticket-stub {
    --stub-pad: 32px;
    flex: none;
    position: relative;
    padding: 30px var(--stub-pad) 28px;
    background:
        radial-gradient(rgba(23, 42, 99, 0.07) 1px, transparent 1px) 0 0 / 16px 16px,
        var(--cream-dim);
    -webkit-mask:
        radial-gradient(circle 13px at 0 100%, transparent 98%, #000 100%),
        radial-gradient(circle 13px at 100% 100%, transparent 98%, #000 100%);
    -webkit-mask-composite: source-in;
    mask:
        radial-gradient(circle 13px at 0 100%, transparent 98%, #000 100%),
        radial-gradient(circle 13px at 100% 100%, transparent 98%, #000 100%);
    mask-composite: intersect;
}

.stub-top {
    position: relative;
    z-index: 1;
    min-height: 120px;
}

.stub-pax {
    position: relative;
    z-index: 1;
    max-width: calc(100% - 160px);
    padding-top: 8px;
}

.stub-label {
    display: block;
    margin-bottom: 4px;
    font-family: var(--font-body);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ticket-muted);
}

.stub-name {
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(23, 42, 99, 0.22);
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--ticket-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* postmark stamp (same construction as the login ticket) */
.stamp-svg {
    position: absolute;
    top: -6px;
    right: -8px;
    z-index: 1;
    width: 136px;
    height: 136px;
    transform: rotate(-8deg);
    opacity: 0.92;
    mix-blend-mode: multiply;
}

.st-ring-thick { fill: none; stroke: var(--stamp-blue); stroke-width: 2.6; }
.st-ring-thin  { fill: none; stroke: var(--stamp-blue); stroke-width: 1; }

.st-text-top,
.st-text-bot {
    fill: var(--stamp-blue);
    font-family: var(--font-display);
    font-weight: 700;
}

.st-text-top { font-size: 14px; letter-spacing: 2.5px; }
.st-text-bot { font-size: 7.5px; letter-spacing: 1.2px; }

/* wavy cancellation lines running off the ticket's edge */
.stamp-waves {
    position: absolute;
    top: 24px;
    right: calc(var(--stub-pad) * -1);
    z-index: 0;
    width: 210px;
    height: 56px;
    fill: none;
    stroke: var(--stamp-blue);
    stroke-width: 1.3;
    opacity: 0.55;
    mix-blend-mode: multiply;
    pointer-events: none;
}

.aside-intro {
    position: relative;
    z-index: 1;
    margin-top: 20px;
}

/* faded plane + dotted trail filling the empty corner of the stub */
.stub-deco {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 64%;
    height: 72%;
    z-index: 0;
    pointer-events: none;
}

.aside-intro h2 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.3px;
    color: var(--ticket-ink);
}

.aside-intro h2 em {
    font-style: normal;
    color: var(--orange);
}

.aside-intro p {
    margin: 0;
    max-width: 280px;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--ticket-muted);
}

/* ── main ticket (lower, larger) — notches cut from the top corners ── */
.ticket-main {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 30px 32px 24px;
    overflow-y: auto;
    background:
        radial-gradient(rgba(23, 42, 99, 0.07) 1px, transparent 1px) 0 0 / 16px 16px,
        var(--cream);
    -webkit-mask:
        radial-gradient(circle 13px at 0 0, transparent 98%, #000 100%),
        radial-gradient(circle 13px at 100% 0, transparent 98%, #000 100%);
    -webkit-mask-composite: source-in;
    mask:
        radial-gradient(circle 13px at 0 0, transparent 98%, #000 100%),
        radial-gradient(circle 13px at 100% 0, transparent 98%, #000 100%);
    mask-composite: intersect;
}

/* the dashed tear line */
.ticket-main::before {
    content: "";
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    border-top: 2px dashed rgba(23, 42, 99, 0.22);
}

/* background route lines + planes behind the main ticket's content */
.ticket-deco {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* everything else in the main ticket sits above the decoration */
.ticket-main > :not(.ticket-deco) {
    position: relative;
    z-index: 1;
}

.pass-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.pass-label { color: var(--orange); }
.pass-access { color: var(--ticket-muted); }

/* ── vertical step tracker (centered in the lower ticket) ──
   register.js showStep() toggles .active / .completed on each .step.
   The step numbers and the "Step N — / Active — / Done —" prefixes
   are generated by CSS counters, so the HTML only holds names + hints. */
.step-tracker {
    --dot: 48px;
    --link: 12px;               /* minimum length of the dashed line between dots */
    margin: auto;
    display: flex;
    flex-direction: column;
    counter-reset: step -1;     /* first step is numbered 0 */
}

.step {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 16px;
    counter-increment: step;
}

/* rail = the dot, plus the dashed line running down to the next dot */
.step-rail {
    flex: none;
    width: var(--dot);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-rail::after {
    content: "";
    flex: 1;
    min-height: var(--link);
    margin: 8px 0 6px;
    border-left: 2px dashed rgba(20, 40, 90, 0.4);
    transition: border-color 0.25s ease;
}

.step:last-child .step-rail::after { display: none; }

.step.completed .step-rail::after { border-left-color: var(--ticket-ink); }

.step-dot {
    flex: none;
    width: var(--dot);
    height: var(--dot);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--dot) * 0.38);
    color: var(--ticket-ink);
    background: var(--cream);
    border: 2px solid var(--ticket-ink);
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

.step.active .step-dot {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
    box-shadow: 0 0 0 7px rgba(242, 106, 27, 0.22);
}

.step.completed .step-dot {
    background: var(--ticket-ink);
    color: #fff;
}

/* completed: the icon is swapped for a check mark */
.step.completed .step-dot i { display: none; }

.step.completed .step-dot::after {
    content: "\2713";
    font-weight: 700;
}

.step-text {
    align-self: flex-start;
    min-width: 0;
    min-height: var(--dot);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

.step-label {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--ticket-ink);
}

.step-label::before { content: counter(step) " "; }

.step-desc {
    font-size: 12px;
    line-height: 1.35;
    color: var(--ticket-muted);
}

.step-desc::before { content: "Step " counter(step) " \2014  "; }

.step.active .step-desc { color: var(--ticket-ink); }

.step.active .step-desc::before {
    content: "Active \2014  ";
    font-weight: 700;
    color: var(--ticket-ink);
}

.step.completed .step-desc::before {
    content: "Done \2014  ";
    font-weight: 700;
    color: var(--green);
}

/* barcode strip, same as the login ticket's stub */
.ticket-barcode {
    height: 30px;
    margin-top: 14px;
    background: repeating-linear-gradient(
        90deg,
        var(--ticket-ink) 0 2px, transparent 2px 4px,
        var(--ticket-ink) 4px 5px, transparent 5px 8px,
        var(--ticket-ink) 8px 11px, transparent 11px 13px,
        var(--ticket-ink) 13px 14px, transparent 14px 17px
    );
    opacity: 0.85;
}

.aside-foot {
    margin: 0;
    padding-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    font-size: 11.5px;
    color: var(--ticket-muted);
}

.aside-foot i { color: var(--orange); }


/* ═══════════════════════════════════════
   5. FORM PANEL (right)
═══════════════════════════════════════ */
.reg-main {
    position: relative;
    min-width: 0;
    background:
        radial-gradient(circle at 50% 0%, rgba(60, 100, 190, 0.25), transparent 55%),
        var(--page-bg);
}

/* clouds / trails / planes, same artwork as the login page */
.reg-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.reg-main-inner {
    position: relative;
    z-index: 1;
    max-width: 900px;
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: 44px clamp(20px, 4vw, 56px) 28px;
}

.reg-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.reg-header h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.8px;
    color: #fff;
}

.reg-subtitle {
    margin: 6px 0 0;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
}

.step-pill {
    flex: none;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--cream);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ticket-ink);
    white-space: nowrap;
}

.back-btn {
    margin-bottom: 10px;
    padding: 0;
    align-items: center;
    gap: 6px;
    border: none;
    outline: none;
    background: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 600;
    color: #ff9a4d;
}

.back-btn:hover { text-decoration: underline; }

.progress-track {
    height: 5px;
    margin: 22px 0 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    overflow: hidden;
}

/* width is set by showStep() in register.js */
.progress-fill {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--orange), var(--amber));
    transition: width 0.35s ease;
}

#multiStepForm {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-step { display: none; }

.form-step.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    animation: stepIn 0.25s ease-out;
}

@keyframes stepIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


/* ═══════════════════════════════════════
   6. CARDS + FIELDS
═══════════════════════════════════════ */
fieldset {
    margin: 0 0 18px;
    padding: 26px 28px;
    min-width: 0;
    border: 0;
    border-radius: 22px;
    background: var(--cream);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

/* float technique so the legend sits inside the card padding */
legend {
    float: left;
    width: 100%;
    padding: 0;
    margin: 0 0 18px;
}

legend + * { clear: both; }

.card-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--orange);
}

.card-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--orange);
    background: rgba(242, 106, 27, 0.12);
}

/* rows / columns */
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 14px;
    align-items: start;      /* an error under one field doesn't stretch the others */
    margin-bottom: 16px;
}

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

.form-row.cols-2 { grid-template-columns: repeat(2, 1fr); }
.form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-row.grid-4 { grid-template-columns: repeat(4, 1fr); }

.field-group {
    display: flex;
    flex-direction: column;
    min-width: 0;            /* lets error text wrap instead of widening the column */
}

.field-group .field-error-msg { line-height: 1.3; }

label {
    display: block;
    margin: 0 0 6px;
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-dark);
}

.required-asterisk {
    color: var(--danger);
    margin-left: 2px;
}

input,
select,
textarea {
    width: 100%;
    margin: 0;
    padding: 13px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    outline: none;
    font-family: var(--font-body);
    font-size: 15px;
    background: #fff;
    color: var(--text-dark);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea { resize: vertical; }

input:focus,
select:focus,
textarea:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(242, 106, 27, 0.14);
}

input::placeholder,
textarea::placeholder { color: #b8b0a0; }

.input-error { border-color: var(--danger); }

input[type="file"] {
    cursor: pointer;
    border-style: dashed;
    font-size: 13px;
    padding: 10px 12px;
}

input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 6px 12px;
    border: none;
    border-radius: 7px;
    background: rgba(242, 106, 27, 0.12);
    color: var(--orange);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
}

input[type="file"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* contact number with a fixed +63 prefix */
.phone-input {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.phone-input:focus-within {
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(242, 106, 27, 0.14);
}

.phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--slate);
    background: #efeadf;
    border-right: 1px solid var(--border-strong);
    border-radius: 11px 0 0 11px;
    user-select: none;
}

.phone-input input {
    flex: 1;
    min-width: 0;
    border: none;
    border-radius: 0 11px 11px 0;
    box-shadow: none;
    background: transparent;
}

.phone-input input:focus {
    border: none;
    box-shadow: none;
}


/* ═══════════════════════════════════════
   7. STEP 0 — CONSENT → UPLOADS
═══════════════════════════════════════ */
.privacy-consent {
    border-left: 4px solid var(--amber);
    transition: border-color 0.25s ease;
}

.privacy-consent:has(#privacyConsent:checked) { border-left-color: var(--green); }

.privacy-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 14px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.6;
    color: var(--text-dark);
    cursor: pointer;
}

.privacy-check input[type="checkbox"] {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--orange);
    cursor: pointer;
}

.privacy-check a {
    color: var(--orange);
    font-weight: 600;
    text-decoration: underline;
}

.privacy-check a:hover { color: var(--text-dark); }

.consent-error {
    margin: -4px 0 12px;
    font-size: 12.5px;
    color: var(--danger);
}

.upload-lock-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 9px 12px;
    border-radius: 8px;
    background: rgba(255, 183, 3, 0.16);
    font-size: 12px;
    color: #7a5600;
}

.consent-lock-note {
    display: block;
    margin: 0;
    padding: 9px 12px;
    border-radius: 8px;
    background: rgba(34, 150, 88, 0.12);
    font-size: 12px;
    color: var(--green);
}

.privacy-placeholder {
    padding: 0 3px;
    border-radius: 3px;
    background: rgba(255, 183, 3, 0.25);
}

/* uploads card: dimmed until consent is ticked */
.req-fieldset {
    opacity: 0.55;
    border-left: 4px solid rgba(26, 32, 51, 0.2);
    transition: opacity 0.25s ease, border-color 0.25s ease;
}

.privacy-consent:has(#privacyConsent:checked) ~ .req-fieldset {
    opacity: 1;
    border-left-color: var(--orange);
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: start;
}

.upload-col { min-width: 0; }

.upload-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 22px 14px 18px;
    text-align: center;
    border: 1.5px dashed rgba(26, 32, 51, 0.22);
    border-radius: 16px;
    background: var(--cream-dim);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.upload-card:hover:not(:has(input:disabled)) {
    border-color: var(--orange);
    background: #fdf1e8;
}

.upload-card:has(input:disabled) { cursor: not-allowed; }

.upload-card:focus-within {
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(242, 106, 27, 0.14);
}

.upload-card.has-file {
    border-style: solid;
    border-color: var(--green);
    background: rgba(34, 150, 88, 0.08);
}

.upload-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--orange);
    background: rgba(242, 106, 27, 0.12);
}

.upload-title {
    margin-top: 4px;
    font-family: var(--font-body);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-dark);
}

.upload-hint {
    font-size: 12px;
    line-height: 1.4;
    color: var(--slate);
}

.upload-size {
    margin-top: 2px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(242, 106, 27, 0.1);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 500;
    color: var(--orange);
}

.upload-picked {
    display: none;
    max-width: 100%;
    margin-top: 2px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--green);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-card.has-file .upload-picked { display: block; }

/* the real input covers the whole card so a click anywhere opens the picker */
.upload-card input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    opacity: 0;
    cursor: pointer;
}

.upload-card input[type="file"]:disabled { cursor: not-allowed; opacity: 0; }
.upload-card input[type="file"]::file-selector-button { cursor: inherit; }

#aiStatus,
.ai-status {
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.5;
    color: var(--blue);
}

/* uploaded employment certificates */
#employmentCertificateList {
    width: 100%;
    margin-top: 10px;
}

.certificate-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 8px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--cream-dim);
    font-family: var(--font-mono);
    font-size: 12.5px;
}

.certificate-file span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remove-certificate {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: 10px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.remove-certificate:hover { background: var(--danger-dark); }


/* ═══════════════════════════════════════
   8. REMINDERS, CERTIFICATION, FOOTER
═══════════════════════════════════════ */
/* sits on the navy page, so light text */
.form-reminder {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 18px;
    padding: 12px 14px;
    border-left: 3px solid var(--amber);
    border-radius: 8px;
    background: rgba(255, 183, 3, 0.14);
    font-size: 12.5px;
    line-height: 1.55;
    color: #ffe3a0;
}

.form-reminder i {
    margin-top: 2px;
    flex-shrink: 0;
    color: var(--amber);
}

/* lives inside a cream card, so dark-on-light */
.form-reminder--info {
    margin: 4px 0 0;
    border-left-color: var(--blue);
    background: rgba(21, 84, 179, 0.08);
    color: #1a3a6b;
}

.form-reminder--info i { color: var(--blue); }

.certification-group {
    margin: 0 0 18px;
    padding: 16px 18px;
    border-left: 4px solid var(--orange);
    border-radius: 14px;
    background: var(--cream);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.certification-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: normal;
    text-transform: none;
    cursor: pointer;
}

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

#certifyError { margin-top: 8px; }

.step-footer {
    margin-top: auto;
    padding-top: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.footer-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}

.login-redirect-global {
    margin: 22px 0 0;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.login-redirect-global a {
    color: #ff9a4d;
    font-weight: 700;
    text-decoration: none;
}

.login-redirect-global a:hover {
    color: #fff;
    text-decoration: underline;
}


/* ═══════════════════════════════════════
   9. BUTTONS
═══════════════════════════════════════ */
.btn {
    padding: 14px 30px;
    border: none;
    border-radius: 12px;
    outline: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:focus-visible,
.btn-add:focus-visible,
.otp-btn:focus-visible { box-shadow: 0 0 0 4px rgba(242, 106, 27, 0.3); }

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

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

.btn-primary:hover {
    background: var(--orange-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(242, 106, 27, 0.3);
}

/* "Continue" on step 0 looks idle until consent is ticked (still clickable so the error shows) */
.reg-shell:has(#privacyConsent:not(:checked)) #step0Next {
    background: #4a5a86;
    color: rgba(255, 255, 255, 0.75);
}

.btn-secondary {
    background: transparent;
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
}

.btn-secondary:hover {
    border-color: var(--orange);
    background: rgba(242, 106, 27, 0.08);
    color: #ff9a4d;
}

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

.btn-submit:hover:not(:disabled) {
    background: var(--orange-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(242, 106, 27, 0.3);
}

.btn-add {
    align-self: flex-start;
    margin-top: 10px;
    padding: 9px 16px;
    border: 1.5px dashed rgba(242, 106, 27, 0.5);
    border-radius: 10px;
    background: rgba(242, 106, 27, 0.07);
    color: var(--orange);
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-add:hover { background: rgba(242, 106, 27, 0.14); }

/* shared look for every remove button (positions + document rows) */
.remove-btn {
    border: none;
    background: var(--danger);
    color: #fff;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.remove-btn:hover { background: var(--danger-dark); }

.position-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 10px;
}

.position-row .remove-btn {
    flex: none;
    padding: 11px 14px;
    border-radius: 10px;
}


/* ═══════════════════════════════════════
   10. DROPDOWNS + SUPPORTING DOCUMENT ROWS
═══════════════════════════════════════ */
.education-combobox,
.doc-type-combobox,
.combobox,
.position-combobox { position: relative; }

.position-row .position-combobox,
.doc-type-combobox {
    flex: 1;
    min-width: 0;
}

.education-dropdown-list,
.doc-type-dropdown-list,
.dropdown-list,
.position-dropdown-list {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d5dbe3;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 50;
}

.education-dropdown-list.open,
.doc-type-dropdown-list.open,
.dropdown-list.open,
.position-dropdown-list.open { display: block; }

.education-group-label {
    padding: 8px 12px 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #7a8699;
}

.education-option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dark);
}

.education-option:hover,
.education-option.highlighted {
    background: #fdf1e8;
    color: var(--orange);
}

.education-option.custom-option {
    font-style: italic;
    color: var(--orange);
}

.education-no-results {
    padding: 10px 12px;
    font-size: 13px;
    color: #7a8699;
}

.doc-row-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.doc-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.doc-row-file-input {
    flex: 1;
    min-width: 0;
}

.doc-row-actions {
    flex: none;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
}

.add-doc-row-btn,
.doc-row-remove-btn {
    flex: none;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.add-doc-row-btn {
    background: var(--orange);
    font-weight: 700;
}

.add-doc-row-btn:hover {
    background: var(--orange-hover);
    transform: translateY(-1px);
}


/* ═══════════════════════════════════════
   11. MODALS
═══════════════════════════════════════ */
@keyframes modalIn {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Shared modal look (blocklist, success, privacy notice) ──
   Navy header + amber mono title, dashed footer, blue button. */
.rm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    justify-content: center;
    align-items: center;
    padding: 16px;
    background: rgba(15, 25, 35, 0.7);
    backdrop-filter: blur(3px);
    z-index: 9999;
}

.rm-card {
    width: 440px;
    max-width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    color: var(--text-dark);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    animation: modalIn 0.25s ease-out;
}

.rm-card--wide { width: 640px; }

.rm-header {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: #101f4a;
}

.rm-title {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #f5b800;
}

.rm-close {
    padding: 4px 6px;
    border: none;
    background: none;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    opacity: 0.85;
    cursor: pointer;
}

.rm-close:hover { opacity: 1; }

.rm-body {
    padding: 30px 28px 26px;
    text-align: center;
    overflow-y: auto;
}

.rm-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.rm-message {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: #333;
}

.rm-message strong { word-break: break-all; }

.rm-footer {
    flex: none;
    display: flex;
    justify-content: flex-end;
    margin: 0 24px;
    padding: 18px 0 20px;
    border-top: 1.5px dashed #d9dce3;
}

.rm-btn {
    padding: 11px 26px;
    border: none;
    border-radius: 10px;
    background: #1c52b8;
    color: #fff;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.rm-btn:hover { background: #164396; }

.rm-btn:focus-visible,
.rm-close:focus-visible { outline: 2px solid #f5b800; outline-offset: 2px; }

/* blocklist extra note */
.blocklist-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 18px;
    padding: 12px 14px;
    border-left: 3px solid var(--danger);
    border-radius: 8px;
    background: rgba(229, 57, 53, 0.08);
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
    color: #7a2417;
}

.blocklist-note .note-icon {
    margin-top: 2px;
    flex-shrink: 0;
    color: var(--danger);
}

/* privacy notice body scrolls between header and footer */
.privacy-modal-body {
    flex: 1;
    min-height: 0;
    padding: 22px 28px 8px;
    overflow-y: auto;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-dark);
}

.privacy-modal-body p { margin: 0 0 12px; }

/* OTP — glass card + blurred backdrop (matches the login "forgot password" panel) */
.otp-modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background:
        radial-gradient(circle at 20% 30%, rgba(60, 110, 200, 0.35), transparent 45%),
        radial-gradient(circle at 85% 75%, rgba(242, 106, 27, 0.18), transparent 45%),
        rgba(8, 16, 38, 0.78);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    z-index: 1000;
}

.otp-modal-box {
    width: 480px;
    max-width: 100%;
    padding: 34px 34px 28px;
    border: 1px solid rgba(150, 180, 255, 0.28);
    border-radius: 28px;
    background: linear-gradient(160deg, rgba(76, 106, 168, 0.5), rgba(38, 48, 92, 0.62));
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    font-family: var(--font-body);
    color: #e6edf3;
    text-align: left;
    animation: modalIn 0.3s ease-out;
}

.otp-eyebrow {
    display: block;
    margin-bottom: 22px; 
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--orange);
}

.otp-title {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: #fff;
}

.otp-subtext {
    margin: 0 0 22px;
    font-size: 14.5px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.72);
}

.otp-email-highlight {
    display: block;           /* own line, below "Enter the 6-digit code we sent to" */
    margin-top: 6px;
    font-family: var(--font-mono);
    font-weight: 500;
    color: #ffd166;
    white-space: nowrap;      /* never split the address */
    overflow-wrap: anywhere;  /* last resort on very narrow screens */
}

.otp-field-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
}

.otp-input-group {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.otp-digit {
    width: 100%;
    height: 58px;
    padding: 0;
    border: 1px solid rgba(150, 180, 255, 0.4);
    border-radius: 14px;
    outline: none;
    background: rgba(70, 90, 140, 0.45);
    text-align: center;
    font-family: var(--font-mono);
    font-size: 24px;
    color: #fff;
    caret-color: var(--orange);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.otp-digit:focus {
    border-color: #6fa0ff;
    background: rgba(80, 105, 165, 0.55);
    box-shadow: 0 0 0 3px rgba(90, 140, 255, 0.3), 0 0 18px rgba(90, 140, 255, 0.35);
}

.otp-digit:disabled { opacity: 0.5; cursor: not-allowed; }

.otp-status {
    min-height: 18px;
    margin: 0 0 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

#otpExpiryTimer { font-family: var(--font-mono); color: rgba(255, 255, 255, 0.75); }

.otp-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
}

.otp-btn {
    width: 100%;
    padding: 0;
    border: none;
    font-family: var(--font-body);
    cursor: pointer;
    transition: opacity 0.15s ease, background 0.15s ease, transform 0.2s ease, box-shadow 0.2s ease, color 0.15s ease;
}

.otp-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* orange pill */
.otp-btn-primary {
    height: 54px;
    margin-bottom: 8px;
    border-radius: 999px;
    background: var(--orange);
    box-shadow: 0 10px 28px rgba(242, 106, 27, 0.4);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.otp-btn-primary:hover:not(:disabled) {
    background: var(--orange-hover);
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(242, 106, 27, 0.5);
}

/* Resend + Cancel read as plain text links, like "Back to login" */
.otp-btn-ghost,
.otp-btn-cancel {
    width: auto;
    padding: 6px 10px;
    background: transparent;
    font-size: 14.5px;
    font-weight: 500;
}

.otp-btn-ghost { color: #fff; }
.otp-btn-ghost:hover:not(:disabled) { color: #ff9a4d; }

.otp-btn-cancel { color: rgba(255, 255, 255, 0.6); }
.otp-btn-cancel:hover { color: #fff; }

@media (max-width: 480px) {
    .otp-modal-box { padding: 26px 20px 22px; border-radius: 22px; }
    .otp-input-group { gap: 6px; }
    .otp-digit { height: 50px; font-size: 20px; }
    .otp-title { font-size: 24px; }
}


/* ═══════════════════════════════════════
   12. RESPONSIVE
═══════════════════════════════════════ */

/* short laptop screens: tighten the ticket so the tracker never gets cut off */
@media (min-width: 901px) and (max-height: 840px) {
    .ticket-stub { --stub-pad: 28px; padding: 20px var(--stub-pad) 18px; }
    .stub-top { min-height: 100px; }
    .stamp-svg { width: 116px; height: 116px; }
    .stamp-waves { top: 20px; width: 190px; }
    .aside-intro { margin-top: 10px; }
    .aside-intro h2 { margin: 0; font-size: 22px; }
    .aside-intro p { display: none; }
    .ticket-main { padding: 20px 28px 14px; }
    .step-tracker { --dot: 42px; --link: 10px; }
    .ticket-barcode { height: 22px; margin-top: 10px; }
}

@media (min-width: 901px) and (max-height: 720px) {
    .stub-top { min-height: 84px; }
    .stamp-svg { width: 96px; height: 96px; }
    .stamp-waves { top: 16px; }
    .step-tracker { --dot: 38px; --link: 6px; }
    .ticket-barcode { display: none; }
}

@media (min-width: 901px) and (max-height: 620px) {
    .step-tracker { --dot: 34px; --link: 4px; }
    .step-desc,
    .pass-top { display: none; }
}

/* form rows */
@media (min-width: 901px) and (max-width: 1180px) {
    .form-row.grid-4 { grid-template-columns: repeat(2, 1fr); row-gap: 16px; }
}

@media (max-width: 900px) and (min-width: 641px) {
    .upload-grid { gap: 12px; }
    .upload-card { padding: 18px 10px 14px; }
}

@media (max-width: 700px) {
    .form-row.grid-4 { grid-template-columns: repeat(2, 1fr); row-gap: 16px; }
}

@media (max-width: 640px) {
    .form-row.cols-2,
    .form-row.cols-3 { grid-template-columns: 1fr; row-gap: 16px; }

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

@media (max-width: 480px) {
    .form-row.grid-4 { grid-template-columns: 1fr; }
}

/* tablet / phone: the ticket collapses to a compact progress strip on top */
@media (max-width: 900px) {
    .reg-shell { grid-template-columns: 1fr; }

    .reg-aside {
        position: relative;
        height: auto;
    }

    .ticket { filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.4)); }

    .ticket-stub,
    .ticket-deco,
    .ticket-barcode,
    .pass-top,
    .aside-foot { display: none; }

    .ticket-main {
        padding: 18px 16px 22px;
        overflow: visible;
        -webkit-mask: none;
        mask: none;
    }

    .ticket-main::before { display: none; }

    .step-tracker {
        --dot: 34px;
        width: 100%;
        margin: 0;
        flex-direction: row;
    }

    .step {
        flex: 1;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        text-align: center;
    }

    /* dots in a row, the dashed line runs sideways behind them */
    .step-rail {
        position: relative;
        width: 100%;
        flex-direction: row;
        justify-content: center;
    }

    .step-rail::after {
        position: absolute;
        left: 50%;
        top: calc(var(--dot) / 2);
        width: 100%;
        height: 0;
        min-height: 0;
        margin: 0;
        border-left: 0;
        border-top: 2px dashed rgba(20, 40, 90, 0.4);
    }

    .step.completed .step-rail::after { border-top-color: var(--ticket-ink); }

    .step-dot {
        position: relative;
        z-index: 1;
    }

    .step-text {
        align-self: auto;
        min-height: 0;
    }

    .step-desc { display: none; }

    .step-label {
        font-size: 9.5px;
        letter-spacing: 0.6px;
    }

    .reg-main-inner {
        min-height: 0;
        padding-top: 28px;
    }
}

@media (max-width: 600px) {
    .reg-header {
        flex-direction: column-reverse;
        align-items: flex-start;
    }

    .reg-header h1 { font-size: 30px; }

    fieldset { padding: 20px; }

    .footer-note { display: none; }

    /* only the active step shows its label, under its dot */
    .step-tracker { margin-bottom: 22px; }
    .step-label { display: none; }

    .step.active .step-label {
        display: block;
        position: absolute;
        top: calc(var(--dot) + 8px);
        left: 50%;
        transform: translateX(-50%);
        white-space: nowrap;
    }

    .doc-row { flex-wrap: wrap; }

    .doc-type-combobox,
    .doc-row-file-input { flex: 1 1 100%; }

    .doc-row-actions {
        width: 100%;
        min-height: 0;
        justify-content: flex-end;
    }
}

@media (prefers-reduced-motion: reduce) {
    .form-step.active,
    .rm-card { animation: none; }

    .progress-fill { transition: none; }
}