:root {
    --avfu-navy: #123B63;
    --avfu-blue: #245A85;
    --avfu-gold: #C5A253;
    --page-bg: #F3F6FA;
    --content-bg: #FFFFFF;
    --text-primary: #243447;
    --text-secondary: #64748B;
    --border-light: #DCE3EB;
    --state-success: #198754;
    --state-warning: #D99A16;
    --state-error: #C62828;
}

html { scroll-behavior: smooth; }
body {
    background: var(--page-bg);
    color: var(--text-primary);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.55;
}
a { color: var(--avfu-blue); }
a:hover { color: var(--avfu-navy); }
:focus-visible { outline: 3px solid var(--avfu-gold) !important; outline-offset: 2px; }

.skip-link {
    position: fixed; z-index: 1080; top: .5rem; left: .5rem;
    padding: .65rem 1rem; transform: translateY(-160%);
    color: #fff; background: var(--avfu-navy); border-radius: .25rem;
}
.skip-link:focus { transform: translateY(0); color: #fff; }

.site-header { background: #fff; border-bottom: 1px solid var(--border-light); }
.portal-navbar { min-height: 82px; gap: 1rem; }
.portal-brand { display: flex; align-items: center; gap: .8rem; min-width: 0; margin-right: 1rem; white-space: normal; }
.portal-logo { display: block; width: 40px; height: 60px; flex: 0 0 auto; object-fit: contain; }
.brand-copy { display: flex; flex-direction: column; gap: .15rem; line-height: 1.2; }
.brand-university { color: var(--avfu-navy); font-size: .78rem; font-weight: 750; letter-spacing: .035em; }
.brand-portal { color: var(--text-secondary); font-size: .72rem; font-weight: 650; letter-spacing: .045em; }
.portal-navbar .nav-link { padding: .6rem .75rem; color: var(--text-primary); font-size: .92rem; font-weight: 600; }
.portal-navbar .nav-link:hover, .portal-navbar .nav-link:focus { color: var(--avfu-blue); }
.navbar-toggler { border-color: var(--border-light); }

.portal-main { width: 100%; max-width: 1240px; padding-top: 2rem; padding-bottom: 1rem; }
.page-intro { margin: 0 auto 1.25rem; max-width: 1240px; }
.page-eyebrow { margin: 0 0 .25rem; color: var(--avfu-blue); font-size: .73rem; font-weight: 750; letter-spacing: .08em; }
.page-intro h1 { margin: 0; color: var(--avfu-navy); font-size: clamp(1.55rem, 2.5vw, 2rem); font-weight: 700; }
.page-description { max-width: 850px; margin: .45rem 0 0; color: var(--text-secondary); }
.portal-card {
    width: 100%; padding: clamp(1rem, 2.5vw, 1.65rem);
    border: 1px solid var(--border-light); border-radius: .55rem;
    background: var(--content-bg); box-shadow: 0 2px 8px rgba(18, 59, 99, .045);
}
.portal-card-auth { max-width: 720px; margin-inline: auto; }
.site-footer { border-top: 1px solid var(--border-light); background: #fff; color: var(--text-secondary); font-size: .78rem; font-weight: 650; letter-spacing: .025em; }

h2, h3, h4 { color: var(--avfu-navy); font-weight: 680; }
.text-secondary, .form-text { color: var(--text-secondary) !important; }
.portal-card .card { border-color: var(--border-light); border-radius: .45rem; box-shadow: none; }
.portal-card .card-header { border-bottom-color: var(--border-light); background: #F8FAFC; color: var(--avfu-navy); font-weight: 650; }
.portal-card .list-group-item { border-color: var(--border-light); }

.btn { min-height: 40px; border-radius: .35rem; font-weight: 620; }
.btn-sm { min-height: 34px; }
.btn-primary { --bs-btn-bg: var(--avfu-navy); --bs-btn-border-color: var(--avfu-navy); --bs-btn-hover-bg: #0D2F50; --bs-btn-hover-border-color: #0D2F50; --bs-btn-active-bg: #0D2F50; --bs-btn-active-border-color: #0D2F50; }
.btn-outline-primary { --bs-btn-color: var(--avfu-navy); --bs-btn-border-color: #8AA2B8; --bs-btn-hover-bg: var(--avfu-navy); --bs-btn-hover-border-color: var(--avfu-navy); --bs-btn-hover-color: #fff; }
.btn-outline-secondary { --bs-btn-color: #475569; --bs-btn-border-color: #AAB6C4; }
.btn:disabled { cursor: not-allowed; }

.form-label { margin-bottom: .4rem; color: #334155; font-size: .92rem; font-weight: 650; }
.form-control, .form-select { min-height: 44px; border-color: #C9D3DE; border-radius: .35rem; color: var(--text-primary); }
textarea.form-control { min-height: auto; }
.form-control:focus, .form-select:focus { border-color: var(--avfu-blue); box-shadow: 0 0 0 .2rem rgba(36, 90, 133, .15); }
.form-control::placeholder { color: #8794A4; }
.registration-form, .admin-login-form, .pensioner-login-form { margin-top: .25rem; }
.registration-form .form-label, .admin-login-form .form-label { font-weight: 650; }
.registration-details dt, .pensioner-dashboard dt { color: #475569; font-weight: 650; }
.registration-details dd, .pensioner-dashboard dd { margin-bottom: .9rem; }
.admin-decision-form { max-width: 720px; }

.alert { border-radius: .4rem; border-width: 1px; }
.alert-success { --bs-alert-color: #145C39; --bs-alert-bg: #EFF8F2; --bs-alert-border-color: #B9DEC8; }
.alert-warning { --bs-alert-color: #74520B; --bs-alert-bg: #FFF9E9; --bs-alert-border-color: #E9D49C; }
.alert-danger { --bs-alert-color: #8D1E1E; --bs-alert-bg: #FFF2F1; --bs-alert-border-color: #E8B8B4; }
.alert-info { --bs-alert-color: #204C70; --bs-alert-bg: #F0F6FB; --bs-alert-border-color: #BCD1E2; }

.table-responsive { border: 1px solid var(--border-light); border-radius: .4rem; background: #fff; }
.table { margin-bottom: 0; color: var(--text-primary); }
.table > :not(caption) > * > * { padding: .72rem .8rem; border-color: #E5EAF0; vertical-align: middle; }
.table thead th { background: #F4F7FA; color: #334155; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-bg-type: #FAFBFD; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #F2F6FA; }
.admin-review-page .table { min-width: 720px; }
.badge { font-weight: 650; letter-spacing: .01em; }
.status-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .6rem; border: 1px solid transparent; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.status-pending { background: #FFF5D9; border-color: #E9D49C; color: #76540C; }
.status-review { background: #EAF2F8; border-color: #C5D7E6; color: #194D76; }
.status-approved { background: #EAF6EF; border-color: #B9DEC8; color: #17663E; }
.status-rejected, .status-error { background: #FFF0EF; border-color: #E8B8B4; color: #992525; }
.status-neutral { background: #F1F4F7; border-color: #D5DDE5; color: #475569; }

.page-section { margin-bottom: 1.5rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.section-heading h2 { margin: 0; font-size: 1.12rem; }
.summary-card { height: 100%; padding: 1.1rem; border: 1px solid var(--border-light); border-left: 4px solid var(--avfu-gold); border-radius: .45rem; background: #fff; }
.summary-card .summary-label { color: var(--text-secondary); font-size: .82rem; font-weight: 650; }
.summary-card .summary-value { display: block; margin-top: .2rem; color: var(--avfu-navy); font-size: 1.75rem; font-weight: 750; line-height: 1.15; }
.empty-state { padding: 1.2rem; border: 1px dashed #C9D3DE; border-radius: .4rem; background: #FAFBFD; color: var(--text-secondary); }
.correction-panel { border-left: 4px solid var(--state-warning); background: #FFFBF1; }
.material-preview { min-width: 0; overflow: hidden; }
.material-preview iframe { display: block; width: 100%; min-height: 520px; border: 1px solid var(--border-light); border-radius: .35rem; }
.material-preview img { display: block; max-width: 100%; max-height: 520px; margin-inline: auto; object-fit: contain; }
.timeline-item { position: relative; padding: 0 0 1.1rem 1.25rem; border-left: 2px solid #D9E2EB; }
.timeline-item:last-child { border-left-color: transparent; }
.timeline-item::before { position: absolute; top: .2rem; left: -.42rem; width: .7rem; height: .7rem; border: 2px solid #fff; border-radius: 50%; background: var(--avfu-blue); box-shadow: 0 0 0 1px var(--avfu-blue); content: ""; }
.upload-drop-hint { padding: 1rem; border: 1px dashed #AAB9C8; border-radius: .4rem; background: #FAFBFD; }
.camera-preview-frame { width: min(100%, 560px); overflow: hidden; border: 1px solid var(--border-light); border-radius: .4rem; background: #17212B; }
.camera-preview-frame video { display: block; width: 100%; max-height: 420px; object-fit: contain; }

/* Independently scrollable pensioner notifications */
.notifications-scroll {
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: #aab7c4 transparent;
}

.notifications-scroll::-webkit-scrollbar {
    width: 7px;
}

.notifications-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.notifications-scroll::-webkit-scrollbar-thumb {
    background-color: #aab7c4;
    border-radius: 10px;
}

.notifications-scroll::-webkit-scrollbar-thumb:hover {
    background-color: #718096;
}

/* =========================================
   AVFU LANDING PAGE
   ========================================= */

.landing-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(240px, .75fr);
    gap: 2rem;
    align-items: center;
    overflow: hidden;
    padding: clamp(2rem, 5vw, 4rem);
    border: 1px solid #D5E0EB;
    border-radius: 1rem;
    background:
        radial-gradient(ellipse at 100% 0%, rgba(197, 162, 83, .14), transparent 45%),
        linear-gradient(125deg, #FFFFFF 0%, #F2F7FC 100%);
    box-shadow: 0 8px 28px rgba(18, 59, 99, .06);
}

.landing-hero-content {
    position: relative;
    z-index: 1;
}

.landing-badge {
    display: inline-block;
    padding: .45rem .75rem;
    border: 1px solid #D8C48E;
    border-radius: 999px;
    background: #FFFDF6;
    color: #765A19;
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .09em;
}

.landing-hero h1 {
    margin: 1.2rem 0 1rem;
    color: var(--avfu-navy);
    font-size: clamp(2.1rem, 4.2vw, 3.6rem);
    font-weight: 800;
    letter-spacing: -.045em;
    line-height: 1.12;
}

.landing-hero h1 span {
    color: var(--avfu-blue);
}

.landing-description {
    max-width: 620px;
    margin-bottom: 1.6rem;
    color: #526579;
    font-size: clamp(1rem, 1.4vw, 1.12rem);
    line-height: 1.8;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.landing-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    padding: .75rem 1.2rem;
    font-size: .94rem;
}

.landing-security-note {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1.4rem;
    color: var(--text-secondary);
    font-size: .84rem;
    font-weight: 600;
}

.landing-hero-aside {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 2rem 1.25rem;
    border: 1px solid rgba(197, 162, 83, .35);
    border-radius: .85rem;
    background: rgba(255, 255, 255, .78);
    text-align: center;
}

.landing-emblem {
    display: grid;
    width: 160px;
    height: 180px;
    place-items: center;
    margin-bottom: 1.1rem;
    border-radius: 50%;
    background: #F5F8FC;
}

.landing-emblem img {
    display: block;
    width: 110px;
    height: 150px;
    object-fit: contain;
}

.landing-aside-university {
    max-width: 240px;
    margin: 0;
    color: var(--avfu-navy);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .045em;
    line-height: 1.6;
}

.landing-aside-divider {
    width: 55px;
    height: 3px;
    margin: .9rem 0;
    border-radius: 5px;
    background: var(--avfu-gold);
}

.landing-aside-caption {
    margin: 0;
    color: var(--text-secondary);
    font-size: .88rem;
}

.landing-process {
    padding: 3rem 0 1rem;
}

.landing-section-heading {
    margin-bottom: 1.35rem;
    text-align: center;
}

.landing-section-heading .page-eyebrow {
    margin-bottom: .4rem;
}

.landing-section-heading h2 {
    margin: 0;
    font-size: clamp(1.45rem, 2.5vw, 1.9rem);
    font-weight: 750;
}

.landing-section-heading > p:last-child {
    margin: .55rem 0 0;
    color: var(--text-secondary);
}

.landing-step {
    position: relative;
    height: 100%;
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    border-radius: .7rem;
    background: #FFFFFF;
    box-shadow: 0 3px 12px rgba(18, 59, 99, .035);
    transition: transform .18s ease, box-shadow .18s ease;
}

.landing-step:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(18, 59, 99, .075);
}

.landing-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    margin-bottom: 1rem;
    border: 1px solid #E5D5A8;
    border-radius: .65rem;
    background: #FFF9E9;
    color: #795F22;
    font-size: .88rem;
    font-weight: 800;
}

.landing-step h3 {
    margin-bottom: .55rem;
    font-size: 1.12rem;
    font-weight: 750;
}

.landing-step p {
    margin: 0;
    color: var(--text-secondary);
    font-size: .92rem;
    line-height: 1.75;
}

.landing-notice {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-top: 1.75rem;
    padding: 1.35rem 1.5rem;
    border: 1px solid #E9D49C;
    border-left: 4px solid var(--avfu-gold);
    border-radius: .65rem;
    background: #FFFCF3;
}

.landing-notice-icon {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border-radius: 50%;
    background: #F3E6BE;
    color: #725717;
    font-weight: 800;
}

.landing-notice h2 {
    margin: .15rem 0 .4rem;
    font-size: 1.02rem;
    font-weight: 750;
}

.landing-notice p {
    margin: 0;
    color: #6D5A2D;
    font-size: .91rem;
    line-height: 1.75;
}

.landing-admin {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    border-radius: .7rem;
    background: #FFFFFF;
}

.landing-admin h2 {
    margin-bottom: .4rem;
    font-size: 1.05rem;
    font-weight: 750;
}

.landing-admin p {
    max-width: 740px;
    margin: 0;
    color: var(--text-secondary);
    font-size: .91rem;
    line-height: 1.7;
}

.landing-admin .btn {
    flex: 0 0 auto;
}

@media (max-width: 767.98px) {
    .landing-hero {
        grid-template-columns: 1fr;
        gap: 1.75rem;
        padding: 1.5rem;
        border-radius: .75rem;
    }

    .landing-hero h1 {
        font-size: clamp(2rem, 8vw, 2.8rem);
    }

    .landing-hero-aside {
        min-height: auto;
        padding: 1.5rem;
    }

    .landing-emblem {
        width: 125px;
        height: 135px;
    }

    .landing-emblem img {
        width: 85px;
        height: 115px;
    }

    .landing-process {
        padding-top: 2.25rem;
    }

    .landing-admin {
        align-items: stretch;
        flex-direction: column;
        gap: 1rem;
    }

    .landing-admin .btn {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .landing-actions {
        flex-direction: column;
    }

    .landing-actions .btn {
        width: 100%;
    }

    .landing-notice {
        gap: .75rem;
        padding: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .landing-step {
        transition: none;
    }

    .landing-step:hover {
        transform: none;
    }
}

@media (max-width: 767.98px) {
    .portal-navbar { min-height: 74px; padding-block: .5rem; }
    .portal-logo { width: 34px; height: 51px; }
    .brand-university { max-width: 240px; font-size: .68rem; }
    .brand-portal { font-size: .64rem; }
    .portal-navbar .navbar-nav { align-items: stretch !important; padding: .5rem 0; }
    .portal-navbar .nav-link { padding: .7rem .2rem; border-top: 1px solid #EEF1F4; }
    .portal-main { padding-top: 1.25rem; }
    .portal-card { padding: 1rem; }
    .material-preview iframe { min-height: 390px; }
    .table > :not(caption) > * > * { padding: .6rem; }
}

@media (max-width: 575.98px) {
    .brand-university { max-width: 205px; font-size: .62rem; }
    .brand-portal { font-size: .58rem; }
    .portal-brand { gap: .55rem; }
    .portal-logo { width: 30px; height: 45px; }
    .page-description { font-size: .93rem; }
    .site-footer .container { font-size: .7rem; }
    .material-preview iframe { min-height: 330px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

#spouse_name_group[hidden] { display: none !important; }
