/* ============================================================
   RapidAlert Citizen – Mobile App CSS
   Mobile-first design with emergency-grade high-contrast UI
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── Variables ────────────────────────────────────────────── */
:root {
    --bg: #090b10;
    --bg2: #12151c;
    --bg3: #1a1f2e;
    --border: rgba(255, 255, 255, 0.08);
    --text: #f0f3f6;
    --text2: rgba(255, 255, 255, 0.6);
    --brand: #e84141;
    --online: #22c55e;
    --warning: #f59e0b;
    --info: #3b82f6;
    --r: 20px;
    --safe-max: 430px;
    --glass: rgba(240, 243, 246, 0.03);
}


/* ── Reset ────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    min-height: 100vh;
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
    border: none;
    font-family: inherit;
    outline: none;
}

input,
textarea {
    font-family: inherit;
    outline: none;
}

/* ── App Shell ────────────────────────────────────────────── */
#app-root {
    max-width: var(--safe-max);
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: 80px;
    /* space for bottom tab bar */
    position: relative;
}

/* ── Header ───────────────────────────────────────────────── */
.app-header {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header.header-emergency {
    background: rgba(239, 68, 68, 0.15);
    border-bottom-color: rgba(239, 68, 68, 0.5);
    animation: headerPulse 1.5s infinite;
}

@keyframes headerPulse {

    0%,
    100% {
        border-bottom-color: rgba(239, 68, 68, 0.3);
    }

    50% {
        border-bottom-color: rgba(239, 68, 68, 0.9);
    }
}

.header-brand {
    font-size: 18px;
    font-weight: 800;
    color: var(--brand);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--text2);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--online);
}

.status-dot.pulse {
    background: var(--brand);
    animation: dotPulse 1s infinite;
}

@keyframes dotPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
}

/* ── Permission Banner ────────────────────────────────────── */
.perm-banner {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 0;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--warning);
    gap: 10px;
}

.perm-btn {
    background: var(--warning);
    color: #000;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* ── SOS Strip ────────────────────────────────────────────── */
.sos-strip {
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
    border: 1px solid rgba(239, 68, 68, 0.4);
    margin: 12px;
    border-radius: var(--r);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 700;
    color: #fca5a5;
    cursor: pointer;
    user-select: none;
    transition: 0.2s;
}

.sos-strip:active {
    transform: scale(0.98);
    background: #991b1b;
}

/* ── Section Header ───────────────────────────────────────── */
.section-header {
    padding: 8px 16px 10px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
}

.section-sub {
    font-size: 12px;
    color: var(--text2);
    margin-top: 2px;
}

/* ── Alert Card ───────────────────────────────────────────── */
.alert-card {
    margin: 0 16px 14px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 16px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg2);
    backdrop-filter: blur(10px);
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.alert-card:active {
    transform: scale(0.975);
    background: var(--bg3);
}


.ac-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.ac-type {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.ac-icon {
    font-size: 24px;
    line-height: 1;
}

.ac-title {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ac-area {
    font-size: 12px;
    color: var(--text2);
    margin-top: 2px;
}

.ac-sev {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.ac-msg {
    font-size: 13px;
    color: var(--text2);
    line-height: 1.6;
    margin-bottom: 10px;
}

.ac-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ac-time {
    font-size: 12px;
    color: var(--text2);
}

.drill-tag {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.3);
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.safe-chip {
    background: rgba(34, 197, 94, 0.1);
    color: var(--online);
    border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.safe-mini-btn {
    background: rgba(34, 197, 94, 0.1);
    color: var(--online);
    border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

/* ── Empty State ──────────────────────────────────────────── */
.empty-card {
    margin: 40px 16px;
    text-align: center;
    color: var(--text2);
}

.empty-icon {
    font-size: 52px;
    margin-bottom: 14px;
}

.empty-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.empty-sub {
    font-size: 13px;
}

/* ── Test Buttons ─────────────────────────────────────────── */
.test-alarm-btn {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: var(--info);
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    width: calc(100% - 32px);
}

/* ── ALARM OVERLAY ────────────────────────────────────────── */
#alarm-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    animation: alarmIn 0.3s ease;
}

@keyframes alarmIn {
    from {
        opacity: 0;
        transform: scale(1.05);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.alarm-fade-out {
    animation: alarmOut 0.4s ease forwards;
}

@keyframes alarmOut {
    to {
        opacity: 0;
        transform: scale(0.96);
    }
}

.alarm-bg {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(6px);
    background: rgba(13, 17, 23, 0.93);
}

.alarm-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 30px 24px;
    max-width: 400px;
    width: 100%;
}

/* Pulsing rings behind icon */
.alarm-pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 3px solid rgba(239, 68, 68, 0.4);
    animation: ringPulse 1.2s ease-out infinite;
}

@keyframes ringPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* ── Intensity Layers ── */
.alarm-intensity-emergency .alarm-flash-layer {
    position: absolute;
    inset: 0;
    background: rgba(239, 68, 68, 0.2);
    animation: flashEmergency 0.5s infinite;
    pointer-events: none;
}

.alarm-intensity-evacuate .alarm-flash-layer {
    position: absolute;
    inset: 0;
    background: rgba(239, 68, 68, 0.4);
    animation: flashEvacuate 0.25s infinite;
    pointer-events: none;
}

@keyframes flashEmergency {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

@keyframes flashEvacuate {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

.alarm-icon {
    font-size: 72px;
    margin-bottom: 10px;
    position: relative;
}

.alarm-severity {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.alarm-drill-badge {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.5);
    color: var(--info);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 8px;
}

.alarm-type {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 6px;
}

.alarm-area {
    font-size: 14px;
    color: var(--text2);
    margin-bottom: 12px;
}

.alarm-message {
    font-size: 15px;
    color: var(--text);
    line-height: 1.7;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.alarm-time {
    font-size: 12px;
    color: var(--text2);
    margin-bottom: 24px;
}

.alarm-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.alarm-btn {
    flex: 1;
    padding: 16px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 800;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    transition: 0.15s;
}

.alarm-btn:active {
    transform: scale(0.97);
}

.safe-btn {
    background: rgba(34, 197, 94, 0.15);
    color: var(--online);
    border: 2px solid var(--online);
}

.sos-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 2px solid #ef4444;
}

.alarm-dismiss {
    background: transparent;
    color: var(--text2);
    font-size: 13px;
    text-decoration: underline;
    padding: 8px;
}

/* ── DETAIL VIEW ──────────────────────────────────────────── */
.detail-header {
    padding: 50px 16px 20px;
    background: var(--bg2);
    position: relative;
}

.detail-type {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
}

.detail-title {
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-sev {
    font-size: 14px;
    font-weight: 700;
}

.detail-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 14px;
}

.detail-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.detail-message {
    font-size: 15px;
    line-height: 1.75;
}

.detail-value {
    font-size: 14px;
}

.detail-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mono {
    font-family: monospace;
    font-size: 12.5px;
    color: var(--text2);
}

.evac-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.evac-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    line-height: 1.5;
}

.evac-num {
    min-width: 24px;
    height: 24px;
    background: var(--brand);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.helpline-card {
    display: flex;
    flex-direction: column;
}

.helpline-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.helpline-row:last-child {
    border-bottom: none;
}

.helpline-row strong {
    font-size: 18px;
    font-weight: 800;
    color: var(--brand);
}

.detail-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.daction-btn {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    transition: 0.15s;
}

.daction-btn:active {
    transform: scale(0.98);
}

.daction-btn.safe {
    background: rgba(34, 197, 94, 0.12);
    color: var(--online);
    border: 1.5px solid rgba(34, 197, 94, 0.4);
}

.daction-btn.sos {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1.5px solid rgba(239, 68, 68, 0.4);
}

.daction-btn.share {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
    border: 1.5px solid rgba(59, 130, 246, 0.3);
}

.safe-reported {
    text-align: center;
    font-size: 14px;
    color: var(--online);
    font-weight: 600;
    padding: 12px;
    background: rgba(34, 197, 94, 0.08);
    border-radius: 10px;
}

/* ── SOS VIEW ─────────────────────────────────────────────── */
.sos-view {
    background: #0d0506;
    min-height: 100vh;
}

.sos-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(239, 68, 68, 0.1);
    border-bottom: 1px solid rgba(239, 68, 68, 0.3);
}

.sos-title {
    font-size: 18px;
    font-weight: 800;
    color: #f87171;
}

.sos-panic-area {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 20px 30px;
    position: relative;
}

/* Animated rings */
.sos-ring-1,
.sos-ring-2,
.sos-ring-3 {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(239, 68, 68, 0.3);
    animation: sosRing 2s ease-out infinite;
}

.sos-ring-1 {
    width: 160px;
    height: 160px;
    animation-delay: 0s;
}

.sos-ring-2 {
    width: 200px;
    height: 200px;
    animation-delay: 0.5s;
}

.sos-ring-3 {
    width: 240px;
    height: 240px;
    animation-delay: 1s;
}

@keyframes sosRing {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* SOS Panic Button Upgrade */
.sos-panic-btn {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e11d48, #9f1239);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 10px solid rgba(225, 29, 72, 0.15);
    box-shadow: 0 0 50px rgba(225, 29, 72, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 5;
    animation: sosPulse 2s infinite;
}

@keyframes sosPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.7);
    }

    70% {
        box-shadow: 0 0 0 25px rgba(225, 29, 72, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(225, 29, 72, 0);
    }
}

.sos-panic-btn:active {
    transform: scale(0.9);
    filter: brightness(1.2);
}

.sos-panic-btn.loading {
    animation: sosLoading 0.5s infinite alternate;
}

@keyframes sosLoading {
    from {
        opacity: 0.7;
        transform: scale(1);
    }

    to {
        opacity: 1;
        transform: scale(1.08);
    }
}

.sos-form-area {
    padding: 0 16px 24px;
}

.sos-form-label {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.sos-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    padding: 12px 14px;
    font-size: 15px;
}

.sos-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.sos-loc-status {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.5);
    margin: 10px 0;
}

.sos-send-full-btn {
    width: 100%;
    background: linear-gradient(135deg, #b91c1c, #7f1d1d);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 16px;
    font-weight: 800;
    margin-top: 12px;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.sos-confirm-card {
    text-align: center;
    padding: 40px 24px;
    background: rgba(34, 197, 94, 0.06);
    margin: 16px;
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 16px;
}

.sos-confirm-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--online);
    margin-bottom: 12px;
}

.sos-confirm-msg {
    font-size: 14px;
    color: var(--text2);
    line-height: 1.7;
}

.sos-confirm-back {
    background: var(--bg3);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 20px;
}

/* ── Back button ──────────────────────────────────────────── */
.back-btn {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    /* Removed position:absolute — now flows naturally in sticky header flex row */
    flex-shrink: 0;
}

.back-btn:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.96);
}

/* ── Settings ─────────────────────────────────────────────── */
.settings-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 14px;
}

.settings-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.settings-row:last-child {
    border-bottom: none;
}

/* ── Bottom Tab Bar ───────────────────────────────────────── */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: var(--safe-max);
    margin: 0 auto;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 200;
    height: 70px;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text2);
    cursor: pointer;
    transition: 0.15s;
    padding: 8px 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.tab-item .ti {
    font-size: 22px;
}

.tab-item.active {
    color: var(--brand);
}

.tab-item:active {
    transform: scale(0.95);
}

/* ── Toast ────────────────────────────────────────────────── */
#toast-container {
    position: fixed;
    top: 70px;
    right: 12px;
    left: 12px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.app-toast {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    gap: 10px;
    align-items: center;
    animation: toastIn 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

@keyframes toastIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.app-toast.out {
    animation: toastOut 0.4s ease forwards;
}

@keyframes toastOut {
    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}

.app-toast.success {
    border-color: rgba(34, 197, 94, 0.5);
}

.app-toast.error {
    border-color: rgba(239, 68, 68, 0.5);
}

.app-toast.warning {
    border-color: rgba(245, 158, 11, 0.5);
}

.app-toast.info {
    border-color: rgba(59, 130, 246, 0.5);
}

/* ── Splash Screen ────────────────────────────────────────── */
#splash {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease;
}

.splash-logo {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #b91c1c, #7c3aed);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(185, 28, 28, 0.4);
    animation: splashBounce 0.6s ease;
}

@keyframes splashBounce {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    70% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

.splash-title {
    font-size: 28px;
    font-weight: 900;
    color: var(--brand);
}

.splash-sub {
    font-size: 14px;
    color: var(--text2);
    margin-top: 6px;
}

.splash-bar {
    margin-top: 40px;
    width: 120px;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.splash-bar-fill {
    height: 100%;
    background: var(--brand);
    border-radius: 2px;
    animation: splashLoad 1.5s ease forwards;
}

@keyframes splashLoad {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

/* ============================================================
   AUTH SCREEN – Mobile OTP Login
   ============================================================ */
.auth-screen {
    min-height: 100vh;
    background: var(--bg);
    padding-bottom: 40px;
}

.auth-hero {
    text-align: center;
    padding: 48px 20px 20px;
    background: linear-gradient(180deg, rgba(232, 65, 65, 0.08) 0%, transparent 100%);
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.auth-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #b91c1c, #7c3aed);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 14px;
    box-shadow: 0 8px 32px rgba(185, 28, 28, 0.35);
}

.auth-title {
    font-size: 28px;
    font-weight: 900;
    color: var(--brand);
    letter-spacing: -0.5px;
}

.auth-sub {
    font-size: 13px;
    color: var(--text2);
    margin-top: 4px;
}

.auth-tagline {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 8px;
    font-style: italic;
}

.auth-card {
    margin: 0 14px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px 18px;
}

.auth-step-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.auth-desc {
    font-size: 13px;
    color: var(--text2);
    line-height: 1.6;
    margin-bottom: 16px;
}

/* Phone field with prefix */
.auth-field-wrap {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    transition: 0.2s;
}

.auth-field-wrap:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(232, 65, 65, 0.15);
}

.phone-prefix {
    padding: 0 14px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text2);
    border-right: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    height: 50px;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.auth-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 16px;
    padding: 14px;
    font-family: inherit;
    width: 100%;
}

.auth-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

/* Standalone auth-input (not in field-wrap) */
.auth-field-group .auth-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 15px;
    width: 100%;
    margin-top: 0;
}

.auth-field-group .auth-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(232, 65, 65, 0.15);
}

.auth-field-group {
    margin-bottom: 12px;
}

.auth-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

/* Auth button */
.auth-btn {
    width: 100%;
    background: linear-gradient(135deg, #e84141, #b91c1c);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 15px;
    font-size: 16px;
    font-weight: 800;
    margin-top: 10px;
    box-shadow: 0 4px 18px rgba(232, 65, 65, 0.4);
    transition: 0.15s;
}

.auth-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(232, 65, 65, 0.3);
}

/* Error message */
.auth-error {
    font-size: 13px;
    color: #f87171;
    min-height: 18px;
    margin-bottom: 4px;
}

/* OTP sent info */
.otp-sent-to {
    font-size: 14px;
    color: var(--text2);
    margin-bottom: 14px;
    background: rgba(255, 255, 255, 0.04);
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 3px solid var(--brand);
}

/* Demo OTP box */
.demo-otp-box {
    background: rgba(245, 158, 11, 0.08);
    border: 1px dashed rgba(245, 158, 11, 0.4);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
    text-align: center;
}

.demo-otp-code {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 8px;
    color: var(--warning);
    font-family: monospace;
}

/* OTP 6-box input */
.otp-boxes {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 14px;
}

.otp-box {
    width: 44px;
    height: 52px;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid var(--border);
    border-radius: 10px;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    outline: none;
    transition: 0.15s;
    font-family: monospace;
}

.otp-box:focus {
    border-color: var(--brand);
    background: rgba(232, 65, 65, 0.08);
    box-shadow: 0 0 0 3px rgba(232, 65, 65, 0.15);
}

/* Shake animation on wrong OTP */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-5px);
    }

    80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.45s ease;
}

/* Resend / change number */
.resend-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.resend-btn {
    background: transparent;
    color: var(--text2);
    font-size: 13px;
    font-family: inherit;
    padding: 6px 0;
}

.resend-btn:disabled {
    opacity: 0.5;
}

.resend-btn:not(:disabled) {
    color: var(--info);
    text-decoration: underline;
}

.change-phone-btn {
    background: transparent;
    color: var(--text2);
    font-size: 13px;
    font-family: inherit;
    padding: 6px 0;
    text-decoration: underline;
}

/* Auth note */
.auth-note {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 16px;
    line-height: 1.6;
    text-align: center;
}

/* Verified badge on SOS in admin */
.verified-badge {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
}

/* ── Back Button ──────────────────────────────────────────── */
.back-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    font-weight: 600;
    padding: 8px;
    min-width: 44px;
    border-radius: 8px;
    transition: background 0.15s;
}

.back-btn:active {
    background: rgba(255, 255, 255, 0.08);
}

/* ── Settings View ─────────────────────────────────────────── */
.settings-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
}

.settings-row:last-child {
    border-bottom: none;
}

/* ── App Toast ────────────────────────────────────────────── */
.app-toast {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.3s ease;
    max-width: 340px;
}

.app-toast.out {
    animation: toastOut 0.4s ease forwards;
}

.app-toast.success {
    border-color: rgba(34, 197, 94, 0.4);
}

.app-toast.error {
    border-color: rgba(239, 68, 68, 0.4);
}

.app-toast.warning {
    border-color: rgba(245, 158, 11, 0.4);
}

#toast-container {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    width: 92%;
    max-width: 400px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

/* ── Leaflet Map Fixes ────────────────────────────────────── */
#citizen-map {
    background: #0d1117;
    min-height: 220px;
}

#citizen-map .leaflet-tile-container img {
    border-radius: 0 !important;
}

#citizen-map .leaflet-popup-content-wrapper {
    background: #1a1f2e;
    color: #f0f3f6;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

#citizen-map .leaflet-popup-content {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    margin: 10px 14px;
}

#citizen-map .leaflet-popup-tip {
    background: #1a1f2e;
}

#citizen-map .leaflet-popup-close-button {
    color: rgba(255, 255, 255, 0.5) !important;
}

#citizen-map .leaflet-control-zoom a {
    background: #1a1f2e;
    color: #f0f3f6;
    border-color: rgba(255, 255, 255, 0.1);
}

#citizen-map .leaflet-control-zoom a:hover {
    background: #252b3b;
}