/* Guardian Network Mobile App */
:root {
    --navy: #0a1628;
    --navy-mid: #132743;
    --navy-light: #1a3a6b;
    --gold: #c9a227;
    --gold-light: #e8c84a;
    --white: #f8fafc;
    --muted: #94a3b8;
    --border: rgba(255,255,255,0.08);
    --success: #22c55e;
    --danger: #ef4444;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--navy);
    color: var(--white);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    line-height: 1.5;
}

.hidden { display: none !important; }

/* Screens */
.screen {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* Welcome */
.welcome-screen {
    background: radial-gradient(ellipse at top, var(--navy-light) 0%, var(--navy) 55%);
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    text-align: center;
}
.welcome-logo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    box-shadow: 0 0 50px rgba(201,162,39,0.25);
    margin-bottom: 1.5rem;
    animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 30px rgba(201,162,39,0.2); }
    50% { box-shadow: 0 0 60px rgba(201,162,39,0.4); }
}
.welcome-screen h1 { font-size: 1.35rem; font-weight: 800; margin-bottom: 0.35rem; }
.welcome-screen h1 span { color: var(--gold); display: block; font-size: 1rem; margin-top: 0.25rem; }
.welcome-motto { color: var(--muted); font-size: 0.85rem; margin-bottom: 2rem; font-style: italic; }
.welcome-actions { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 0.75rem; }

/* Auth */
.auth-screen { padding: 2rem 1.5rem; padding-top: calc(2rem + var(--safe-top)); }
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header img { width: 72px; height: 72px; border-radius: 50%; border: 2px solid var(--gold); margin-bottom: 1rem; }
.auth-header h2 { font-size: 1.2rem; }
.auth-header p { color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem; }

.account-type-cards { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }
.account-card {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--navy-mid);
}
.account-card.selected { border-color: var(--gold); background: rgba(201,162,39,0.08); }
.account-card .icon { font-size: 1.5rem; margin-bottom: 0.35rem; }
.account-card h3 { font-size: 0.95rem; margin-bottom: 0.25rem; }
.account-card p { font-size: 0.8rem; color: var(--muted); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.35rem; font-weight: 500; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--navy-mid);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--white);
    font-size: 1rem;
    font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--gold); }

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.9rem 1.5rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.15s;
}
.btn-primary { background: linear-gradient(135deg, var(--gold), #a8861e); color: var(--navy); }
.btn-primary:active { transform: scale(0.98); }
.btn-outline { background: transparent; border: 2px solid var(--gold); color: var(--gold); }
.btn-ghost { background: none; color: var(--muted); padding: 0.5rem; width: auto; font-weight: 500; }
.link { color: var(--gold); text-decoration: none; font-size: 0.85rem; font-weight: 600; }

.error-msg { background: rgba(239,68,68,0.15); border: 1px solid var(--danger); color: #fca5a5; padding: 0.75rem; border-radius: 8px; font-size: 0.85rem; margin-bottom: 1rem; }

/* Disclaimer */
.disclaimer-box {
    background: rgba(201,162,39,0.08);
    border: 1px solid rgba(201,162,39,0.3);
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1.5rem 0;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--muted);
}
.disclaimer-box h4 { color: var(--gold); font-size: 0.85rem; margin-bottom: 0.5rem; }
.disclaimer-box ul { padding-left: 1.25rem; margin-top: 0.5rem; }
.disclaimer-box li { margin-bottom: 0.35rem; }

/* App shell */
.app-shell { display: flex; flex-direction: column; min-height: 100dvh; }
.app-header {
    padding: 1rem 1.25rem;
    padding-top: calc(1rem + var(--safe-top));
    background: var(--navy-mid);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 50;
}
.app-header img { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--gold); }
.app-header h1 { font-size: 0.95rem; font-weight: 700; flex: 1; }
.app-header h1 span { color: var(--gold); font-size: 0.7rem; display: block; font-weight: 600; }
.notif-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
}
.notif-badge {
    position: absolute;
    top: -2px; right: -2px;
    background: var(--danger);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    width: 16px; height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-content { flex: 1; padding: 1rem 1.25rem; padding-bottom: calc(5rem + var(--safe-bottom)); overflow-y: auto; }

/* Bottom nav */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--navy-mid);
    border-top: 1px solid var(--border);
    display: flex;
    padding-bottom: var(--safe-bottom);
    z-index: 100;
}
.nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.65rem 0;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.nav-tab .icon { font-size: 1.25rem; }
.nav-tab.active { color: var(--gold); }

/* Alert cards */
.alert-card {
    background: var(--navy-mid);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 0.85rem;
    cursor: pointer;
    transition: transform 0.15s;
}
.alert-card:active { transform: scale(0.98); }
.alert-card.critical { border-left: 4px solid var(--danger); }
.alert-card.high { border-left: 4px solid #f97316; }
.alert-card.medium { border-left: 4px solid var(--gold); }
.alert-card.low { border-left: 4px solid var(--success); }
.alert-card-body { padding: 1rem; }
.alert-card .type { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gold); margin-bottom: 0.25rem; }
.alert-card h3 { font-size: 1rem; margin-bottom: 0.35rem; }
.alert-card .loc { font-size: 0.8rem; color: var(--muted); }
.alert-card .priority-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 0.5rem;
}
.priority-critical { background: rgba(220,38,38,0.2); color: #fca5a5; }
.priority-high { background: rgba(249,115,22,0.2); color: #fdba74; }
.priority-medium { background: rgba(201,162,39,0.2); color: var(--gold-light); }
.priority-low { background: rgba(34,197,94,0.2); color: #86efac; }

/* Alert detail */
.detail-hero { margin: -1rem -1.25rem 1rem; }
.detail-hero img { width: 100%; height: 200px; object-fit: cover; }
.detail-section { margin-bottom: 1.25rem; }
.detail-section h3 { font-size: 0.8rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.detail-section p { font-size: 0.9rem; color: var(--muted); line-height: 1.6; }
.media-scroll { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.5rem; }
.media-scroll img, .media-scroll video { height: 120px; border-radius: 8px; flex-shrink: 0; }
.media-scroll-item { flex-shrink: 0; max-width: 140px; }
.media-scroll-item img, .media-scroll-item video { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; display: block; }
.media-scroll-caption { font-size: 0.7rem; color: var(--gold); margin-top: 0.35rem; line-height: 1.3; }

/* Home */
.home-hero {
    text-align: center;
    padding: 1.5rem 1rem 1.25rem;
    background: linear-gradient(180deg, rgba(26,58,107,0.45) 0%, transparent 100%);
    border-radius: 16px;
    margin-bottom: 1rem;
}
.home-greeting {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
}
.home-name {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}
.home-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    object-fit: cover;
    margin-bottom: 0.85rem;
}
.home-avatar-placeholder {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--navy-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 0.85rem;
    border: 3px solid var(--gold);
}
.home-info-card {
    background: var(--navy-mid);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.home-info-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}
.home-info-row:last-child { border-bottom: none; }
.home-info-row .label { color: var(--muted); flex-shrink: 0; }
.home-info-row .value { text-align: right; color: var(--white); word-break: break-word; }

/* Profile manage */
.profile-manage-header {
    text-align: center;
    padding: 0.5rem 0 0;
}
.profile-photo-btn {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--gold);
    cursor: pointer;
}

/* Profile */
.profile-header { text-align: center; padding: 1.5rem 0; }
.profile-avatar {
    width: 80px; height: 80px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    object-fit: cover;
    margin-bottom: 0.75rem;
}
.profile-avatar-placeholder {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--navy-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 0.75rem;
    border: 3px solid var(--gold);
}
.account-badge {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 0.5rem;
}
.badge-general { background: rgba(148,163,184,0.2); color: var(--muted); }
.badge-sentinel { background: rgba(201,162,39,0.2); color: var(--gold-light); }
.badge-pending { background: rgba(245,158,11,0.2); color: #fcd34d; }

.menu-list { background: var(--navy-mid); border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    font-size: 0.9rem;
}
.menu-item:last-child { border-bottom: none; }
.menu-item .arrow { margin-left: auto; color: var(--muted); }

/* Notifications */
.notif-item {
    background: var(--navy-mid);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.65rem;
}
.notif-item.unread { border-left: 3px solid var(--gold); }
.notif-item h4 { font-size: 0.9rem; margin-bottom: 0.25rem; }
.notif-item p { font-size: 0.8rem; color: var(--muted); }
.notif-item .time { font-size: 0.7rem; color: var(--muted); margin-top: 0.35rem; }

/* Tip form */
.tip-form { background: var(--navy-mid); border-radius: 12px; padding: 1.25rem; border: 1px solid var(--border); }
.location-status { font-size: 0.8rem; color: var(--success); margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.35rem; }

/* Footer */
.mobile-footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.65rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
}
.mobile-footer strong { color: var(--gold); }

/* Urgent alert banner (AMBER / Critical) */
@keyframes urgentScreenFlash {
    0%, 100% { background-color: var(--navy); }
    50% { background-color: #450a0a; }
}
@keyframes urgentBannerPulse {
    0%, 100% { background: linear-gradient(90deg, #991b1b, #dc2626); }
    50% { background: linear-gradient(90deg, #dc2626, #ef4444); }
}
body.urgent-alert-active {
    animation: urgentScreenFlash 0.7s ease-in-out infinite;
}
.urgent-alert-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(90deg, #991b1b, #dc2626);
    border-bottom: 2px solid #fca5a5;
    cursor: pointer;
    animation: urgentBannerPulse 1s ease-in-out infinite;
}
.urgent-banner-icon { font-size: 1.4rem; flex-shrink: 0; }
.urgent-banner-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.urgent-banner-body strong {
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: #fecaca;
}
.urgent-banner-body span {
    font-size: 0.85rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.urgent-banner-action {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state .icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.5; }

.back-btn {
    background: none;
    border: none;
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 0;
    margin-bottom: 0.75rem;
    font-family: inherit;
}

/* Image lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(5, 10, 20, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.lightbox-content {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.lightbox-content img {
    max-width: 100%;
    max-height: calc(100vh - 7rem);
    object-fit: contain;
    border-radius: 8px;
}
.lightbox-caption {
    margin-top: 0.85rem;
    color: var(--white);
    font-size: 0.85rem;
    text-align: center;
    padding: 0 1rem;
    line-height: 1.4;
}
.lightbox-close {
    position: absolute;
    top: calc(0.75rem + var(--safe-top));
    right: 0.75rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10001;
}
.media-grid img,
.media-scroll img,
.media-scroll-item img,
.tip-card img,
.home-avatar,
.profile-avatar,
#verify-photo-preview img {
    cursor: zoom-in;
}
