/* iMERGEncy — base styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #3b6fd1;
    --primary-dark: #2d5bb7;
    --accent: #e2483e;
    --accent-dark: #c0392b;
    --bg: #f4f6fa;
    --card-bg: #ffffff;
    --border: #e4e8f0;
    --text: #1c2536;
    --muted: #8993ad;
    --success: #1d6f42;
    --warning: #8a6d1d;
    --shadow-sm: 0 1px 2px rgba(28, 37, 54, 0.04), 0 2px 8px rgba(28, 37, 54, 0.05);
    --shadow-md: 0 4px 16px rgba(28, 37, 54, 0.08);
}

* {
    box-sizing: border-box;
}

/* ===== Icon system (replaces emoji glyphs project-wide) ===== */
.icon {
    display: inline-block;
    vertical-align: -4px;
    flex-shrink: 0;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: rgba(255,255,255,0.16);
    vertical-align: -9px;
    margin-right: 2px;
}

    .brand-mark .icon {
        vertical-align: 0;
    }

    .brand-mark img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 3px;
        box-sizing: border-box;
    }

.topbar-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    text-decoration: none;
    color: rgba(255,255,255,0.92);
    transition: background 0.15s, color 0.15s;
}

    .topbar-icon-link:hover {
        color: #ffffff;
        background: rgba(255,255,255,0.14);
    }

    .topbar-icon-link .icon {
        vertical-align: 0;
    }

.topbar-logout .icon {
    vertical-align: -2px;
    margin-right: 1px;
}

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

    body.auth-body {
        background: var(--auth-navy-deep, #0a0e27);
    }

.topbar {
    background: linear-gradient(135deg, var(--primary) 0%, #2f5bc4 100%);
    color: white;
    padding: 16px 20px;
}

.topbar-inner {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-logout {
    margin-left: auto;
    color: rgba(255,255,255,0.92);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
    background: rgba(255,255,255,0.15);
    padding: 6px 12px;
    border-radius: 100px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

    .topbar-logout:hover {
        background: rgba(255,255,255,0.26);
        color: #ffffff;
    }
/* Lightweight topbar for drill-in sub-pages (Settings, Edit Profile,
   Security, First Aid Tips, Notifications) — back button + title only,
   no brand row and no bottom tab bar to match (see header.php $subPage). */
.topbar-sub {
    padding: 14px 16px;
}

.topbar-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #ffffff;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.15s;
}

    .topbar-back:hover {
        background: rgba(255,255,255,0.16);
    }

.topbar-sub-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.brand {
    color: white;
    text-decoration: none;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.brand-sub {
    color: rgba(255,255,255,0.8);
    font-size: 12.5px;
}

.page-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

h1 {
    font-size: 21px;
    margin-top: 0;
    font-weight: 800;
    letter-spacing: -0.2px;
}

h2 {
    font-size: 17px;
    color: var(--primary);
    font-weight: 700;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-top: 14px;
    margin-bottom: 4px;
}

input[type=text], input[type=email], input[type=password],
input[type=date], input[type=tel], input[type=number],
select, textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
}

    input:focus, select:focus, textarea:focus {
        outline: none;
        border-color: var(--primary);
    }

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

    .checkbox-row label {
        margin: 0;
        font-weight: normal;
    }

.btn {
    display: inline-block;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 22px;
    border-radius: 100px;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    margin-top: 16px;
    box-shadow: 0 2px 8px rgba(59, 111, 209, 0.28);
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

    .btn:hover {
        background: var(--primary-dark);
        box-shadow: 0 4px 12px rgba(59, 111, 209, 0.34);
    }

    .btn:active {
        transform: scale(0.98);
    }

.btn-danger {
    background: var(--accent);
}

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

.btn-block {
    width: 100%;
    text-align: center;
}

.alert {
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    margin-bottom: 14px;
}

.alert-error {
    background: #fdecea;
    border: 1px solid #f5c6cb;
    color: #842029;
}

.alert-success {
    background: #eafaf1;
    border: 1px solid #b7e4c7;
    color: #1d6f42;
}

.badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 100px;
    font-size: 11.5px;
    font-weight: 700;
}

.badge-low {
    background: #eafaf1;
    color: #1d6f42;
}

.badge-moderate {
    background: #fff8e1;
    color: #8a6d1d;
}

.badge-high {
    background: #fdecea;
    color: #842029;
}

.badge-critical {
    background: var(--accent-dark);
    color: white;
}

.footer {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    padding: 20px;
}

.report-photo-preview {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 10px;
}

/* ── AI analysis toggle (report flow) ───────────────────────────── */
.ai-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #f4f7fd;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    margin: 14px 0 16px;
}

.ai-toggle-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
}

    .ai-toggle-title .icon {
        color: var(--primary);
    }

.ai-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

    .ai-switch input {
        opacity: 0;
        width: 0;
        height: 0;
        margin: 0;
        padding: 0;
        position: absolute;
        -webkit-appearance: none;
        appearance: none;
    }

.ai-switch-track {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: #cbd3e1;
    border-radius: 100px;
    transition: background 0.15s;
    cursor: pointer;
    pointer-events: none;
}

.ai-switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    transition: transform 0.15s;
}

.ai-switch input:checked + .ai-switch-track {
    background: var(--primary);
}

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

.ai-switch input:focus-visible + .ai-switch-track {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.field-hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

/* ── Settings / Profile ─────────────────────────────────────────── */
.avatar-wrap {
    position: relative;
    width: 100px;
    margin: 0 auto 14px auto;
}

.avatar-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 800;
    overflow: hidden;
}

    .avatar-circle img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.avatar-edit-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

    .detail-row:last-child {
        border-bottom: none;
    }

.detail-row-label {
    color: var(--muted);
    font-size: 13.5px;
}

.detail-row-value {
    font-weight: 600;
    font-size: 14px;
    text-align: right;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

    .btn-outline:hover {
        background: rgba(59,111,209,0.08);
    }

.btn-outline-success {
    border-color: var(--success);
    color: var(--success);
}

    .btn-outline-success:hover {
        background: rgba(29,111,66,0.08);
    }

.btn-outline-purple {
    border-color: #6c5ce7;
    color: #6c5ce7;
}

    .btn-outline-purple:hover {
        background: rgba(108,92,231,0.08);
    }

.btn-outline-danger {
    border-color: var(--accent);
    color: var(--accent);
}

    .btn-outline-danger:hover {
        background: rgba(226,72,62,0.08);
    }

.dependent-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    margin-top: 10px;
    align-items: center;
}

    .dependent-row input {
        margin: 0;
    }

.remove-dependent-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-size: 14px;
    cursor: pointer;
}

    .remove-dependent-btn:hover {
        background: rgba(226,72,62,0.08);
    }

.add-dependent-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    margin-top: 10px;
}

/* ─────────────────────────────────────────────────────────────
   Auth pages — split panel (login / official login / register)
   ───────────────────────────────────────────────────────────── */
:root {
    --auth-navy-deep: #070b1a;
    --auth-navy: #0c1530;
    --auth-blue: #2748d8;
    --auth-blue-bright: #4d7bff;
    --auth-accent-2: #2dd4bf;
    --auth-text-dim: #aab4d4;
    --auth-border: rgba(255, 255, 255, 0.1);
    --auth-input-bg: rgba(255, 255, 255, 0.045);
}

.auth-shell {
    position: relative;
    min-height: 100vh;
    margin: -20px;
    display: flex;
    background: var(--auth-navy-deep);
}

    /* Light theme override — applied via .theme-light on .auth-shell
   (toggle clicks) or inherited from html.theme-light-pref (set by the
   no-flash init script in header.php, based on the saved preference).
   Scoped to .auth-themeable: only login.php / register.php carry that
   class, so official_login.php (which never includes it) always stays
   dark regardless of what theme a citizen page saved. */
    .auth-shell.theme-light,
    html.theme-light-pref .auth-shell.auth-themeable {
        --auth-navy-deep: #f4f6fb;
        --auth-navy: #ffffff;
        --auth-blue: #1648c7;
        --auth-blue-bright: #2f5fe0;
        --auth-accent-2: #0e9488;
        --auth-text-dim: #5b6478;
        --auth-border: rgba(15, 23, 42, 0.1);
        --auth-input-bg: rgba(15, 23, 42, 0.025);
        --auth-text-main: #0f172a;
        --auth-muted-2: #94a0bd;
    }

body.auth-body.theme-light-body {
    background: #f4f6fb;
}

.theme-light .auth-side,
html.theme-light-pref .auth-themeable .auth-side {
    border-right: 1px solid var(--auth-border);
}

@media (min-width: 880px) {
    .theme-light .auth-side,
    html.theme-light-pref .auth-themeable .auth-side {
        background: radial-gradient(ellipse 900px 500px at 0% 0%, rgba(47, 95, 224, 0.08), transparent 60%), linear-gradient(160deg, #ffffff 0%, #eef1f9 100%);
    }
}

.theme-light .auth-brand-name, html.theme-light-pref .auth-themeable .auth-brand-name,
.theme-light .auth-side-title, html.theme-light-pref .auth-themeable .auth-side-title,
.theme-light .auth-card-title, html.theme-light-pref .auth-themeable .auth-card-title,
.theme-light .auth-side-features h3, html.theme-light-pref .auth-themeable .auth-side-features h3 {
    color: var(--auth-text-main);
}

.theme-light .auth-side-features li, html.theme-light-pref .auth-themeable .auth-side-features li {
    color: #374159;
}

.theme-light .auth-field label, html.theme-light-pref .auth-themeable .auth-field label {
    color: #374159;
}

.theme-light .auth-field input, html.theme-light-pref .auth-themeable .auth-field input {
    color: var(--auth-text-main);
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.12);
}

    .theme-light .auth-field input::placeholder, html.theme-light-pref .auth-themeable .auth-field input::placeholder {
        color: #9aa3ba;
    }

.theme-light .auth-card, html.theme-light-pref .auth-themeable .auth-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.theme-light .auth-input-icon, html.theme-light-pref .auth-themeable .auth-input-icon {
    color: #8a93ad;
}

.theme-light .auth-submit, html.theme-light-pref .auth-themeable .auth-submit {
    color: #fff;
}

.theme-light .auth-side-footer, html.theme-light-pref .auth-themeable .auth-side-footer {
    color: var(--auth-muted-2);
}

.theme-light .auth-shell-wide select option, html.theme-light-pref .auth-themeable.auth-shell-wide select option {
    color: var(--auth-text-main);
}

.theme-light .auth-checkbox-row label, html.theme-light-pref .auth-themeable .auth-checkbox-row label {
    color: #374159;
}

.theme-light .auth-field-hint, html.theme-light-pref .auth-themeable .auth-field-hint {
    color: var(--auth-muted-2);
}

.theme-light .auth-card .alert-error, html.theme-light-pref .auth-themeable .auth-card .alert-error {
    background: #fdecea;
    border: 1px solid #f5c6cb;
    color: #842029;
}

.theme-light .auth-card .alert-success, html.theme-light-pref .auth-themeable .auth-card .alert-success {
    background: #eafaf1;
    border: 1px solid #b7e4c7;
    color: #1d6f42;
}

/* Theme toggle (light/dark) — only rendered on citizen auth pages */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-border);
    border-radius: 100px;
    padding: 4px;
    z-index: 5;
}

    .theme-toggle button {
        border: none;
        background: transparent;
        color: var(--auth-text-dim);
        font-size: 12.5px;
        font-weight: 600;
        padding: 6px 12px;
        border-radius: 100px;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }

        .theme-toggle button.active {
            background: linear-gradient(135deg, var(--auth-blue-bright), var(--auth-blue));
            color: #fff;
        }

.auth-shell-wide .theme-toggle {
    position: static;
    margin: 0 0 0 auto;
}

.auth-shell-wide .auth-topbar {
    position: relative;
}

.auth-side {
    display: none;
}

.auth-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

@media (min-width: 880px) {
    .auth-shell {
        margin: -20px;
    }

    .auth-side {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        flex: 1;
        max-width: 560px;
        padding: 56px 56px 40px;
        background: radial-gradient(ellipse 900px 500px at 0% 0%, rgba(59, 108, 240, 0.35), transparent 60%), linear-gradient(160deg, var(--auth-navy) 0%, var(--auth-navy-deep) 100%);
        color: #fff;
        border-right: 1px solid var(--auth-border);
    }

    .auth-form-side {
        flex: 1;
        background: var(--auth-navy-deep);
    }
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-brand-mark {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.auth-brand-name {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}

.auth-brand-sub {
    font-size: 12.5px;
    color: var(--auth-text-dim);
}

.auth-side-body {
    margin-top: 56px;
}

.auth-side-title {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 18px;
    color: #fff;
}

    .auth-side-title .accent {
        background: linear-gradient(100deg, var(--auth-blue-bright), var(--auth-accent-2));
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }

.auth-side-desc {
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--auth-text-dim);
    max-width: 380px;
}

.auth-side-features {
    margin-top: 40px;
}

    .auth-side-features h3 {
        font-size: 14px;
        font-weight: 700;
        color: #fff;
        margin: 0 0 14px;
    }

        .auth-side-features h3 .accent {
            background: linear-gradient(100deg, var(--auth-blue-bright), var(--auth-accent-2));
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        }

    .auth-side-features ul {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .auth-side-features li {
        font-size: 13.5px;
        color: #dde3f5;
        display: flex;
        align-items: center;
        gap: 10px;
    }

        .auth-side-features li::before {
            content: '';
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--auth-blue-bright);
            flex-shrink: 0;
        }

.auth-side-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--auth-border);
    font-size: 11.5px;
    color: #6b7494;
    line-height: 1.6;
}

.auth-card {
    width: 100%;
    max-width: 380px;
}

.auth-card-eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--auth-blue-bright);
    margin-bottom: 10px;
}

.auth-card-title {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px;
}

.auth-card-desc {
    font-size: 13.5px;
    color: var(--auth-text-dim);
    line-height: 1.6;
    margin-bottom: 28px;
}

.auth-field {
    margin-bottom: 18px;
}

    .auth-field label {
        display: block;
        font-size: 13px;
        font-weight: 600;
        color: #dde3f5;
        margin-bottom: 6px;
    }

    .auth-field input {
        width: 100%;
        font-size: 14.5px;
        color: #fff;
    }

        .auth-field input::placeholder {
            color: #5b6488;
        }

        .auth-field input:focus {
            outline: none;
        }

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
    font-size: 13px;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-text-dim);
}

    .auth-remember input {
        accent-color: var(--auth-blue-bright);
    }

.auth-forgot {
    color: var(--auth-blue-bright);
    text-decoration: none;
}

    .auth-forgot:hover {
        text-decoration: underline;
    }

.auth-submit {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, var(--auth-blue-bright), var(--auth-blue));
    color: #fff;
    border: none;
    padding: 13px 20px;
    border-radius: 8px;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

    .auth-submit:hover {
        filter: brightness(1.08);
    }

    .auth-submit:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }

.auth-switch {
    text-align: center;
    margin-top: 22px;
    font-size: 13.5px;
    color: var(--auth-text-dim);
}

    .auth-switch a {
        color: var(--auth-blue-bright);
        text-decoration: none;
        font-weight: 600;
    }

        .auth-switch a:hover {
            text-decoration: underline;
        }

.auth-card .alert {
    background: rgba(192, 57, 43, 0.12);
    border: 1px solid rgba(192, 57, 43, 0.4);
    color: #ff9b91;
}

.auth-card .alert-success {
    background: rgba(39, 174, 96, 0.12);
    border: 1px solid rgba(39, 174, 96, 0.4);
    color: #7be3a8;
}

/* Wide variant — used by the register page, which has too many fields
   to comfortably fit the narrow split-panel card. */
.auth-shell.auth-shell-wide {
    display: block;
    min-height: 100vh;
}

.auth-shell-wide .auth-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--auth-border);
}

.auth-shell-wide .auth-form-side {
    display: block;
    padding: 40px 24px 64px;
}

.auth-shell-wide .auth-card {
    max-width: 640px;
    margin: 0 auto;
}

    .auth-shell-wide .auth-card h2.auth-section-title {
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--auth-blue-bright);
        margin: 32px 0 4px;
        padding-top: 20px;
        border-top: 1px solid var(--auth-border);
    }

        .auth-shell-wide .auth-card h2.auth-section-title:first-of-type {
            margin-top: 0;
            padding-top: 0;
            border-top: none;
        }

.auth-shell-wide .auth-field-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 18px;
}

@media (min-width: 640px) {
    .auth-shell-wide .auth-field-grid.cols-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.auth-shell-wide select,
.auth-shell-wide textarea {
    width: 100%;
    background: var(--auth-input-bg);
    border: none;
    border-bottom: 1px solid var(--auth-border);
    border-radius: 0;
    padding: 9px 2px;
    font-size: 14.5px;
    color: #fff;
    font-family: inherit;
}

    .auth-shell-wide select:focus,
    .auth-shell-wide textarea:focus {
        outline: none;
        border-bottom-color: var(--auth-blue-bright);
    }

    .auth-shell-wide select option {
        color: #0a0e27;
    }

.auth-shell-wide .auth-field-hint {
    font-size: 12px;
    color: #6b7494;
    margin-top: 6px;
}

.auth-shell-wide .auth-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 0;
}

    .auth-shell-wide .auth-checkbox-row input {
        margin-top: 3px;
        accent-color: var(--auth-blue-bright);
    }

    .auth-shell-wide .auth-checkbox-row label {
        font-size: 13.5px;
        color: #dde3f5;
        font-weight: 500;
    }

/* ===== Dashboard-specific styles (Barangay/Municipal report views) ===== */

.page-container.wide {
    max-width: 1100px;
}

.dashboard-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 6px 14px;
    border-radius: 100px;
    background: #eef1f2;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
}

    .filter-tab.active {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

.report-row {
    display: flex;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    background: var(--card-bg);
    align-items: flex-start;
    text-decoration: none;
    color: var(--text);
}

    .report-row:hover {
        border-color: var(--primary);
    }

    .report-row.flagged {
        border-left: 4px solid var(--accent);
    }

    .report-row.critical-priority {
        border-left: 4px solid var(--accent);
    }

.report-row-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #eee;
}

.report-row-body {
    flex: 1;
    min-width: 0;
}

.report-row-title {
    font-weight: 700;
    margin: 0 0 4px 0;
}

.report-row-meta {
    font-size: 13px;
    color: var(--muted);
    margin: 2px 0;
}

.status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-submitted {
    background: #e3edf5;
    color: #1c4e7a;
}

.status-underreview {
    background: #fff8e1;
    color: #8a6d1d;
}

.status-verified {
    background: #e3f2ee;
    color: #1d6f5c;
}

.status-inprogress {
    background: #eee5fb;
    color: #5b34a3;
}

.status-resolved {
    background: #eafaf1;
    color: #1d6f42;
}

.status-rejected {
    background: #f1f1f1;
    color: #666;
}

.status-flaggedfraudulent {
    background: #c0392b;
    color: white;
}

.priority-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    margin-left: 6px;
}

.priority-1 {
    background: #c0392b;
    color: white;
}

.priority-2 {
    background: #f39c12;
    color: white;
}

.priority-3 {
    background: #eef1f2;
    color: var(--muted);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 16px 0;
}

    .detail-grid .full {
        grid-column: 1 / -1;
    }

.detail-label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
}

.detail-value {
    font-size: 15px;
}

@media (max-width: 700px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@keyframes authFadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Modernized visual layer ----------
   Applies to every auth page (login, register, forgot password,
   official login) since they all share these base .auth-* classes. */
.auth-brand-mark {
    position: relative;
    width: 48px;
    height: 48px;
}

    .auth-brand-mark::before {
        content: '';
        position: absolute;
        inset: -8px;
        border-radius: 16px;
        background: radial-gradient(circle, rgba(77,123,255,.4), transparent 72%);
        filter: blur(7px);
        z-index: -1;
    }

.auth-side-title,
.auth-side-desc,
.auth-side-features {
    opacity: 0;
    transform: translateY(8px);
    animation: authFadeUp .5s ease-out forwards;
}

.auth-side-title { animation-delay: .05s; }
.auth-side-desc { animation-delay: .12s; }
.auth-side-features { animation-delay: .19s; }

@media (min-width: 880px) {
    .auth-side {
        background:
            radial-gradient(ellipse 900px 500px at 0% 0%, rgba(77,123,255,.35), transparent 60%),
            radial-gradient(ellipse 700px 480px at 100% 100%, rgba(45,212,191,.1), transparent 60%),
            linear-gradient(160deg, var(--auth-navy) 0%, var(--auth-navy-deep) 100%);
    }

    .auth-form-side {
        background:
            radial-gradient(ellipse 800px 500px at 100% 0%, rgba(77,123,255,.08), transparent 60%),
            var(--auth-navy-deep);
    }
}

.auth-card {
    background: linear-gradient(160deg, rgba(255,255,255,.035), rgba(255,255,255,.015));
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.05);
    opacity: 0;
    transform: translateY(10px);
    animation: authFadeUp .5s ease-out .1s forwards;
}

.auth-input-wrap {
    position: relative;
}

    .auth-input-icon {
        position: absolute;
        left: 13px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--auth-text-dim);
        display: flex;
        pointer-events: none;
    }

.auth-field input {
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    padding: 11px 14px;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

    .auth-field input:focus {
        border-color: var(--auth-blue-bright);
        box-shadow: 0 0 0 3px rgba(77,123,255,.18);
    }

.auth-input-wrap input {
    padding-left: 40px;
}

.auth-remember input {
    width: 15px;
    height: 15px;
    border-radius: 4px;
}

.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(47,95,224,.35);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

    .auth-submit:hover {
        transform: translateY(-1px);
        box-shadow: 0 14px 30px rgba(47,95,224,.45);
        filter: brightness(1.06);
    }

    .auth-submit svg {
        transition: transform .15s ease;
    }

    .auth-submit:hover svg {
        transform: translateX(2px);
    }

/* Plain wrapper for auth-layout pages (login/register split-screen).
   No padding/max-width, since .auth-shell handles its own full-bleed
   layout and previously relied on cancelling .page-container's 20px
   padding via a negative margin -- this gives it an equivalent zero-
   padding baseline directly instead. */
.auth-main {
    display: block;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ---------- SOS trigger button + cancel overlay (citizen side) ---------- */
.sos-ring-wrap {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 24px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sos-ring {
    position: absolute;
    border-radius: 50%;
    border: 3px solid rgba(226, 72, 62, 0.55);
    background: transparent;
    animation: sosPulse 2.2s ease-out infinite;
}

.sos-ring-1 {
    width: 220px;
    height: 220px;
}

.sos-ring-2 {
    width: 220px;
    height: 220px;
    animation-delay: 1.1s;
}

@keyframes sosPulse {
    0% {
        transform: scale(0.72);
        opacity: 0.8;
    }

    70% {
        transform: scale(1.15);
        opacity: 0;
    }

    100% {
        transform: scale(1.15);
        opacity: 0;
    }
}
/* Success state: rings switch from red (hold-prompt) to green
   (confirmed/sent) and keep pulsing so the confirmation feels alive
   rather than static. */
.sos-ring-wrap.sos-sent .sos-ring {
    border-color: rgba(46, 125, 50, 0.6);
}

.sos-trigger-button {
    display: block;
    width: 180px;
    height: 180px;
    margin: 0 auto;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.4px;
    border: 8px solid var(--accent-dark);
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(226, 72, 62, 0.45);
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

    .sos-trigger-button:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .sos-trigger-button.sos-sent {
        /* Overrides the generic :disabled dimming above — this is a
     confirmation state, not a "you can't use this" state, so it
     should read as done/success rather than grayed-out/inactive. */
        opacity: 1;
        cursor: default;
        background: #2e7d32;
        border-color: #1b5e20;
        box-shadow: 0 10px 26px rgba(46, 125, 50, 0.45);
    }

    .sos-trigger-button .sos-hold-progress {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 0%;
        background: rgba(255,255,255,0.35);
        transition: none;
    }

    .sos-trigger-button .sos-btn-icon {
        position: relative;
        z-index: 2;
        display: block;
        margin-bottom: 6px;
    }

    .sos-trigger-button .sos-hold-label {
        position: relative;
        z-index: 2;
    }

.sos-cancel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(192, 57, 43, 0.97);
    color: white;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    text-align: center;
    padding: 20px;
}

    .sos-cancel-overlay h2 {
        font-size: 26px;
        margin-bottom: 10px;
    }

.sos-cancel-countdown {
    font-size: 64px;
    font-weight: 800;
    margin: 20px 0;
}

.sos-cancel-btn {
    background: white;
    color: #c0392b;
    border: none;
    padding: 14px 36px;
    border-radius: 100px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

/* ===== Citizen bottom navigation — removed =====
   The tab bar was replaced by the Home dashboard's quick-access grid
   (qa-tile) plus a back button on every drill-in page (see header.php
   $subPage). Kept out entirely to avoid duplicate entry points. */

/* Push page content up so it doesn't hide behind the nav */
main.page-container,
main.page-container.wide {
    padding-bottom: 24px;
}
/* For the full-bleed chat page specifically */
.citizen-chat-wrap {
    height: calc(100vh - 56px);
}

/* ---- Pending account banner (citizen side) ---- */
.citizen-pending-banner {
    background: #fef4e3;
    border: 1px solid #f3dba6;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.citizen-pending-banner-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.citizen-pending-banner-text {
    font-size: 13.5px;
    color: #7a5800;
}

    .citizen-pending-banner-text strong {
        display: block;
        font-size: 14.5px;
        margin-bottom: 3px;
    }

/* ---- Dashboard hero/profile card ---- */
.dash-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 22px;
    padding: 22px 20px;
    box-shadow: 0 8px 22px rgba(59, 111, 209, 0.28);
    margin-bottom: 14px;
    color: #ffffff;
}

.dash-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    border: 2px solid rgba(255,255,255,0.4);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    flex-shrink: 0;
    overflow: hidden;
}

    .dash-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.dash-hero-info {
    flex: 1;
    min-width: 0;
}

    .dash-hero-info h1 {
        color: #ffffff;
    }

.dash-hero-sub {
    margin: 3px 0 0;
    font-size: 13px;
    color: rgba(255,255,255,0.82);
    display: flex;
    align-items: center;
    gap: 4px;
}

.dash-status-pill {
    flex-shrink: 0;
    font-size: 11.5px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dash-status-active {
    background: rgba(255,255,255,0.22);
    color: #ffffff;
}

.dash-status-pending {
    background: #fff8e1;
    color: var(--warning);
}

.dash-status-suspended {
    background: #fdecea;
    color: var(--accent-dark);
}

/* ── Need-help CTA card (dashboard) ─────────────────────────────── */
.dash-help-card {
    background: linear-gradient(135deg, #ff6f61 0%, var(--accent) 60%, var(--accent-dark) 100%);
    border-radius: 22px;
    padding: 24px 20px 22px;
    text-align: center;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(226, 72, 62, 0.32);
    margin-bottom: 16px;
    text-decoration: none;
    display: block;
}

.dash-help-title {
    font-size: 18px;
    font-weight: 800;
    margin: 4px 0 4px;
}

.dash-help-sub {
    font-size: 12.5px;
    color: rgba(255,255,255,0.88);
    margin: 0 0 16px;
}

.dash-help-btn {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--accent-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 6px 16px rgba(0,0,0,0.18), 0 0 0 8px rgba(255,255,255,0.18);
}

.dash-help-locked {
    background: linear-gradient(135deg, #b6bccb 0%, #9aa1b3 100%);
    box-shadow: 0 8px 18px rgba(120,128,150,0.28);
}

/* ── Quick-action tile grid (dashboard) ─────────────────────────── */
.qa-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.qa-tile {
    flex: 1 1 calc(25% - 8px);
    min-width: 74px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 6px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform 0.12s, box-shadow 0.12s;
}

    .qa-tile:active {
        transform: scale(0.96);
    }

.qa-tile-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: rgba(59, 111, 209, 0.1);
}

.qa-tile-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    line-height: 1.25;
}

.qa-tile.qa-locked {
    opacity: 0.5;
    cursor: not-allowed;
}

    .qa-tile.qa-locked .qa-tile-icon {
        color: var(--muted);
        background: #eef0f5;
    }
