:root {
    --primary: #1A3C5E;
    --accent: #F7941D;
    --accent2: #00B4D8;
    --light-bg: #F4F7FC;
    --card-bg: #FFFFFF;
    --section-header: #E8F0FE;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #CBD5E1;
    --success: #10b981;
    --danger: #ef4444;
    --input-focus: #1A3C5E;
    --radius: 14px;
    --radius-sm: 8px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--light-bg);
    color: var(--text-main);
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(26, 60, 94, 0.07) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(0, 180, 216, 0.07) 0%, transparent 50%);
}


/* ── Navbar ── */
.top-navbar {
    background: #ffffff;
    border-bottom: 3px solid var(--accent);
    box-shadow: 0 2px 12px rgba(26, 60, 94, 0.10);
    padding: .6rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-navbar .nav-logo {
    height: 64px;
    width: auto;
    object-fit: contain;
}

.top-navbar .nav-title {
    font-family: 'Sora', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
    letter-spacing: -.01em;
}

.top-navbar .nav-subtitle {
    font-size: .72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.top-navbar .divider-v {
    width: 1px;
    height: 50px;
    background: var(--border);
    flex-shrink: 0;
}

/* ── Header ── */
.form-header {
    background: linear-gradient(135deg, var(--primary) 0%, #0d2a45 100%);
    color: #fff;
    padding: 2.5rem 2rem 2rem;
    border-radius: var(--radius) var(--radius) 0 0;
    position: relative;
    overflow: hidden;
}

.form-header::after {
    content: '';
    position: absolute;
    bottom: -30px;
    right: -30px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(247, 148, 29, 0.18);
}

.form-header .badge-tag {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-family: 'Sora', sans-serif;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: .75rem;
}

.form-header h1 {
    font-family: 'Sora', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 .35rem;
    letter-spacing: -.02em;
}

.form-header p {
    font-size: .9rem;
    opacity: .75;
    margin: 0;
}

/* ── Wrapper ── */
.form-wrapper {
    max-width: 860px;
    margin: 2.5rem auto;
    padding: 0 1rem;
}

/* ── Card ── */
.form-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 8px 40px rgba(26, 60, 94, 0.10);
    overflow: hidden;
}

.form-body {
    padding: 2rem 2.5rem;
}

/* ── Section titles ── */
.section-title {
    display: flex;
    align-items: center;
    gap: .65rem;
    background: linear-gradient(90deg, #e8f0fe 0%, transparent 100%);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: .6rem 1.1rem;
    margin-bottom: 1.5rem;
    font-family: 'Sora', sans-serif;
    font-size: .95rem;
    font-weight: 600;
    color: var(--primary);
}

.section-title .s-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    flex-shrink: 0;
}

/* ── Labels ── */
.form-label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .35rem;
}

.form-label .req {
    color: var(--accent);
    margin-left: 2px;
}

/* ── Inputs ── */
.form-control,
.form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    padding: .6rem .9rem;
    transition: border-color .2s, box-shadow .2s;
    background: #fafcff;
    color: var(--text-main);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(26, 60, 94, 0.10);
    background: #fff;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--danger);
    background-image: none;
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: var(--success);
    background-image: none;
}

.invalid-feedback {
    font-size: .78rem;
    color: var(--danger);
    font-weight: 500;
    display: none;
}

.was-validated .invalid-feedback,
.show-error .invalid-feedback {
    display: block;
}

/* ── Age badge ── */
#ageDisplay {
    background: #e8f0fe;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    font-weight: 700;
    font-family: 'Sora', sans-serif;
    min-height: 42px;
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
    padding: 0 .9rem;
    font-size: .95rem;
}

/* ── Divider ── */
.section-divider {
    border: none;
    border-top: 1.5px dashed var(--border);
    margin: 2.2rem 0;
}

/* ── Upload/Camera blocks ── */
.upload-block {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    background: #fafcff;
    text-align: center;
    transition: border-color .2s;
}

.upload-block:hover {
    border-color: var(--accent2);
}

.upload-block .upload-label {
    font-size: .8rem;
    font-weight: 700;
    font-family: 'Sora', sans-serif;
    letter-spacing: .05em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: .6rem;
    display: block;
}

.upload-tabs .nav-link {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
    border: 1.5px solid var(--border) !important;
    border-radius: 6px !important;
    padding: 4px 14px;
    margin-right: 4px;
}

.upload-tabs .nav-link.active {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

.preview-img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    margin-top: .5rem;
    display: none;
}

.preview-img.show {
    display: inline-block;
}

/* ── Camera modal ── */
#cameraVideo {
    width: 100%;
    border-radius: var(--radius-sm);
    max-height: 260px;
}

/* ── Undertaking ── */
.undertaking-box {
    background: #f0f4ff;
    border: 1.5px solid #c7d7fa;
    border-radius: var(--radius-sm);
    padding: 1rem 1.2rem;
    font-size: .85rem;
    color: var(--text-main);
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* ── Submit button ── */
.btn-submit {
    background: linear-gradient(135deg, var(--accent) 0%, #e0820d 100%);
    color: #fff;
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: .03em;
    padding: .85rem 2.5rem;
    border-radius: 50px;
    border: none;
    box-shadow: 0 6px 20px rgba(247, 148, 29, 0.35);
    transition: transform .15s, box-shadow .15s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(247, 148, 29, 0.45);
    color: #fff;
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit i {
    font-size: 1.1rem;
}

/* ── Success overlay ── */
#successOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26, 60, 94, .85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

#successOverlay.show {
    display: flex;
}

.success-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 2.5rem 3rem;
    text-align: center;
    max-width: 400px;
    animation: popIn .35s ease;
}

@keyframes popIn {
    from {
        transform: scale(.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-card .check-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #dcfce7;
    color: var(--success);
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.2rem;
}

.success-card h3 {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    color: var(--primary);
}

/* ── Spinner ── */
.spinner-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, .65);
    z-index: 8888;
    align-items: center;
    justify-content: center;
}

.spinner-overlay.show {
    display: flex;
}

/* ── Mobile tweaks ── */
@media(max-width: 576px) {
    .form-body {
        padding: 1.2rem 1rem;
    }

    .form-header {
        padding: 1.5rem 1rem 1.2rem;
    }

    .form-header h1 {
        font-size: 1.35rem;
    }

    .top-navbar {
        padding: .5rem 1rem;
    }

    .top-navbar .nav-logo {
        height: 44px;
    }

    .top-navbar .nav-title {
        font-size: .78rem;
    }

    .top-navbar .nav-subtitle {
        font-size: .65rem;
    }
}

/* ── Income ineligible warning ── */
#incomeWarning {
    display: none;
    font-size: .82rem;
    background: #fef2f2;
    border: 1.5px solid #fca5a5;
    border-radius: var(--radius-sm);
    color: #dc2626;
    padding: .55rem .9rem;
    margin-top: .35rem;
}

#incomeWarning.show {
    display: block;
}