/* ============================================================
   MVCS Employment Portal — Design System
   Deep academic blue + desert-gold accent, Fraunces / Public Sans
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Public+Sans:wght@400;500;600;700&display=swap');

:root {
    /* Color */
    --ink: #16233c;
    --ink-soft: #3d4a63;
    --muted: #68748c;
    --brand: #2a4e8f;
    --brand-deep: #1c3766;
    --brand-soft: #e9eff9;
    --brand-line: #c6d4ec;
    --gold: #c08a2d;
    --gold-soft: #faf3e3;
    --paper: #f6f7f9;
    --card: #ffffff;
    --border: #e3e7ee;
    --success: #237a50;
    --success-soft: #e7f5ee;
    --warn: #a16207;
    --warn-soft: #fdf3dc;
    --danger: #b42318;
    --danger-soft: #fdebe9;

    /* Type */
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Public Sans', -apple-system, 'Segoe UI', sans-serif;

    /* Shape & depth */
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(22, 35, 60, 0.06);
    --shadow-md: 0 4px 14px rgba(22, 35, 60, 0.08);
    --shadow-lg: 0 16px 40px rgba(22, 35, 60, 0.14);

    /* Motion */
    --ease: cubic-bezier(0.25, 0.6, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; color: var(--ink); }

img { max-width: 100%; }

button { font-family: var(--font-body); }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s var(--ease), border-color 0.18s var(--ease),
                color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.12s var(--ease);
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--brand);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--brand-deep); box-shadow: var(--shadow-md); }

.btn-secondary {
    background: var(--card);
    color: var(--brand);
    border-color: var(--brand-line);
}
.btn-secondary:hover { border-color: var(--brand); background: var(--brand-soft); }

.btn-ghost {
    background: transparent;
    color: var(--ink-soft);
}
.btn-ghost:hover { background: rgba(22, 35, 60, 0.06); color: var(--ink); }

.btn-danger {
    background: var(--card);
    color: var(--danger);
    border-color: #f1c1bc;
}
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

.btn-lg { padding: 0.85rem 1.6rem; font-size: 1rem; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.85rem; }

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn .spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Top navigation
   ============================================================ */

.navbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
/* the thin desert-gold rule that runs under the nav — brand signature */
.navbar::after {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--gold) 0%, var(--brand) 55%, var(--brand-deep) 100%);
}

.nav-content {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0.7rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.navbar-logo { height: 46px; width: auto; display: block; }

.nav-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--brand-deep);
}

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

.nav-user {
    color: var(--muted);
    font-size: 0.9rem;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   Auth pages (sign in / register)
   ============================================================ */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    background:
        radial-gradient(1100px 500px at 85% -10%, rgba(192, 138, 45, 0.16), transparent 60%),
        radial-gradient(900px 600px at -10% 110%, rgba(42, 78, 143, 0.20), transparent 55%),
        var(--brand-deep);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--card);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2.25rem;
    animation: rise 0.4s var(--ease);
}

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-logo { display: block; margin: 0 auto 0.75rem; max-width: 170px; }

.auth-eyebrow {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.5rem;
}

.auth-card h1 {
    font-size: 1.75rem;
    text-align: center;
    margin-bottom: 0.35rem;
}

.auth-sub {
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 1.75rem;
}

.auth-links {
    text-align: center;
    margin-top: 1.4rem;
    font-size: 0.92rem;
    color: var(--muted);
}
.auth-links a { color: var(--brand); font-weight: 600; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
.auth-links + .auth-links { margin-top: 0.6rem; }

/* ============================================================
   Forms (shared)
   ============================================================ */

.field { margin-bottom: 1.25rem; }

.field label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--ink);
}

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

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    color: var(--ink);
    background: var(--card);
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.field input:hover, .field select:hover, .field textarea:hover { border-color: #c9d1de; }

.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(42, 78, 143, 0.14);
}

.field textarea { resize: vertical; min-height: 110px; line-height: 1.55; }

.field .hint { font-size: 0.82rem; color: var(--muted); margin-top: 0.3rem; }

.field.invalid input,
.field.invalid select,
.field.invalid textarea {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.10);
}

.field.invalid > label { color: var(--danger); }

.field-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.field-row .field { flex: 1 1 0; min-width: 150px; }

.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}
.checkbox-field input[type="checkbox"] {
    width: 18px; height: 18px;
    margin-top: 3px;
    accent-color: var(--brand);
    flex-shrink: 0;
}
.checkbox-field label { margin: 0; font-weight: 500; cursor: pointer; }

.radio-group { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.radio-option {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    font-weight: 500;
}
.radio-option input { accent-color: var(--brand); width: 17px; height: 17px; }

/* Inline messages */
.msg {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    margin-bottom: 1.1rem;
    display: none;
}
.msg.show { display: block; }
.msg-error { background: var(--danger-soft); color: var(--danger); border: 1px solid #f2c4bf; }
.msg-success { background: var(--success-soft); color: var(--success); border: 1px solid #bfe5d0; }

/* ============================================================
   Dashboard
   ============================================================ */

.page {
    max-width: 1160px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.page-header { margin-bottom: 2.25rem; }

.page-eyebrow {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.4rem;
}

.page-header h1 { font-size: 2.1rem; margin-bottom: 0.35rem; }
.page-header p { color: var(--muted); font-size: 1.05rem; }

.section-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}
.section-title .count {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease);
    display: flex;
    flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #d4dae4; }

.app-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.card h3 { font-size: 1.15rem; }

.badge {
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.badge-draft { background: var(--warn-soft); color: var(--warn); }
.badge-submitted { background: var(--success-soft); color: var(--success); }

.card-meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.9rem; }

/* Slim progress bar — echoes the journey rail in the form */
.progress-track {
    height: 6px;
    background: var(--brand-soft);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}
.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gold), var(--brand));
    transition: width 0.5s var(--ease);
}
.progress-label { font-size: 0.8rem; color: var(--muted); margin-bottom: 1rem; }

.card-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: auto;
}
.card-actions .btn { flex: 1; }
.card-actions .btn-danger { flex: 0 0 auto; }

/* Position (start new) cards */
.position-card p { color: var(--muted); font-size: 0.92rem; margin: 0.3rem 0 1.1rem; flex: 1; }

.position-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.85rem;
}
.position-icon svg { width: 22px; height: 22px; }

.empty-state {
    background: var(--card);
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--muted);
    grid-column: 1 / -1;
}

.skeleton {
    background: linear-gradient(90deg, #eef0f4 25%, #f7f8fa 50%, #eef0f4 75%);
    background-size: 200% 100%;
    animation: shimmer 1.3s infinite;
    border-radius: var(--radius);
    height: 150px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============================================================
   Application form layout — the "journey" rail
   ============================================================ */

.form-page {
    max-width: 1160px;
    margin: 0 auto;
    padding: 2rem 1.5rem 5rem;
}

.form-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}

.form-topbar h1 { font-size: 1.7rem; }

.form-topbar .sub { color: var(--muted); font-size: 0.92rem; margin-top: 0.15rem; }

.topbar-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

/* Autosave pill */
.save-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--success-soft);
    color: var(--success);
    transition: background 0.2s, color 0.2s;
}
.save-pill::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: currentColor;
}
.save-pill.unsaved { background: var(--warn-soft); color: var(--warn); }
.save-pill.saving  { background: var(--brand-soft); color: var(--brand); }

.form-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 1.75rem;
    align-items: start;
}

/* --- Journey rail (stepper) --- */
.journey {
    position: sticky;
    top: 84px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0.85rem;
    max-height: calc(100vh - 108px);
    overflow-y: auto;
}

.journey-progress {
    padding: 0.25rem 0.6rem 0.9rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.6rem;
}
.journey-progress .label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.45rem;
}
.journey-progress .label strong { color: var(--brand-deep); }

.journey-steps { list-style: none; }

.step-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-align: left;
    padding: 0.6rem 0.6rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink-soft);
    cursor: pointer;
    line-height: 1.3;
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
    position: relative;
}
.step-btn:hover { background: var(--paper); }

.step-btn .dot {
    flex: 0 0 24px;
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--card);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    transition: all 0.2s var(--ease);
    position: relative;
    z-index: 1;
}

/* connecting line between dots */
.journey-steps li { position: relative; }
.journey-steps li:not(:last-child)::after {
    content: '';
    position: absolute;
    left: calc(0.6rem + 11px);
    top: 34px;
    bottom: -8px;
    width: 2px;
    background: var(--border);
}
.journey-steps li.done:not(:last-child)::after {
    background: linear-gradient(180deg, var(--gold), var(--brand));
}

.step-btn.active {
    background: var(--brand-soft);
    color: var(--brand-deep);
    font-weight: 600;
}
.step-btn.active .dot { border-color: var(--brand); color: var(--brand); }

li.done .step-btn .dot {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
li.attention .step-btn .dot {
    background: var(--warn-soft);
    border-color: var(--warn);
    color: var(--warn);
}

.step-btn .step-label { flex: 1; min-width: 0; }
.step-btn .step-note {
    display: block;
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--muted);
}
li.attention .step-btn .step-note { color: var(--warn); }
li.done .step-btn .step-note { color: var(--success); }

/* Mobile progress bar */
.mobile-progress { display: none; }

/* --- Form content --- */
.form-content { min-width: 0; }

.form-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    display: none;
    animation: rise 0.3s var(--ease);
}
.form-section.is-active { display: block; }
body.view-all .form-section { display: block; margin-bottom: 1.5rem; scroll-margin-top: 96px; }

/* Read-only answers flow at full height — no inner scrollbars */
body.readonly .form-section textarea {
    overflow: hidden;
    resize: none;
    min-height: 0;
}

.form-section > h2 {
    font-size: 1.45rem;
    padding-bottom: 0.8rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}
/* short gold tick under each section title — quiet echo of the rail */
.form-section > h2::after {
    content: '';
    position: absolute;
    left: 0; bottom: -1px;
    width: 52px; height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--gold), var(--brand));
}

.section-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}
.section-nav .pos { font-size: 0.85rem; color: var(--muted); }

/* --- Repeating record cards (education / employment / coaching / references) --- */
.record-card {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.1rem 1.15rem;
    margin-bottom: 0.9rem;
    position: relative;
}

.record-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
}

.record-card-head h4 {
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brand);
}

.record-remove {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.record-remove:hover { color: var(--danger); background: var(--danger-soft); }

.record-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.record-grid .field { margin-bottom: 0; }
.record-grid .field.full { grid-column: 1 / -1; }
.record-grid label { font-size: 0.82rem; color: var(--ink-soft); }
.record-grid input, .record-grid textarea { padding: 0.55rem 0.7rem; font-size: 0.95rem; background: var(--card); }

.add-record-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.05rem;
    background: var(--card);
    color: var(--brand);
    border: 1.5px dashed var(--brand-line);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s var(--ease);
}
.add-record-btn:hover { border-color: var(--brand); background: var(--brand-soft); border-style: solid; }

/* --- Statement of Faith --- */
.faith-list { display: flex; flex-direction: column; gap: 0.85rem; }

.faith-item {
    background: var(--paper);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand);
    border-radius: var(--radius-sm);
    padding: 1rem 1.15rem;
}
.faith-item .faith-text { font-size: 0.94rem; line-height: 1.65; margin-bottom: 0.75rem; }
.faith-item .faith-q {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    font-weight: 600;
}

/* --- Info button + modal --- */
.info-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.15rem;
    background: var(--brand-soft);
    color: var(--brand-deep);
    border: 1px solid var(--brand-line);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.info-btn:hover { background: #dbe6f6; }

/* ============================================================
   Modals & toasts
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(22, 35, 60, 0.5);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.25rem;
    animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--card);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: rise 0.25s var(--ease);
}
.modal.wide { max-width: 640px; }

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem 0.9rem;
    border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 1.25rem; }

.modal-x {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 0.25rem 0.45rem;
    border-radius: 6px;
}
.modal-x:hover { color: var(--ink); background: var(--paper); }

.modal-body { padding: 1.25rem 1.5rem; overflow-y: auto; line-height: 1.65; }
.modal-body p + p { margin-top: 0.8rem; }

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.7rem;
    padding: 1rem 1.5rem 1.25rem;
    border-top: 1px solid var(--border);
}

/* Review checklist inside submit modal */
.review-list { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.review-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
}
.review-item.ok { background: var(--success-soft); border-color: #bfe5d0; }
.review-item.missing { background: var(--warn-soft); border-color: #ecd9a8; }
.review-item .ri-label { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.review-item .ri-sub { font-size: 0.8rem; font-weight: 500; color: var(--muted); display: block; }

/* Toasts */
.toast-stack {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: min(380px, calc(100vw - 2.5rem));
}
.toast {
    background: var(--ink);
    color: #fff;
    padding: 0.8rem 1.1rem;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    font-size: 0.92rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    animation: toastIn 0.3s var(--ease);
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.leaving { opacity: 0; transform: translateY(8px); transition: all 0.25s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================
   View mode & extras
   ============================================================ */

body.readonly .form-section input,
body.readonly .form-section select,
body.readonly .form-section textarea {
    background: var(--paper);
    pointer-events: none;
    border-color: var(--border);
}
body.readonly .add-record-btn,
body.readonly .record-remove,
body.readonly .section-nav { display: none; }

.readonly-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
    color: var(--brand-deep);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.1rem;
    font-size: 0.92rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.loading-block { text-align: center; padding: 5rem 1rem; color: var(--muted); }
.loading-block .big-spinner {
    width: 34px; height: 34px;
    margin: 0 auto 1rem;
    border: 3px solid var(--brand-soft);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.print-value { display: none; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 920px) {
    .form-layout { grid-template-columns: 1fr; }
    .journey { display: none; }

    .mobile-progress {
        display: block;
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 0.9rem 1.1rem;
        margin-bottom: 1.25rem;
    }
    .mobile-progress .mp-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.85rem;
        font-weight: 600;
        margin-bottom: 0.55rem;
    }
    .mobile-progress select {
        width: 100%;
        margin-top: 0.6rem;
        padding: 0.55rem 0.7rem;
        border: 1.5px solid var(--border);
        border-radius: var(--radius-sm);
        font-size: 0.95rem;
        background: var(--card);
    }
}

@media (max-width: 640px) {
    .form-section { padding: 1.35rem 1.1rem; }
    .record-grid { grid-template-columns: 1fr; }
    .page-header h1 { font-size: 1.7rem; }
    .navbar-logo { height: 38px; }
    .nav-user { display: none; }
    .card-actions { flex-wrap: wrap; }
    .faith-item .faith-q { gap: 0.9rem; }
}

/* ============================================================
   Print (view mode)
   ============================================================ */

@media print {
    .navbar, .form-topbar .topbar-actions, .journey, .mobile-progress,
    .section-nav, .readonly-banner, .toast-stack, .modal-overlay,
    .add-record-btn, .record-remove, button { display: none !important; }

    body { background: #fff; color: #000; font-size: 11pt; }

    .form-layout { display: block !important; }
    .form-section {
        display: block !important;
        border: none;
        box-shadow: none;
        padding: 0 0 12pt 0;
        margin: 0 0 10pt 0;
        page-break-inside: auto;
    }
    .form-section > h2 {
        font-size: 15pt;
        border-bottom: 2pt solid #000;
        page-break-after: avoid;
    }
    .form-section > h2::after { display: none; }

    .field { page-break-inside: avoid; margin-bottom: 7pt; }
    .field label { font-size: 10pt; page-break-after: avoid; }

    /* live controls are replaced with flowing text mirrors before printing */
    .print-suppressed { display: none !important; }
    .print-value {
        display: block !important;
        font-size: 10.5pt;
        line-height: 1.45;
        white-space: pre-wrap;
        word-wrap: break-word;
        border-bottom: 1pt solid #999;
        padding: 2pt 0 4pt;
        min-height: 12pt;
    }
    .print-value.multiline { border: 1pt solid #999; padding: 5pt; }

    .record-card { border: 1pt solid #000; background: #fff; page-break-inside: avoid; }
    .faith-item { border: 1pt solid #000; border-left: 3pt solid #000; background: #fff; }
}
