:root {
    --color-primary:      #1a56db;
    --color-primary-dark: #1342b0;
    --color-bg:           #f3f4f6;
    --color-surface:      #ffffff;
    --color-text:         #111827;
    --color-text-muted:   #6b7280;
    --color-border:       #e5e7eb;
    --color-danger:       #dc2626;
    --color-success:      #16a34a;
    --color-unread:       #dbeafe;

    --radius:   12px;
    --radius-sm: 8px;
    --shadow:   0 1px 3px rgb(0 0 0 / .12);
    --shadow-md: 0 4px 12px rgb(0 0 0 / .12);

    --safe-top:    env(safe-area-inset-top,    0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    background: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding-top:    var(--safe-top);
    padding-bottom: var(--safe-bottom);
}

/* ── Splash ───────────────────────────────────────────── */
.splash {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 24px;
}
.splash__logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -.5px;
}
.splash__spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Topbar ───────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 56px;
    box-shadow: var(--shadow);
}
.topbar__title { font-size: 18px; font-weight: 600; flex: 1; }
.topbar__badge {
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9999px;
    padding: 1px 6px;
    min-width: 18px;
    text-align: center;
}

/* ── Page container ───────────────────────────────────── */
.page {
    flex: 1;
    padding: 16px;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
}

/* ── Card ─────────────────────────────────────────────── */
.card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 12px;
}

/* ── Form ─────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--color-text-muted); }
.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    outline: none;
    transition: border-color .15s;
    background: var(--color-surface);
    color: var(--color-text);
}
.form-input:focus { border-color: var(--color-primary); }
.form-input.error { border-color: var(--color-danger); }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background .15s, opacity .15s;
    width: 100%;
}
.btn-primary  { background: var(--color-primary); color: #fff; }
.btn-primary:hover  { background: var(--color-primary-dark); }
.btn-secondary { background: var(--color-border); color: var(--color-text); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Alert ────────────────────────────────────────────── */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
}
.alert-error   { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }

/* ── Notification list ────────────────────────────────── */
.notif-list { list-style: none; }
.notif-item {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: opacity .1s;
}
.notif-item.unread { background: var(--color-unread); }
.notif-item:active { opacity: .7; }
.notif-item__title   { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.notif-item__corpo   { font-size: 14px; color: var(--color-text-muted); }
.notif-item__meta    { font-size: 12px; color: var(--color-text-muted); margin-top: 6px; }

/* ── Empty state ──────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--color-text-muted);
}
.empty-state__icon { font-size: 40px; margin-bottom: 12px; }
.empty-state__text { font-size: 15px; }

/* ── PIN input ────────────────────────────────────────── */
.pin-input {
    letter-spacing: .4em;
    font-size: 24px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
