/* Stepper application form — registration/form/apply_id + submitted. Script: public/js/registration-form.js */

:root {
    --rf-brand: #17407a;
    --rf-brand-strong: #0e2a52;
    --rf-brand-soft: #eaf1fb;
    --rf-brand-ring: rgba(37, 99, 235, 0.18);
    --rf-accent: #2563eb;
    --rf-bg: #f3f5f9;
    --rf-surface: #ffffff;
    --rf-text: #0f172a;
    --rf-body: #334155;
    --rf-muted: #64748b;
    --rf-faint: #94a3b8;
    --rf-border: #d8e0ea;
    --rf-border-strong: #b8c4d4;
    --rf-danger: #c8321f;
    --rf-danger-soft: #fdf0ee;
    --rf-success: #0a8a52;
    --rf-success-soft: #e8f7ef;
    --rf-warning-soft: #fff7e6;
    --rf-radius: 16px;
    --rf-radius-sm: 10px;
    --rf-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 30px rgba(15, 23, 42, 0.06);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body.rf {
    margin: 0;
    min-height: 100vh;
    background: var(--rf-bg);
    color: var(--rf-body);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.rf [hidden] {
    display: none !important;
}

/* Language: every bilingual pair shows only the half matching <html lang> (default en). */
html[lang="id"] [data-lang="en"],
html:not([lang="id"]) [data-lang="id"] {
    display: none !important;
}

.rf h1,
.rf h2,
.rf h3 {
    color: var(--rf-text);
    margin: 0;
    letter-spacing: -0.01em;
}

.rf svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex: none;
}

/* ------------------------------------------------------------------ header */

.rf-band {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 85% -10%, rgba(96, 165, 250, 0.35), transparent 45%),
        radial-gradient(circle at 0% 120%, rgba(226, 59, 59, 0.18), transparent 40%),
        linear-gradient(135deg, var(--rf-brand-strong), var(--rf-brand) 60%, #1f5aa6);
    z-index: 0;
    overflow: hidden;
}

/* The school's login picture (setting login_image): softened and darkened so a campus
   photo reads as atmosphere and a text-heavy banner does not fight the title. */
.rf-band.has-photo::before {
    content: "";
    position: absolute;
    inset: -12px;
    background: var(--rf-hero) center / cover no-repeat;
    filter: blur(3px) saturate(1.05);
}

.rf-band.has-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, rgba(9, 27, 56, 0.93) 0%, rgba(14, 42, 82, 0.84) 45%, rgba(23, 64, 122, 0.6) 100%);
}

.rf-header {
    position: relative;
    z-index: 1;
    /* The band fills the header, which runs 150px under the cards; it grows with a
       long title or instruction instead of leaving white text on the page colour. */
    padding: 28px 20px 172px;
}

.rf-header-inner {
    position: relative;
    z-index: 1;
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 22px;
    color: #fff;
}

.rf-logo {
    flex: none;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 14px;
    padding: 10px 16px;
    box-shadow: 0 8px 24px rgba(4, 18, 40, 0.25);
}

.rf-logo img {
    display: block;
    height: 52px;
    width: auto;
    max-width: 210px;
    object-fit: contain;
}

.rf-head-text {
    flex: 1;
    min-width: 0;
}

.rf-eyebrow {
    margin: 0 0 4px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.rf-header h1 {
    color: #fff;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
}

.rf-instruction {
    margin: 8px 0 0;
    max-width: 720px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 14px;
}

.rf-head-tools {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.rf-lang {
    display: inline-flex;
    padding: 3px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.rf-lang button {
    padding: 5px 11px;
    border: 0;
    border-radius: 7px;
    background: none;
    color: rgba(255, 255, 255, 0.78);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.rf-lang button[aria-pressed="true"] {
    background: #fff;
    color: var(--rf-brand-strong);
}

.rf-lang button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.rf-help {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    transition: background 0.15s;
}

.rf-help:hover {
    background: rgba(255, 255, 255, 0.2);
}

.rf-help svg {
    width: 24px;
    height: 24px;
    color: #4ade80;
}

.rf-help small {
    display: block;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.72);
}

/* ------------------------------------------------------------------- shell */

.rf-shell {
    position: relative;
    z-index: 1;
    max-width: 1120px;
    margin: -150px auto 0;
    padding: 0 20px 40px;
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

.rf-aside {
    position: sticky;
    top: 20px;
    background: var(--rf-surface);
    border-radius: var(--rf-radius);
    box-shadow: var(--rf-shadow);
    padding: 14px;
}

.rf-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.rf-steps li {
    position: relative;
}

.rf-steps li + li::before {
    content: "";
    position: absolute;
    left: 25px;
    top: -10px;
    height: 20px;
    width: 2px;
    background: var(--rf-border);
}

.rf-steps li.is-done + li::before,
.rf-steps li.is-done::before {
    background: var(--rf-brand);
}

.rf-steps button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: 12px;
    background: none;
    font: inherit;
    text-align: left;
    color: var(--rf-body);
    cursor: pointer;
    transition: background 0.15s;
}

.rf-steps button:hover:not(:disabled) {
    background: #f4f7fb;
}

.rf-steps button:disabled {
    cursor: default;
    opacity: 0.6;
}

.rf-step-num {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 700;
    background: #eef2f7;
    color: var(--rf-muted);
    border: 2px solid transparent;
    position: relative;
    z-index: 1;
}

.rf-step-text {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    font-size: 14px;
    color: var(--rf-text);
    line-height: 1.25;
}

.rf-step-text small {
    font-weight: 500;
    font-size: 12px;
    color: var(--rf-muted);
}

.rf-steps li.is-current button {
    background: var(--rf-brand-soft);
}

.rf-steps li.is-current .rf-step-num {
    background: var(--rf-brand);
    color: #fff;
    box-shadow: 0 0 0 4px var(--rf-brand-ring);
}

.rf-steps li.is-done:not(.is-current) .rf-step-num {
    background: var(--rf-success-soft);
    color: var(--rf-success);
}

.rf-steps li.is-error .rf-step-num {
    background: var(--rf-danger);
    color: #fff;
}

.rf-aside-note {
    margin-top: 12px;
    padding: 14px;
    border-radius: 12px;
    background: #f7f9fc;
    font-size: 13px;
    color: var(--rf-muted);
}

.rf-aside-note strong {
    display: block;
    color: var(--rf-text);
    font-size: 13px;
    margin-bottom: 6px;
}

.rf-aside-note ul {
    margin: 0;
    padding-left: 18px;
}

.rf-aside-note li + li {
    margin-top: 4px;
}

/* --------------------------------------------------------------- progress */

.rf-form {
    min-width: 0;
}

.rf-progress {
    display: none;
}

.rf-progress-track {
    height: 6px;
    border-radius: 99px;
    background: #e5eaf1;
    overflow: hidden;
}

.rf-progress-track span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--rf-brand), var(--rf-accent));
    transition: width 0.3s ease;
}

/* ------------------------------------------------------------------- cards */

.rf-step {
    display: grid;
    gap: 18px;
    animation: rf-in 0.25s ease;
}

@keyframes rf-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

.rf-card {
    background: var(--rf-surface);
    border-radius: var(--rf-radius);
    box-shadow: var(--rf-shadow);
    padding: 28px;
}

.rf-card-head {
    margin-bottom: 22px;
}

.rf-kicker {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--rf-accent);
}

.rf-card-head h2 {
    font-size: 21px;
    line-height: 1.3;
    font-weight: 700;
    outline: none;
}

.rf-card-head p {
    margin: 6px 0 0;
    color: var(--rf-muted);
    font-size: 14px;
}

.rf-subhead {
    margin: 30px 0 16px;
    padding-top: 22px;
    border-top: 1px solid #edf1f6;
}

.rf-subhead-first {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.rf-subhead h3 {
    font-size: 16px;
    font-weight: 700;
}

.rf-subhead h3 small {
    font-weight: 500;
    color: var(--rf-faint);
    margin-left: 4px;
}

.rf-subhead p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--rf-muted);
}

.rf-note {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f5f8fc;
    border: 1px dashed var(--rf-border);
    color: var(--rf-muted);
    font-size: 14px;
}

.rf-alert {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--rf-danger-soft);
    color: var(--rf-danger);
    font-size: 14px;
}

/* ------------------------------------------------------------------ fields */

.rf-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 22px;
}

.rf-field {
    min-width: 0;
}

.rf-wide {
    grid-column: 1 / -1;
}

.rf-label {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--rf-text);
}

.rf-req {
    color: var(--rf-danger);
    font-weight: 700;
}

.rf-opt {
    font-size: 11px;
    font-weight: 600;
    color: var(--rf-faint);
    background: #f1f4f8;
    border-radius: 99px;
    padding: 1px 8px;
}

.rf-hint {
    margin: 2px 0 8px;
    font-size: 12.5px;
    color: var(--rf-muted);
}

.rf-label + .rf-input,
.rf-label + .rf-select,
.rf-label + .rf-chips {
    margin-top: 8px;
}

.rf-input {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    border: 1.5px solid var(--rf-border);
    border-radius: var(--rf-radius-sm);
    background: #fff;
    color: var(--rf-text);
    font: inherit;
    font-size: 16px;
    line-height: 1.4;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

textarea.rf-input {
    resize: vertical;
    min-height: 72px;
}

.rf-input::placeholder {
    color: var(--rf-faint);
}

.rf-input:hover {
    border-color: var(--rf-border-strong);
}

.rf-input:focus {
    outline: none;
    border-color: var(--rf-accent);
    box-shadow: 0 0 0 4px var(--rf-brand-ring);
}

input[type="date"].rf-input {
    min-height: 46px;
}

.rf-select {
    position: relative;
}

.rf-select::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 50%;
    width: 8px;
    height: 8px;
    margin-top: -6px;
    border-right: 2px solid var(--rf-muted);
    border-bottom: 2px solid var(--rf-muted);
    transform: rotate(45deg);
    pointer-events: none;
}

.rf-select select {
    padding-right: 40px;
}

.rf-invalid .rf-input,
.rf-invalid .rf-chip-body {
    border-color: var(--rf-danger);
}

.rf-invalid .rf-input:focus {
    box-shadow: 0 0 0 4px rgba(200, 50, 31, 0.15);
}

.rf-error {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--rf-danger);
}

.rf-error:empty {
    display: none;
}

.rf-suggest {
    margin-top: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--rf-accent);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

/* chips (radio / checkbox options) */

.rf-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rf-chips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
}

.rf-chip {
    position: relative;
    display: inline-flex;
    cursor: pointer;
}

.rf-chip input,
.rf-day input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rf-chip-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 9px 16px;
    border: 1.5px solid var(--rf-border);
    border-radius: 12px;
    background: #fff;
    color: var(--rf-text);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.25;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.rf-chip-body small {
    margin-top: 2px;
    font-weight: 500;
    font-size: 11.5px;
    color: var(--rf-muted);
}

.rf-chips-grid .rf-chip-body {
    padding: 12px 14px;
}

.rf-chip:hover .rf-chip-body {
    border-color: var(--rf-border-strong);
}

.rf-chip input:checked + .rf-chip-body {
    border-color: var(--rf-brand);
    background: var(--rf-brand-soft);
    color: var(--rf-brand-strong);
    box-shadow: inset 0 0 0 1px var(--rf-brand);
}

.rf-chip input:checked + .rf-chip-body small {
    color: var(--rf-brand);
}

.rf-chip input:focus-visible + .rf-chip-body,
.rf-day input:focus-visible + span {
    box-shadow: 0 0 0 4px var(--rf-brand-ring);
}

.rf-muted {
    color: var(--rf-muted);
    font-size: 14px;
}

/* switches & checkboxes */

.rf-switch {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 600;
    color: var(--rf-text);
    font-size: 14px;
}

.rf-switch small,
.rf-check small {
    display: block;
    font-weight: 500;
    font-size: 12px;
    color: var(--rf-muted);
}

.rf-switch input {
    position: absolute;
    opacity: 0;
}

.rf-switch-track {
    flex: none;
    position: relative;
    width: 44px;
    height: 26px;
    border-radius: 99px;
    background: #cbd5e1;
    transition: background 0.15s;
}

.rf-switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
    transition: transform 0.15s;
}

.rf-switch input:checked + .rf-switch-track {
    background: var(--rf-brand);
}

.rf-switch input:checked + .rf-switch-track::after {
    transform: translateX(18px);
}

.rf-switch input:focus-visible + .rf-switch-track {
    box-shadow: 0 0 0 4px var(--rf-brand-ring);
}

.rf-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 10px;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--rf-body);
}

.rf-check input {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--rf-brand);
}

.rf-check-lg {
    margin-top: 6px;
    padding: 16px;
    border-radius: 12px;
    background: #f7f9fc;
    border: 1.5px solid var(--rf-border);
    font-size: 14.5px;
    font-weight: 600;
    color: var(--rf-text);
}

.rf-invalid .rf-check-lg {
    border-color: var(--rf-danger);
}

/* interview days */

.rf-days {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 8px;
    margin: 8px -2px 0;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.rf-day {
    flex: none;
    scroll-snap-align: start;
    cursor: pointer;
    position: relative;
}

.rf-day span {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 68px;
    padding: 8px 0;
    border: 1.5px solid var(--rf-border);
    border-radius: 12px;
    background: #fff;
    line-height: 1.2;
    transition: border-color 0.15s, background 0.15s;
}

.rf-day small {
    font-size: 11.5px;
    color: var(--rf-muted);
    font-weight: 600;
}

.rf-day strong {
    font-size: 20px;
    color: var(--rf-text);
    margin: 2px 0;
}

.rf-day:hover span {
    border-color: var(--rf-border-strong);
}

.rf-day input:checked + span {
    border-color: var(--rf-brand);
    background: var(--rf-brand);
}

.rf-day input:checked + span small,
.rf-day input:checked + span strong {
    color: #fff;
}

.rf-other-date {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 13.5px;
    color: var(--rf-muted);
}

.rf-other-date .rf-input {
    width: auto;
    min-height: 40px;
    padding: 7px 12px;
    font-size: 15px;
}

/* documents */

.rf-docs {
    display: grid;
    gap: 12px;
}

.rf-doc {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border: 1.5px dashed var(--rf-border-strong);
    border-radius: 14px;
    background: #fbfcfe;
    transition: border-color 0.15s, background 0.15s;
}

.rf-doc-drag {
    border-color: var(--rf-accent);
    background: var(--rf-brand-soft);
}

.rf-doc-done {
    border-style: solid;
    border-color: #b7e3cb;
    background: #f6fcf8;
}

.rf-doc.rf-invalid {
    border-color: var(--rf-danger);
    background: var(--rf-danger-soft);
}

.rf-doc-icon {
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--rf-brand-soft);
    color: var(--rf-brand);
}

.rf-doc-done .rf-doc-icon {
    background: var(--rf-success-soft);
    color: var(--rf-success);
}

.rf-doc-main {
    flex: 1;
    min-width: 0;
}

.rf-doc-name {
    font-weight: 600;
    color: var(--rf-text);
    font-size: 14.5px;
}

.rf-doc .rf-hint {
    margin-bottom: 0;
}

.rf-doc-file {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--rf-body);
}

.rf-doc-file img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--rf-border);
}

.rf-doc-filename {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.rf-doc-size {
    flex: none;
    color: var(--rf-muted);
}

.rf-doc-actions {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.rf-doc-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.rf-doc-busy {
    opacity: 0.7;
    pointer-events: none;
}

.rf-pay {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 18px;
    padding: 18px;
    border-radius: 14px;
    background: var(--rf-warning-soft);
    border: 1px solid #f6dfae;
    font-size: 14px;
}

.rf-pay h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

.rf-pay p {
    margin: 0;
}

.rf-pay img {
    flex: none;
    width: 180px;
    max-width: 40%;
    border-radius: 10px;
    background: #fff;
}

.rf-fineprint {
    margin: 14px 0 0;
    font-size: 12.5px;
    color: var(--rf-muted);
}

/* review */

.rf-review {
    display: grid;
    gap: 14px;
    margin-bottom: 20px;
}

.rf-review-block {
    border: 1px solid #e6ebf2;
    border-radius: 14px;
    overflow: hidden;
}

.rf-review-block header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f7f9fc;
    border-bottom: 1px solid #e6ebf2;
}

.rf-review-block h3 {
    font-size: 15px;
}

.rf-review-block dl {
    display: grid;
    grid-template-columns: minmax(150px, 38%) minmax(0, 1fr);
    margin: 0;
    padding: 6px 16px 10px;
    font-size: 14px;
}

.rf-review-block dt,
.rf-review-block dd {
    margin: 0;
    padding: 7px 0;
    border-bottom: 1px solid #f0f3f7;
}

.rf-review-block dt {
    color: var(--rf-muted);
    padding-right: 14px;
}

.rf-review-block dd {
    color: var(--rf-text);
    font-weight: 500;
    overflow-wrap: anywhere;
}

.rf-review-block dd.rf-empty {
    color: var(--rf-faint);
    font-weight: 400;
}

/* ----------------------------------------------------------------- buttons */

.rf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 12px;
    border: 1.5px solid transparent;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}

.rf-btn:active {
    transform: translateY(1px);
}

.rf-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--rf-brand-ring);
}

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

.rf-btn-primary:hover {
    background: var(--rf-brand-strong);
}

.rf-btn-ghost {
    background: #fff;
    border-color: var(--rf-border);
    color: var(--rf-text);
}

.rf-btn-ghost:hover {
    border-color: var(--rf-border-strong);
}

.rf-btn-soft {
    position: relative;
    min-height: 40px;
    padding: 0 16px;
    background: var(--rf-brand-soft);
    color: var(--rf-brand);
    font-size: 14px;
}

.rf-btn-soft:hover {
    background: #dce8f8;
}

.rf-btn-submit {
    padding: 0 26px;
    background: linear-gradient(135deg, var(--rf-brand), var(--rf-accent));
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.rf-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--rf-accent);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}

.rf-link:hover {
    text-decoration: underline;
}

.rf-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding: 14px;
    background: var(--rf-surface);
    border-radius: var(--rf-radius);
    box-shadow: var(--rf-shadow);
}

.rf-nav [data-next],
.rf-nav [data-submit] {
    margin-left: auto;
}

.rf-nav [data-prev][hidden] + .rf-saved {
    margin-left: 4px;
}

.rf-saved {
    font-size: 12.5px;
    color: var(--rf-faint);
    opacity: 0;
    transition: opacity 0.3s;
}

.rf-saved.is-on {
    opacity: 1;
}

/* draft banner */

.rf-draft {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: var(--rf-radius);
    background: #fff;
    border: 1.5px solid #c7d8f3;
    box-shadow: var(--rf-shadow);
    font-size: 14px;
}

.rf-draft strong {
    display: block;
    color: var(--rf-text);
}

.rf-draft span {
    color: var(--rf-muted);
}

.rf-draft-actions {
    display: flex;
    gap: 8px;
    flex: none;
}

/* ----------------------------------------------------------------- overlay */

.rf-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.45);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.rf-overlay-card {
    width: 100%;
    max-width: 420px;
    padding: 30px 28px;
    border-radius: 20px;
    background: #fff;
    text-align: center;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.3);
}

.rf-overlay-card h2 {
    font-size: 19px;
}

.rf-overlay-card p {
    margin: 8px 0 18px;
    color: var(--rf-muted);
    font-size: 14px;
}

.rf-overlay-bar {
    margin-top: 4px;
}

.rf-overlay-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.rf-spinner {
    width: 46px;
    height: 46px;
    margin: 0 auto 16px;
    border-radius: 50%;
    border: 4px solid var(--rf-brand-soft);
    border-top-color: var(--rf-brand);
    animation: rf-spin 0.8s linear infinite;
}

.rf-overlay[data-state="error"] .rf-spinner {
    animation: none;
    border-color: var(--rf-danger-soft);
    background: var(--rf-danger-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23c8321f' d='M11 7h2v6h-2zm0 8h2v2h-2z'/%3E%3C/svg%3E") center / 28px no-repeat;
}

.rf-overlay[data-state="done"] .rf-spinner {
    animation: none;
    border-color: var(--rf-success-soft);
    background: var(--rf-success-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%230a8a52' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center / 28px no-repeat;
}

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

/* ------------------------------------------------------------------ footer */

.rf-footer {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px 36px;
    display: flex;
    gap: 18px;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--rf-faint);
}

.rf-footer a {
    color: var(--rf-faint);
}

/* -------------------------------------------------------- submitted page */

.rf-done {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: -150px auto 0;
    padding: 0 20px 40px;
}

.rf-done .rf-card {
    padding: 34px;
}

.rf-done-hero {
    text-align: center;
    margin-bottom: 26px;
}

.rf-done-check {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--rf-success-soft);
    color: var(--rf-success);
    animation: rf-pop 0.4s ease;
}

.rf-done-check svg {
    width: 38px;
    height: 38px;
}

@keyframes rf-pop {
    from {
        transform: scale(0.6);
        opacity: 0;
    }
}

.rf-done-hero h2 {
    font-size: 25px;
}

.rf-done-hero p {
    margin: 8px auto 0;
    max-width: 520px;
    color: var(--rf-muted);
}

.rf-code {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 14px;
    background: var(--rf-brand-soft);
    border: 1px solid #cfe0f7;
}

.rf-code small {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--rf-brand);
}

.rf-code strong {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 22px;
    color: var(--rf-brand-strong);
    letter-spacing: 0.02em;
}

.rf-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 0;
}

.rf-facts div {
    padding: 14px 16px;
    border-radius: 12px;
    background: #f7f9fc;
}

.rf-facts dt {
    font-size: 12.5px;
    color: var(--rf-muted);
}

.rf-facts dd {
    margin: 2px 0 0;
    font-weight: 600;
    color: var(--rf-text);
}

.rf-next {
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: rf-next;
}

.rf-next li {
    position: relative;
    padding: 0 0 16px 42px;
    counter-increment: rf-next;
    font-size: 14.5px;
}

.rf-next li::before {
    content: counter(rf-next);
    position: absolute;
    left: 0;
    top: -2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--rf-brand);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
}

.rf-next strong {
    display: block;
    color: var(--rf-text);
}

.rf-next span {
    color: var(--rf-muted);
}

.rf-done-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

/* closed form (no open year or grade) */

.rf-closed {
    text-align: center;
}

.rf-closed h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

.rf-closed p {
    max-width: 520px;
    margin: 0 auto 14px;
    color: var(--rf-muted);
}

/* -------------------------------------------- submitted application (view_id) */

.rf-done-wide {
    max-width: 880px;
}

.rf-done-narrow {
    max-width: 520px;
}

.rf-done > .rf-card + .rf-card {
    margin-top: 18px;
}

.rf-app-status {
    margin-bottom: 18px;
}

.rf-app-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 6px;
    border-radius: 99px;
    background: var(--rf-success-soft);
    color: var(--rf-success);
    font-size: 12.5px;
    font-weight: 700;
}

.rf-app-badge svg {
    width: 16px;
    height: 16px;
}

.rf-app-status h2 {
    margin-top: 10px;
    font-size: 24px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.rf-app-status p {
    margin: 4px 0 0;
    color: var(--rf-muted);
}

.rf-files {
    list-style: none;
    margin: 0;
    padding: 6px 16px 10px;
}

.rf-files li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f3f7;
}

.rf-files li:last-child {
    border-bottom: 0;
}

.rf-files-icon {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #f1f4f8;
    color: var(--rf-faint);
}

.rf-files-icon svg {
    width: 18px;
    height: 18px;
}

.rf-files li.is-done .rf-files-icon {
    background: var(--rf-success-soft);
    color: var(--rf-success);
}

.rf-files li.is-missing .rf-files-icon {
    background: var(--rf-danger-soft);
    color: var(--rf-danger);
}

.rf-files-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.rf-files-main strong {
    color: var(--rf-text);
    font-size: 14px;
    font-weight: 600;
}

.rf-files-main small {
    color: var(--rf-muted);
    font-size: 12.5px;
    overflow-wrap: anywhere;
}

.rf-files li.is-missing .rf-files-main small {
    color: var(--rf-danger);
}

.rf-files .rf-btn {
    flex: none;
}

.rf-sheet-note {
    margin: 14px 0 0;
    font-size: 13px;
    color: var(--rf-muted);
}

.rf-review-block .rf-sheet-note {
    margin: 0;
    padding: 12px 16px;
}

.rf-print-only {
    display: none;
}

@media screen {
    .rf-app-head ~ .rf-card .rf-row-empty {
        display: none;
    }
}

.rf-sign {
    gap: 40px;
    margin-top: 28px;
    text-align: center;
    font-size: 13px;
}

.rf-sign > div {
    flex: 1;
}

.rf-sign-space {
    height: 70px;
}

.rf-sign-photo {
    width: 3cm;
    height: 4cm;
    margin: 0 auto;
    border: 1.5px solid #000;
    display: grid;
    place-items: center;
    font-size: 11px;
    color: #64748b;
}

/* date-of-birth check (verify_id) */

.rf-verify {
    text-align: center;
}

.rf-verify-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--rf-brand-soft);
    color: var(--rf-brand);
}

.rf-verify-icon svg {
    width: 28px;
    height: 28px;
}

.rf-verify h2 {
    font-size: 21px;
}

.rf-verify > p {
    margin: 8px 0 20px;
    color: var(--rf-muted);
}

.rf-verify form {
    text-align: left;
}

.rf-verify .rf-input {
    margin: 8px 0 14px;
}

.rf-verify .rf-alert {
    margin: 0 0 14px;
}

.rf-btn-block {
    width: 100%;
}

.rf-verify .rf-link {
    display: inline-block;
    margin-top: 12px;
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 1023px) {
    .rf-header {
        padding-bottom: 26px;
    }

    .rf-shell,
    .rf-done {
        margin-top: 0;
    }

    .rf-shell {
        grid-template-columns: minmax(0, 1fr);
        max-width: 760px;
        padding-top: 16px;
    }

    .rf-done {
        padding-top: 20px;
    }

    .rf-aside {
        display: none;
    }

    .rf-progress {
        display: block;
        position: sticky;
        top: 0;
        z-index: 5;
        margin: 0 -20px 16px;
        padding: 12px 20px 12px;
        background: rgba(243, 245, 249, 0.94);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
    }

    .rf-progress-text {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        margin-bottom: 8px;
        font-size: 13px;
        color: var(--rf-muted);
    }

    .rf-progress-text strong {
        color: var(--rf-text);
        font-size: 14px;
    }
}

@media (max-width: 720px) {
    body.rf {
        font-size: 14.5px;
    }

    .rf-header {
        padding: 18px 16px 18px;
    }

    .rf-header-inner {
        flex-wrap: wrap;
        gap: 14px;
    }

    .rf-logo {
        padding: 8px 12px;
        border-radius: 12px;
    }

    .rf-logo img {
        height: 38px;
        max-width: 170px;
    }

    .rf-head-text {
        order: 3;
        flex-basis: 100%;
    }

    .rf-header h1 {
        font-size: 22px;
    }

    .rf-head-tools {
        margin-left: auto;
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .rf-help {
        padding: 8px 10px;
        font-size: 13px;
    }

    .rf-help small {
        display: none;
    }

    .rf-shell {
        padding: 0 12px 24px;
    }

    .rf-progress {
        margin: 0 -12px 12px;
        padding: 10px 12px;
    }

    .rf-card {
        padding: 20px 16px;
        border-radius: 14px;
    }

    .rf-card-head {
        margin-bottom: 18px;
    }

    .rf-card-head h2 {
        font-size: 18px;
    }

    .rf-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .rf-chips-grid {
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    }

    .rf-doc {
        flex-wrap: wrap;
        padding: 14px;
    }

    .rf-doc-actions {
        flex-direction: row;
        align-items: center;
        width: 100%;
        padding-left: 56px;
    }

    .rf-pay {
        flex-direction: column;
        align-items: stretch;
    }

    .rf-pay img {
        max-width: 240px;
        width: 100%;
        align-self: center;
    }

    .rf-review-block dl {
        grid-template-columns: minmax(0, 1fr);
    }

    .rf-review-block dt {
        padding-bottom: 0;
        border-bottom: 0;
        font-size: 12.5px;
    }

    .rf-review-block dd {
        padding-top: 2px;
    }

    .rf-nav {
        position: sticky;
        bottom: 0;
        z-index: 5;
        margin: 16px -12px 0;
        padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.08);
    }

    .rf-nav .rf-btn {
        flex: 1;
    }

    .rf-saved {
        display: none;
    }

    .rf-draft {
        flex-direction: column;
        align-items: stretch;
    }

    .rf-draft-actions .rf-btn {
        flex: 1;
    }

    .rf-done {
        padding: 14px 12px 24px;
    }

    .rf-done .rf-card {
        padding: 24px 18px;
    }

    .rf-app-status h2 {
        font-size: 20px;
    }

    .rf-files {
        padding: 4px 12px 8px;
    }

    .rf-app-head ~ .rf-card .rf-review-block dl {
        padding: 4px 14px 8px;
    }

    .rf-app-head ~ .rf-card .rf-review-block dd {
        padding-bottom: 8px;
    }

    .rf-files li {
        flex-wrap: wrap;
    }

    .rf-files .rf-btn {
        margin-left: 42px;
        min-height: 36px;
    }

    .rf-facts {
        grid-template-columns: minmax(0, 1fr);
    }

    .rf-code strong {
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rf *,
    .rf *::before,
    .rf *::after {
        animation: none !important;
        transition: none !important;
    }
}

@media print {
    @page {
        margin: 14mm 12mm;
    }

    body.rf {
        background: #fff;
        font-size: 12px;
    }

    .rf-no-print,
    .rf-head-tools {
        display: none !important;
    }

    .rf-print-only {
        display: block !important;
    }

    .rf-sign.rf-print-only {
        display: flex !important;
    }

    .rf-header {
        padding: 0 0 10px;
    }

    .rf-logo {
        box-shadow: none;
        padding: 0;
    }

    .rf-done,
    .rf-done-wide {
        max-width: none;
        padding: 0;
    }

    .rf-done .rf-card {
        padding: 12px 0;
        border: 0;
    }

    /* Sections may run across pages, but never split a label from its answer. */
    .rf-review {
        gap: 8px;
    }

    .rf-review-block {
        break-inside: auto;
        border-color: #cbd5e1;
    }

    .rf-review-block header {
        padding: 5px 12px;
        break-after: avoid;
    }

    .rf-review-block h3 {
        font-size: 13px;
    }

    .rf-review-block dl {
        grid-template-columns: 38% 62%;
        padding: 2px 12px 6px;
        font-size: 11.5px;
    }

    .rf-review-block dt,
    .rf-review-block dd {
        padding: 3px 0;
    }

    .rf-review-block dt {
        break-after: avoid;
    }

    .rf-review-block dd {
        break-before: avoid;
    }

    .rf-files li {
        padding: 4px 0;
        break-inside: avoid;
    }

    .rf-app-status {
        margin-bottom: 8px;
    }

    .rf-app-status h2 {
        font-size: 18px;
    }

    .rf-code {
        padding: 8px 12px;
    }

    .rf-facts {
        margin-top: 8px;
    }

    .rf-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rf-header {
        padding-bottom: 16px;
    }

    .rf-shell,
    .rf-done {
        margin-top: 0;
    }

    .rf-band,
    .rf-lang,
    .rf-help,
    .rf-done-actions,
    .rf-footer {
        display: none !important;
    }

    .rf-header-inner {
        color: var(--rf-text);
    }

    .rf-header h1,
    .rf-eyebrow {
        color: var(--rf-text);
    }

    .rf-card {
        box-shadow: none;
        border: 1px solid var(--rf-border);
    }
}
