/* ==========================================================================
   WiFi-Mtaani — mobile app styles (Android WebView first)
   Colours are the original WiFi-Mtaani palette.
   ========================================================================== */
:root {
    --primary-deep: #116277;
    --primary-dark: #1C4E5C;
    --warm-sand: #F5D97B;
    --warm-gold: #ECC663;
    --warm-honey: #F5C542;
    --bg-soft-light: #E5F2F7;
    --bg-soft: #D1E5EF;
    --surface: #ffffff;
    --text-dark: #1C4E5C;
    --text-soft: #4a6a7a;
    --text-light: #6b7b8b;
    --border-warm: rgba(245, 217, 123, 0.35);
    --line: #DCE9EF;
    --shadow-warm: rgba(17, 98, 119, 0.10);
    --gradient-warm: linear-gradient(145deg, #F5D97B 0%, #F5C542 100%);
    --gradient-deep: linear-gradient(145deg, #116277 0%, #1C4E5C 100%);
    --gradient-soft: linear-gradient(145deg, #E5F2F7 0%, #D1E5EF 100%);
    --good: #4CAF50;
    --moderate: #F5C542;
    --warning: #ff9800;
    --critical: #f44336;

    --radius: 18px;
    --radius-sm: 12px;
    --nav-h: 64px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
    --shadow: 0 6px 20px rgba(17, 98, 119, .10);
    --shadow-lg: 0 18px 50px rgba(17, 98, 119, .22);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px; line-height: 1.45;
    color: var(--text-dark);
    background: var(--gradient-soft);
    min-height: 100vh; min-height: 100dvh;
    overscroll-behavior-y: none;
}
a { color: var(--primary-deep); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: .92em; letter-spacing: .01em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--warm-honey); outline-offset: 2px; }

.app {
    max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
    background: var(--bg-soft-light); position: relative;
    box-shadow: 0 0 40px var(--shadow-warm);
}
body.has-nav .app { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 8px); }
.content { padding: 16px; }
.content-flush { padding: 0; }

/* ---------- Top app bar ---------- */
.appbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 4px;
    min-height: 60px; padding: calc(var(--safe-t) + 6px) 8px 6px;
    background: var(--gradient-deep); color: #fff;
    border-bottom: 3px solid var(--warm-sand);
}
.appbar-title { flex: 1; font-size: 1.05rem; font-weight: 600; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-btn, .appbar .icon-btn { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: 1.1rem; }
.appbar-btn:active, .appbar .icon-btn:active { background: rgba(255,255,255,.15); }
.appbar-actions { display: flex; }

/* ---------- Home hero ---------- */
.hero {
    background: var(--gradient-deep); color: #fff;
    padding: calc(var(--safe-t) + 18px) 18px 64px;
    border-bottom-left-radius: 28px; border-bottom-right-radius: 28px;
    position: relative; overflow: hidden;
}
.hero::after {
    content: ''; position: absolute; right: -60px; top: -70px; width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle, rgba(245,197,66,.28) 0%, rgba(245,197,66,0) 70%);
}
.hero-row { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.hero-hello { flex: 1; }
.hero-hello small { display: block; opacity: .8; font-size: .85rem; }
.hero-hello h1 { font-size: 1.3rem; font-weight: 600; line-height: 1.25; }
.avatar {
    width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none;
    background: var(--gradient-warm); color: var(--primary-deep); font-weight: 700; font-size: 1rem;
    box-shadow: 0 0 0 3px rgba(255,255,255,.18);
}
.avatar-lg { width: 76px; height: 76px; font-size: 1.6rem; }

.status-card {
    margin: -48px 16px 0; position: relative; z-index: 2;
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: 18px;
}
.status-top { display: flex; align-items: center; gap: 14px; }
.status-ring {
    --p: 0; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center;
    background: conic-gradient(var(--good) calc(var(--p) * 1%), var(--bg-soft) 0);
}
.status-ring span { width: 50px; height: 50px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.05rem; }
.status-text { flex: 1; min-width: 0; }
.status-text strong { display: block; font-size: 1.05rem; }
.status-text small { color: var(--text-soft); display: block; }
.status-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.status-actions .btn { padding: 0 10px; white-space: nowrap; font-size: .92rem; }

/* ---------- Sections ---------- */
.section { margin-top: 22px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 10px; }
.section-head h2 { font-size: 1rem; font-weight: 600; }
.section-head a, .section-head button { font-size: .88rem; font-weight: 500; color: var(--primary-deep); padding: 6px 4px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px; }
.stack { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.stack-sm { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }

/* ---------- Device rows ---------- */
.device {
    display: flex; align-items: center; gap: 12px;
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 14px; border-left: 4px solid transparent;
}
.device.is-on { border-left-color: var(--good); }
.device-icon {
    width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center; font-size: 1.15rem;
    background: var(--bg-soft-light); color: var(--primary-deep);
}
.device.is-on .device-icon { background: rgba(76,175,80,.12); color: #2E7D32; }
.device-body { flex: 1; min-width: 0; }
.device-top { display: flex; align-items: center; gap: 8px; }
.device-name { font-size: .98rem; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device-meta { font-size: .8rem; color: var(--text-soft); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device-meta.mono { font-size: .76rem; }
.countdown { font-weight: 600; color: var(--text-dark); font-variant-numeric: tabular-nums; }
.meter { height: 6px; background: var(--bg-soft); border-radius: 99px; margin-top: 8px; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--good); transition: width .6s ease, background .3s; }
.device.lvl-moderate .meter span { background: var(--moderate); }
.device.lvl-warning .meter span { background: var(--warning); }
.device.lvl-critical .meter span { background: var(--critical); }
.device.lvl-critical .countdown { color: var(--critical); }
.device.lvl-warning .countdown { color: #c77700; }

.chip { font-size: .7rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; letter-spacing: .02em; }
.chip-on { background: rgba(76,175,80,.14); color: #2E7D32; }
.chip-off { background: var(--bg-soft-light); color: var(--text-light); }

.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--text-soft); flex: none; }
.icon-btn:active { background: var(--bg-soft-light); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 20px; border-radius: 14px;
    font-weight: 600; font-size: .95rem; text-align: center; line-height: 1.2;
    transition: transform .08s ease, filter .15s, opacity .15s; user-select: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled, .btn.is-loading { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--gradient-warm); color: var(--primary-deep); box-shadow: 0 6px 16px rgba(245,197,66,.35); }
.btn-deep { background: var(--gradient-deep); color: #fff; box-shadow: 0 6px 16px rgba(17,98,119,.25); }
.btn-secondary { background: var(--bg-soft-light); color: var(--primary-deep); }
.btn-ghost { color: var(--primary-deep); }
.btn-danger { background: #fdecea; color: #c62828; }
.btn-warm { background: var(--gradient-warm); color: var(--primary-deep); }
.btn-block { width: 100%; }
.btn-lg { min-height: 50px; font-size: .95rem; }
.btn-sm { min-height: 36px; padding: 0 14px; border-radius: 10px; font-size: .85rem; }
.btn .fa-spinner { animation: spin 1s linear infinite; }

/* ---------- Quick tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile {
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px;
    background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); font-size: .75rem; font-weight: 500; color: var(--text-dark); text-align: center;
}
.tile i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-soft-light); color: var(--primary-deep); font-size: 1rem; }
.tile:active { transform: scale(.97); }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: 6px; color: var(--text-dark); }
.field-label small { color: var(--text-light); font-weight: 400; }
.field-input { position: relative; display: block; }
.field-input > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-light); pointer-events: none; font-size: .95rem; }
.field input, .field select, .field textarea {
    width: 100%; min-height: 48px; padding: 10px 14px; font-size: 16px;
    background: #fff; border: 1.5px solid var(--line); border-radius: 14px; outline: none;
    transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
.field-input > i ~ input, .field-input > i ~ select { padding-left: 46px; }
.field textarea { min-height: 120px; resize: vertical; }
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--text-soft) 50%), linear-gradient(135deg, var(--text-soft) 50%, transparent 50%);
    background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary-deep); box-shadow: 0 0 0 4px rgba(17,98,119,.12); }
.field.has-error input, .field.has-error select { border-color: var(--critical); }
.field-error { display: block; color: #c62828; font-size: .8rem; margin-top: 5px; }
.field-hint { display: block; color: var(--text-light); font-size: .8rem; margin-top: 5px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 52px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; color: var(--text-light); }
.check-line { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--text-soft); margin: 4px 0 16px; }
.check-line input { width: 22px; height: 22px; accent-color: var(--primary-deep); flex: none; margin-top: 1px; }
.form-error { background: #fdecea; color: #b3261e; border-radius: 12px; padding: 10px 14px; font-size: .88rem; margin: 4px 0 12px; }
.hint { color: var(--text-light); font-size: .82rem; }

.note { border-radius: 14px; padding: 12px 14px; font-size: .9rem; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }
.note i { margin-top: 3px; }
.note-success { background: #e8f5e9; color: #1b5e20; }
.note-error { background: #fdecea; color: #b3261e; }
.note-info { background: #fff; color: var(--primary-dark); box-shadow: var(--shadow); border-left: 4px solid var(--primary-deep); }
.note-warn { background: #fff6dc; color: #7a5a00; }

/* ---------- Bottom navigation ---------- */
.bottomnav {
    position: fixed; z-index: 40; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 520px; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(17,98,119,.08);
}
.bn-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-light); font-size: .7rem; font-weight: 500; }
.bn-icon { width: 56px; height: 30px; border-radius: 99px; display: grid; place-items: center; font-size: 1.05rem; transition: background .2s; }
.bn-item.active { color: var(--primary-deep); }
.bn-item.active .bn-icon { background: rgba(17,98,119,.12); }
.bn-buy .bn-icon {
    width: 54px; height: 54px; margin-top: -26px; border-radius: 50%;
    background: var(--gradient-warm); color: var(--primary-deep); font-size: 1.25rem;
    box-shadow: 0 6px 16px rgba(245,197,66,.5), 0 0 0 5px #fff;
}
.bn-buy.active .bn-icon { background: var(--gradient-warm); }

/* ---------- Bottom sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(12, 40, 48, .45); opacity: 0; transition: opacity .25s; }
.sheet-panel {
    position: relative; width: 100%; max-width: 520px; max-height: 92vh; max-height: 92dvh;
    background: #fff; border-radius: 24px 24px 0 0; box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column; transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
    padding-bottom: var(--safe-b); outline: none;
}
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet.open .sheet-panel { transform: translateY(0); }
.sheet-handle { width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin: 10px auto 2px; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 4px; padding: 2px 8px 6px 16px; flex: none; }
.sheet-head h2 { flex: 1; font-size: 1.02rem; font-weight: 600; }
.sheet-head [data-sheet-back]:not([hidden]) + h2 { padding-left: 0; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 16px 16px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-lead { color: var(--text-soft); font-size: .92rem; margin-bottom: 14px; }
.sheet-foot { position: sticky; bottom: -16px; background: linear-gradient(rgba(255,255,255,0), #fff 30%); padding: 18px 0 16px; margin-bottom: -16px; }
body.sheet-open { overflow: hidden; }

.steps { list-style: none; display: flex; gap: 6px; margin: 0 0 16px; }
.steps li { flex: 1; display: flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--text-light); font-weight: 500;
    padding-bottom: 8px; border-bottom: 3px solid var(--line); }
.steps li span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--line); font-size: .7rem; color: var(--text-soft); }
.steps li.active, .steps li.done { color: var(--primary-deep); border-bottom-color: var(--warm-honey); }
.steps li.active span, .steps li.done span { background: var(--primary-deep); color: #fff; }

.checklist { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.check-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.check-item input { position: absolute; opacity: 0; pointer-events: none; }
.check-box { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; flex: none; font-size: .75rem; transition: all .15s; }
.check-text { flex: 1; min-width: 0; }
.check-text strong { display: block; font-weight: 600; font-size: .95rem; }
.check-text small { display: block; color: var(--text-light); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.check-icon { color: var(--text-light); }
.check-item:has(input:checked) { border-color: var(--primary-deep); background: rgba(17,98,119,.05); }
.check-item.is-checked { border-color: var(--primary-deep); background: rgba(17,98,119,.05); }
.check-item input:checked + .check-box, .check-item.is-checked .check-box { background: var(--primary-deep); border-color: var(--primary-deep); color: #fff; }
.check-item.is-disabled { opacity: .55; cursor: not-allowed; }

.plans { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.plan {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
    padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 16px; background: #fff; transition: border-color .15s, transform .08s;
}
.plan:active { transform: scale(.99); }
.plan:hover { border-color: var(--warm-gold); }
.plan-info { flex: 1; }
.plan-info strong { display: block; font-weight: 600; }
.plan-info small { color: var(--text-soft); }
.plan-price { font-weight: 700; font-size: 1.1rem; color: var(--primary-deep); white-space: nowrap; }
.plan-price small { font-size: .7rem; font-weight: 500; color: var(--text-light); margin-right: 2px; }
.badge-best { display: inline-block; margin-left: 6px; font-size: .62rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--gradient-warm); color: var(--primary-deep); vertical-align: 2px; }

.summary { background: var(--bg-soft-light); border-radius: 16px; padding: 6px 16px; margin-bottom: 16px; }
.summary > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--bg-soft); font-size: .9rem; }
.summary > div:last-child { border-bottom: 0; }
.summary span { color: var(--text-soft); }
.summary strong { text-align: right; }
.summary-total strong { font-size: 1.15rem; color: var(--primary-deep); }

.state { text-align: center; padding: 10px 6px 0; }
.state h3 { font-size: 1.1rem; margin: 12px 0 6px; }
.state p { color: var(--text-soft); font-size: .92rem; }
.state-icon { width: 76px; height: 76px; margin: 6px auto 0; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem;
    background: rgba(76,175,80,.14); color: #2E7D32; animation: pop .35s ease; }
.state-icon.is-wait { background: rgba(245,197,66,.22); color: var(--primary-deep); animation: pulse 1.6s ease-in-out infinite; }
.state-icon.is-error { background: #fdecea; color: #c62828; }
.progress-dots { display: flex; justify-content: center; gap: 6px; margin: 18px 0 8px; }
.progress-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--warm-honey); animation: dot 1.2s infinite ease-in-out; }
.progress-dots span:nth-child(2) { animation-delay: .15s; } .progress-dots span:nth-child(3) { animation-delay: .3s; }

.suggest { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; margin-bottom: 14px; border-radius: 14px; text-align: left;
    background: rgba(245,197,66,.16); border: 1.5px dashed var(--warm-gold); }
.suggest > i { color: var(--primary-deep); font-size: 1.1rem; }
.suggest span { flex: 1; } .suggest strong { display: block; font-size: .9rem; } .suggest small { font-family: ui-monospace, Menlo, monospace; color: var(--text-soft); }
.suggest em { font-style: normal; font-weight: 600; color: var(--primary-deep); }
details.help { background: var(--bg-soft-light); border-radius: 12px; padding: 0 14px; margin: -4px 0 14px; font-size: .85rem; color: var(--text-soft); }
details.help summary { list-style: none; padding: 11px 0; cursor: pointer; color: var(--primary-deep); font-weight: 500; }
details.help summary::-webkit-details-marker { display: none; }
details.help ul { padding-left: 18px; margin-bottom: 8px; } details.help li { margin-bottom: 4px; } details.help p { padding-bottom: 12px; }

.device-sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.device-sheet-head strong { display: block; } .device-sheet-head small { display: block; color: var(--text-light); }
.rename { padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-list { display: grid; }
.menu-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 4px; text-align: left; border-bottom: 1px solid var(--bg-soft-light); }
.menu-item > i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-soft-light); color: var(--primary-deep); flex: none; }
.menu-item span { flex: 1; font-weight: 500; } .menu-item small { display: block; font-weight: 400; color: var(--text-light); font-size: .8rem; }
.menu-item.danger { color: #c62828; } .menu-item.danger > i { background: #fdecea; color: #c62828; }
.menu-item > i.chev { width: auto; height: auto; background: none; color: var(--text-light); font-size: .8rem; }
a.menu-item { color: inherit; }

/* ---------- Lists / empty ---------- */
.empty { text-align: center; padding: 34px 20px; }
.empty-icon { width: 84px; height: 84px; margin: 0 auto 12px; border-radius: 26px; display: grid; place-items: center; font-size: 2rem; background: var(--gradient-warm); color: var(--primary-deep); }
.empty h3 { font-size: 1.05rem; margin-bottom: 4px; }
.empty p { color: var(--text-soft); font-size: .9rem; margin-bottom: 16px; }
.empty-mini { text-align: center; padding: 10px 0; color: var(--text-soft); } .empty-mini i { font-size: 2rem; color: var(--primary-deep); margin-bottom: 8px; } .empty-mini p { margin-bottom: 14px; }

.tx { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--bg-soft-light); }
.tx:last-child { border-bottom: 0; }
.tx-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(76,175,80,.12); color: #2E7D32; flex: none; }
.tx-body { flex: 1; min-width: 0; }
.tx-body strong { display: block; font-weight: 600; font-size: .95rem; }
.tx-body small { display: block; color: var(--text-light); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amt { text-align: right; font-weight: 700; white-space: nowrap; }
.tx-amt small { display: block; font-weight: 400; color: var(--text-light); font-size: .72rem; }
.month-label { font-size: .78rem; font-weight: 600; color: var(--text-soft); text-transform: uppercase; letter-spacing: .05em; margin: 18px 4px 8px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.stat { background: var(--surface); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); }
.stat small { display: block; font-size: .72rem; color: var(--text-light); }
.stat strong { font-size: 1.1rem; }

.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.contact { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 6px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); font-weight: 600; font-size: .82rem; color: var(--text-dark); }
.contact i { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 1.2rem; color: #fff; background: var(--gradient-deep); }
.contact.wa i { background: #25D366; }
.faq details { border-bottom: 1px solid var(--bg-soft-light); }
.faq details:last-child { border-bottom: 0; }
.faq summary { list-style: none; padding: 14px 16px; font-weight: 500; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.faq summary::after { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: .7rem; margin-left: auto; color: var(--text-light); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(180deg); }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { padding: 0 16px 14px; color: var(--text-soft); font-size: .9rem; }

.profile-head { text-align: center; padding: 8px 0 18px; }
.profile-head .avatar { margin: 0 auto 10px; }
.profile-head h2 { font-size: 1.2rem; }
.profile-head p { color: var(--text-soft); font-size: .9rem; }

.pager { display: flex; justify-content: center; gap: 8px; margin: 16px 0 4px; }

/* ---------- Auth pages (sign in, register, reset): same look as the Bomba portal landing page ---------- */
body.is-auth {
    background-color: #1C4E5C;
    background-image:
        radial-gradient(rgba(245, 217, 123, 0.10) 1px, transparent 1px),
        radial-gradient(700px 420px at 85% 0%, rgba(245, 217, 123, 0.18), transparent 65%),
        radial-gradient(800px 520px at 0% 100%, rgba(17, 98, 119, 0.9), transparent 70%),
        linear-gradient(160deg, #116277 0%, #1C4E5C 100%);
    background-size: 22px 22px, auto, auto, auto;
    min-height: 100vh; min-height: 100dvh;
}
body.is-auth .app { background: transparent; box-shadow: none; display: flex; flex-direction: column; justify-content: center;
    max-width: 440px; min-height: 100vh; min-height: 100dvh;
    padding: calc(var(--safe-t) + 28px) 18px calc(var(--safe-b) + 22px); }
body.is-auth .content { padding: 0; }

/* brand above the card: round logo badge, name, gold tag */
.auth-brand { text-align: center; color: #fff; margin-bottom: 20px; animation: authRise .5s ease both; }
.auth-badge { width: 84px; height: 84px; margin: 0 auto 12px; border-radius: 50%; background: #fff; border: 3px solid var(--warm-sand);
    box-shadow: 0 0 0 8px rgba(245, 217, 123, 0.12), 0 14px 30px rgba(0, 0, 0, 0.25); padding: 11px; display: grid; place-items: center; overflow: hidden; }
.auth-badge img { width: 100%; height: 100%; object-fit: contain; display: block; }
.auth-brand-name { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.3px; line-height: 1.15; }
.auth-brand-tag { display: inline-block; margin-top: 6px; padding: 4px 12px; border-radius: 999px; background: rgba(245, 217, 123, 0.16);
    color: var(--warm-sand); font-size: .75rem; font-weight: 600; letter-spacing: .3px; }

/* the white card */
.auth-card { position: relative; overflow: hidden; background: var(--surface); border-radius: 28px; padding: 26px 22px 22px;
    border: 0; box-shadow: 0 22px 48px rgba(0, 0, 0, 0.28); animation: authRise .5s ease .08s both; }
.auth-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--gradient-warm); }
.auth-head { display: none; }   /* the logo now sits above the card */
.auth-card > h1, .auth-card form > h1 { color: var(--primary-deep); font-size: 1.35rem; font-weight: 700; text-align: center; margin-bottom: 2px; }
.auth-card > .lead, .auth-card form > .lead { color: var(--text-soft); font-size: .85rem; text-align: center; margin-bottom: 18px; }
body.is-auth .field-input input, body.is-auth .field-input select { background: var(--bg-soft-light); border-color: transparent; border-radius: 14px; }
body.is-auth .field-input input:focus, body.is-auth .field-input select:focus { background: var(--surface); border-color: var(--warm-honey);
    box-shadow: 0 0 0 4px rgba(245, 197, 66, 0.2); }
body.is-auth .btn-primary { background: var(--gradient-warm); color: var(--primary-dark); border-radius: 16px; font-weight: 700;
    box-shadow: 0 10px 22px rgba(245, 197, 66, 0.35); }
.auth-links { display: flex; justify-content: flex-end; margin: -4px 0 14px; font-size: .8rem; }
.auth-links a { color: var(--primary-deep); font-weight: 600; }

/* text on the teal below the card */
.auth-alt { text-align: center; color: rgba(255, 255, 255, 0.78); margin-top: 18px; font-size: .88rem; animation: authRise .5s ease .16s both; }
.auth-alt a { color: var(--warm-sand); font-weight: 600; }
.auth-alt a:hover { color: #fff; }
.legal { text-align: center; color: rgba(255, 255, 255, 0.5); font-size: .72rem; margin-top: 16px; }
.legal a { color: rgba(255, 255, 255, 0.7); }
body.is-auth .check-line a { color: var(--primary-deep); font-weight: 600; }

@keyframes authRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .auth-brand, .auth-card, .auth-alt { animation: none; } }
@media (min-width: 640px) {
    .auth-badge { width: 96px; height: 96px; }
    .auth-brand-name { font-size: 1.7rem; }
    .auth-card { padding: 30px 28px 26px; }
}

/* ---------- Snackbar ---------- */
.snackbar {
    position: fixed; z-index: 80; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
    transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
    width: calc(100% - 32px); max-width: 488px; padding: 13px 16px; border-radius: 14px;
    background: #17323b; color: #fff; font-size: .9rem; box-shadow: var(--shadow-lg);
    transition: opacity .2s, transform .2s; display: flex; gap: 10px; align-items: center;
}
body.is-auth .snackbar { bottom: calc(var(--safe-b) + 16px); }
.snackbar.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.snackbar.success i { color: #81c784; } .snackbar.error i { color: #ef9a9a; } .snackbar.warning i { color: var(--warm-honey); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes dot { 0%, 80%, 100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 360px) {
    .content { padding: 12px; }
    .tiles { gap: 6px; } .tile { font-size: .7rem; }
    .status-card { margin-left: 12px; margin-right: 12px; }
}
@media (min-width: 560px) { body { padding: 0; } }
