/* ═══════════════════════════════════════════════════════════
   CASH 2 — Finanças para Casais
   Premium Mobile-First Design System
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ─────────────────────────────────────── */
:root {
    /* Primary Palette — Deep Purple Love */
    --primary-50: #f5f0ff;
    --primary-100: #ece0ff;
    --primary-200: #d4b8ff;
    --primary-300: #b388ff;
    --primary-400: #9c5cff;
    --primary-500: #7c3aed;
    --primary-600: #6d28d9;
    --primary-700: #5b21b6;
    --primary-800: #4c1d95;
    --primary-900: #3b0764;

    /* Accent — Warm Rose */
    --accent-50: #fff1f2;
    --accent-100: #ffe4e6;
    --accent-200: #fecdd3;
    --accent-300: #fda4af;
    --accent-400: #fb7185;
    --accent-500: #f43f5e;
    --accent-600: #e11d48;
    --accent-700: #be123c;

    /* Success — Emerald */
    --success-50: #ecfdf5;
    --success-100: #d1fae5;
    --success-400: #34d399;
    --success-500: #10b981;
    --success-600: #059669;

    /* Warning — Amber */
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-400: #fbbf24;
    --warning-500: #f59e0b;

    /* Danger — Red */
    --danger-400: #f87171;
    --danger-500: #ef4444;
    --danger-600: #dc2626;

    /* Neutrals */
    --gray-50: #fafafa;
    --gray-100: #f4f4f5;
    --gray-200: #e4e4e7;
    --gray-300: #d4d4d8;
    --gray-400: #a1a1aa;
    --gray-500: #71717a;
    --gray-600: #52525b;
    --gray-700: #3f3f46;
    --gray-800: #27272a;
    --gray-900: #18181b;

    /* Backgrounds */
    --bg-primary: #0f0a1a;
    --bg-surface: #1a1225;
    --bg-card: #221a30;
    --bg-card-hover: #2d2240;
    --bg-input: #1e1630;

    /* Text */
    --text-primary: #f4f0ff;
    --text-secondary: #a398b8;
    --text-muted: #6b5f80;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #e11d48 100%);
    --gradient-card: linear-gradient(145deg, rgba(124, 58, 237, 0.1) 0%, rgba(225, 29, 72, 0.05) 100%);
    --gradient-glow: linear-gradient(135deg, rgba(124, 58, 237, 0.3) 0%, rgba(225, 29, 72, 0.15) 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.3);

    /* Borders */
    --border-subtle: 1px solid rgba(124, 58, 237, 0.15);
    --border-card: 1px solid rgba(124, 58, 237, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-xs: 0.75rem;
    --font-sm: 0.875rem;
    --font-base: 1rem;
    --font-lg: 1.125rem;
    --font-xl: 1.25rem;
    --font-2xl: 1.5rem;
    --font-3xl: 1.875rem;
    --font-4xl: 2.25rem;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Mobile-first layout */
    --nav-height: 64px;
    --bottom-nav-height: 72px;
    --content-max-width: 480px;
}


/* ── Light Theme ───────────────────────────────────────── */
[data-theme="light"] {
    --bg-primary: #f8f5ff;
    --bg-surface: #f0ebfa;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f0ff;
    --bg-input: #f0ebfa;

    --text-primary: #1a0e2e;
    --text-secondary: #5b4a6f;
    --text-muted: #8a7a9e;

    --gradient-card: linear-gradient(145deg, rgba(124, 58, 237, 0.04) 0%, rgba(225, 29, 72, 0.02) 100%);
    --gradient-glow: linear-gradient(135deg, rgba(124, 58, 237, 0.08) 0%, rgba(225, 29, 72, 0.04) 100%);

    --shadow-sm: 0 1px 3px rgba(124, 58, 237, 0.06);
    --shadow-md: 0 4px 16px rgba(124, 58, 237, 0.08);
    --shadow-lg: 0 8px 32px rgba(124, 58, 237, 0.12);
    --shadow-glow: 0 0 24px rgba(124, 58, 237, 0.1);

    --border-subtle: 1px solid rgba(124, 58, 237, 0.1);
    --border-card: 1px solid rgba(124, 58, 237, 0.08);
}

[data-theme="light"] body {
    background: #f8f5ff;
}

[data-theme="light"] body::before {
    background:
        radial-gradient(ellipse 800px 800px at 50% 30%, rgba(124, 58, 237, 0.12) 0%, rgba(168, 85, 247, 0.06) 30%, transparent 70%),
        radial-gradient(ellipse 600px 400px at 30% 70%, rgba(192, 132, 252, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 500px 500px at 80% 50%, rgba(225, 29, 72, 0.04) 0%, transparent 60%);
}

[data-theme="light"] .header,
[data-theme="light"] .top-header {
    background: rgba(248, 245, 255, 0.9);
    border-bottom-color: rgba(124, 58, 237, 0.08);
}

[data-theme="light"] .bottom-nav {
    background: rgba(248, 245, 255, 0.95);
    border-top-color: rgba(124, 58, 237, 0.08);
}

[data-theme="light"] .form-input,
[data-theme="light"] .form-select {
    background: #ffffff;
    border-color: rgba(124, 58, 237, 0.12);
    color: var(--text-primary);
}

[data-theme="light"] .form-input::placeholder {
    color: var(--text-muted);
}

[data-theme="light"] .card {
    box-shadow: 0 1px 4px rgba(124, 58, 237, 0.05);
}

[data-theme="light"] .card:hover {
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.15);
}

[data-theme="light"] .expense-item {
    background: #ffffff;
    border-color: rgba(124, 58, 237, 0.06);
}

[data-theme="light"] .expense-item:hover {
    background: var(--bg-card-hover);
}

[data-theme="light"] .ranking-card {
    background: #ffffff;
    border-color: rgba(124, 58, 237, 0.06);
}

[data-theme="light"] .ranking-card--leader {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.06) 0%, rgba(225, 29, 72, 0.03) 100%);
    border-color: rgba(124, 58, 237, 0.15);
}

[data-theme="light"] .goal-card {
    background: #ffffff;
    border-color: rgba(124, 58, 237, 0.06);
}

[data-theme="light"] .notif-item {
    background: #ffffff;
    border-color: rgba(124, 58, 237, 0.06);
}

[data-theme="light"] .filter-tabs {
    background: #ffffff;
    border-color: rgba(124, 58, 237, 0.06);
}

[data-theme="light"] .auth-card {
    background: #ffffff;
    box-shadow: 0 8px 40px rgba(124, 58, 237, 0.1);
}

[data-theme="light"] .month-picker input[type="month"] {
    background: #ffffff;
    border-color: rgba(124, 58, 237, 0.1);
    color: var(--text-primary);
}

[data-theme="light"] .flash--success {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.15);
}

[data-theme="light"] .flash--error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
}

[data-theme="light"] a {
    color: var(--primary-600);
}

[data-theme="light"] a:hover {
    color: var(--primary-700);
}

[data-theme="light"] .text-primary {
    color: var(--primary-600);
}

[data-theme="light"] .text-muted {
    color: var(--text-muted);
}

[data-theme="light"] .page__title {
    background: linear-gradient(135deg, #6d28d9 0%, #be123c 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="light"] .ranking-card__points {
    color: var(--primary-600);
}

[data-theme="light"] .activity-item__points {
    color: var(--primary-600);
}

[data-theme="light"] .activity-item__text strong {
    color: var(--text-primary);
}

[data-theme="light"] .activity-item {
    border-bottom-color: rgba(124, 58, 237, 0.06);
}

[data-theme="light"] .card--stats .stat-value {
    color: var(--text-primary);
}

[data-theme="light"] .notif-badge {
    background: #ffffff;
    border-color: rgba(124, 58, 237, 0.1);
}

[data-theme="light"] .progress {
    background: rgba(124, 58, 237, 0.08);
}


/* ── Reset & Base ──────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle animated background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 600px at 20% 10%, rgba(124, 58, 237, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 400px 400px at 80% 80%, rgba(225, 29, 72, 0.06) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--primary-300);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-200);
}

img {
    max-width: 100%;
    display: block;
}

input,
select,
textarea,
button {
    font-family: inherit;
    font-size: inherit;
}

/* ── App Container ─────────────────────────────────────── */
.app {
    position: relative;
    z-index: 1;
    max-width: var(--content-max-width);
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: calc(var(--bottom-nav-height) + 16px);
}

/* ── Top Header ────────────────────────────────────────── */
.top-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    background: rgba(15, 10, 26, 0.85);
    border-bottom: var(--border-subtle);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
}

.top-header__brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.top-header__logo {
    font-size: var(--font-xl);
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.top-header__sub {
    font-size: var(--font-xs);
    color: var(--text-muted);
    font-weight: 500;
}

.top-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.notif-badge {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: var(--border-card);
    color: var(--text-secondary);
    font-size: var(--font-lg);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.notif-badge:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.notif-badge__count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--accent-500);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

.avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-sm);
    font-weight: 700;
    color: white;
    border: 2px solid rgba(124, 58, 237, 0.3);
}


/* ── Bottom Navigation ─────────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--content-max-width);
    height: var(--bottom-nav-height);
    background: rgba(15, 10, 26, 0.95);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-top: var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 var(--space-sm);
    z-index: 100;
}

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-xs) var(--space-sm);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--transition-fast);
    border-radius: var(--radius-md);
    min-width: 56px;
    text-decoration: none;
}

.bottom-nav__item:hover {
    color: var(--text-secondary);
}

.bottom-nav__item.active {
    color: var(--primary-400);
}

.bottom-nav__item.active .bottom-nav__icon {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.bottom-nav__icon {
    font-size: 20px;
    width: 40px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

/* Floating action button for add */
.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px);
    right: calc(50% - var(--content-max-width)/2 + 16px);
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    color: white;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(124, 58, 237, 0.5);
    z-index: 99;
    transition: all var(--transition-normal);
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 32px rgba(124, 58, 237, 0.6);
}

.fab:active {
    transform: scale(0.95);
}

@media (max-width: 480px) {
    .fab {
        right: 16px;
    }
}


/* ── Page Content ──────────────────────────────────────── */
.page {
    padding: var(--space-lg);
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page__title {
    font-size: var(--font-2xl);
    font-weight: 800;
    margin-bottom: var(--space-xs);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page__subtitle {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}


/* ── Cards ─────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: var(--border-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-card);
    pointer-events: none;
}

.card:hover {
    border-color: rgba(124, 58, 237, 0.25);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card--glass {
    background: rgba(34, 26, 48, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.card--stats {
    text-align: center;
    padding: var(--space-lg) var(--space-md);
}

.card--stats .stat-value {
    font-size: var(--font-3xl);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
    line-height: 1.1;
}

.card--stats .stat-label {
    font-size: var(--font-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-top: var(--space-xs);
}

.card--stats .stat-icon {
    font-size: var(--font-3xl);
    margin-bottom: var(--space-sm);
    display: block;
}

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.card__title {
    font-size: var(--font-base);
    font-weight: 700;
    color: var(--text-primary);
}

.card__badge {
    font-size: var(--font-xs);
    font-weight: 600;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    background: rgba(124, 58, 237, 0.15);
    color: var(--primary-300);
}

/* Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.cards-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}


/* ── Expense Item ──────────────────────────────────────── */
.expense-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border: var(--border-card);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.expense-item:hover {
    background: var(--bg-card-hover);
}

.expense-item__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-xl);
    background: rgba(124, 58, 237, 0.1);
    flex-shrink: 0;
}

.expense-item__info {
    flex: 1;
    min-width: 0;
}

.expense-item__title {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.expense-item__meta {
    font-size: var(--font-xs);
    color: var(--text-muted);
    display: flex;
    gap: var(--space-sm);
    margin-top: 2px;
}

.expense-item__amount {
    font-size: var(--font-base);
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.expense-item__amount--paid {
    color: var(--success-400);
}

.expense-item__amount--pending {
    color: var(--warning-400);
}


/* ── Status badges ─────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-xs);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.badge--paid {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-400);
}

.badge--pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-400);
}

.badge--danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-400);
}

.badge--primary {
    background: rgba(124, 58, 237, 0.15);
    color: var(--primary-300);
}


/* ── Progress Bar ──────────────────────────────────────── */
.progress {
    width: 100%;
    height: 8px;
    background: rgba(124, 58, 237, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: var(--space-sm) 0;
}

.progress__bar {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

.progress__bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 20px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
    border-radius: var(--radius-full);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.progress--lg {
    height: 12px;
}

.progress__info {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}


/* ── Goal Card ─────────────────────────────────────────── */
.goal-card {
    background: var(--bg-card);
    border: var(--border-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-normal);
}

.goal-card:hover {
    border-color: rgba(124, 58, 237, 0.25);
}

.goal-card__header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.goal-card__icon {
    font-size: var(--font-2xl);
}

.goal-card__title {
    font-weight: 700;
    font-size: var(--font-base);
}

.goal-card__amounts {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: var(--space-sm);
}

.goal-card__current {
    font-size: var(--font-xl);
    font-weight: 800;
    color: var(--primary-300);
}

.goal-card__target {
    font-size: var(--font-sm);
    color: var(--text-muted);
}


/* ── Ranking ───────────────────────────────────────────── */
.ranking-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-card);
    border: var(--border-card);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.ranking-card--leader {
    background: var(--gradient-glow);
    border-color: rgba(124, 58, 237, 0.3);
    box-shadow: var(--shadow-glow);
}

.ranking-card__position {
    font-size: var(--font-3xl);
    font-weight: 800;
    min-width: 48px;
    text-align: center;
}

.ranking-card__position--1 {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ranking-card__position--2 {
    color: var(--gray-400);
}

.ranking-card__info {
    flex: 1;
}

.ranking-card__name {
    font-size: var(--font-lg);
    font-weight: 700;
}

.ranking-card__actions-count {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.ranking-card__points {
    font-size: var(--font-2xl);
    font-weight: 800;
    color: var(--primary-300);
}

.ranking-card__points span {
    font-size: var(--font-xs);
    color: var(--text-muted);
    font-weight: 500;
}


/* ── Attack Messages ───────────────────────────────────── */
.attack-banner {
    background: var(--gradient-glow);
    border: 1px solid rgba(225, 29, 72, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-lg);
    animation: slideShake 0.5s ease-out;
}

.attack-banner__text {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
}

@keyframes slideShake {
    0% {
        transform: translateX(-20px);
        opacity: 0;
    }

    40% {
        transform: translateX(5px);
    }

    60% {
        transform: translateX(-3px);
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}


/* ── Forms ─────────────────────────────────────────────── */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: var(--space-md) var(--space-md);
    background: var(--bg-input);
    border: 1px solid rgba(124, 58, 237, 0.15);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-base);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-select {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-input);
    border: 1px solid rgba(124, 58, 237, 0.15);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-base);
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23a398b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 20px;
    outline: none;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-hint {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}


/* ── Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    line-height: 1;
}

.btn--primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.4);
    color: white;
}

.btn--primary:active {
    transform: translateY(0);
}

.btn--secondary {
    background: var(--bg-card);
    border: var(--border-card);
    color: var(--text-primary);
}

.btn--secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn--success {
    background: var(--gradient-success);
    color: white;
}

.btn--danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-400);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn--danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: var(--space-sm) var(--space-md);
}

.btn--ghost:hover {
    color: var(--text-primary);
    background: rgba(124, 58, 237, 0.1);
}

.btn--block {
    width: 100%;
}

.btn--sm {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-xs);
}

.btn--lg {
    padding: var(--space-lg) var(--space-2xl);
    font-size: var(--font-base);
}

.btn--icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
    font-size: var(--font-base);
}


/* ── Flash Messages ────────────────────────────────────── */
.flash {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    font-weight: 600;
    margin-bottom: var(--space-lg);
    animation: slideDown 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flash--success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success-400);
}

.flash--error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger-400);
}

.flash--info {
    background: rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(124, 58, 237, 0.2);
    color: var(--primary-300);
}


/* ── Notification Item ─────────────────────────────────── */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border: var(--border-card);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.notif-item--unread {
    border-left: 3px solid var(--primary-500);
}

.notif-item__icon {
    font-size: var(--font-xl);
    flex-shrink: 0;
    margin-top: 2px;
}

.notif-item__content {
    flex: 1;
}

.notif-item__message {
    font-size: var(--font-sm);
    color: var(--text-primary);
    font-weight: 500;
}

.notif-item__time {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-top: 2px;
}


/* ── Auth Pages ────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: var(--border-card);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

.auth-card__header {
    text-align: center;
    margin-bottom: var(--space-2xl);
    position: relative;
}

.auth-card__logo {
    font-size: var(--font-4xl);
    margin-bottom: var(--space-sm);
}

.auth-card__title {
    font-size: var(--font-2xl);
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-card__desc {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

.auth-card__footer {
    text-align: center;
    margin-top: var(--space-xl);
    font-size: var(--font-sm);
    color: var(--text-muted);
}

.auth-card__footer a {
    color: var(--primary-300);
    font-weight: 600;
}


/* ── Couple Setup ──────────────────────────────────────── */
.couple-setup {
    text-align: center;
    padding: var(--space-2xl) 0;
}

.couple-setup__divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-2xl) 0;
    color: var(--text-muted);
    font-size: var(--font-sm);
    font-weight: 600;
}

.couple-setup__divider::before,
.couple-setup__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(124, 58, 237, 0.15);
}

.invite-code-display {
    font-family: monospace;
    font-size: var(--font-3xl);
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--primary-300);
    background: rgba(124, 58, 237, 0.1);
    border: 1px dashed rgba(124, 58, 237, 0.3);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-md);
    display: inline-block;
    margin: var(--space-md) 0;
    user-select: all;
}


/* ── Filter Tabs ───────────────────────────────────────── */
.filter-tabs {
    display: flex;
    gap: var(--space-xs);
    background: var(--bg-card);
    border: var(--border-card);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: var(--space-lg);
}

.filter-tab {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: var(--font-xs);
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-tab.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.filter-tab:hover:not(.active) {
    color: var(--text-secondary);
    background: rgba(124, 58, 237, 0.1);
}


/* ── Empty State ───────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
}

.empty-state__icon {
    font-size: 64px;
    margin-bottom: var(--space-md);
    opacity: 0.6;
}

.empty-state__title {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.empty-state__text {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}


/* ── Section ───────────────────────────────────────────── */
.section {
    margin-bottom: var(--space-xl);
}

.section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.section__title {
    font-size: var(--font-base);
    font-weight: 700;
    color: var(--text-primary);
}


/* ── Inline Actions ────────────────────────────────────── */
.inline-actions {
    display: flex;
    gap: var(--space-sm);
}

.inline-form {
    display: inline;
}


/* ── Month Picker ──────────────────────────────────────── */
.month-picker {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.month-picker input[type="month"] {
    background: var(--bg-card);
    border: var(--border-card);
    color: var(--text-primary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    font-weight: 600;
    outline: none;
}


/* ── Activity Feed ─────────────────────────────────────── */
.activity-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid rgba(124, 58, 237, 0.06);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item__dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--primary-500);
    flex-shrink: 0;
}

.activity-item__text {
    font-size: var(--font-xs);
    color: var(--text-secondary);
    flex: 1;
}

.activity-item__text strong {
    color: var(--text-primary);
}

.activity-item__points {
    font-size: var(--font-xs);
    font-weight: 700;
    color: var(--primary-300);
}


/* ── 404 Page ──────────────────────────────────────────── */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-xl);
}

.error-page__code {
    font-size: 120px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}


/* ── Utilities ─────────────────────────────────────────── */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success-400);
}

.text-danger {
    color: var(--danger-400);
}

.text-primary {
    color: var(--primary-300);
}

.text-sm {
    font-size: var(--font-sm);
}

.text-xs {
    font-size: var(--font-xs);
}

.text-lg {
    font-size: var(--font-lg);
}

.text-bold {
    font-weight: 700;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mb-xs {
    margin-bottom: var(--space-xs);
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.mb-xl {
    margin-bottom: var(--space-xl);
}

.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-between {
    justify-content: space-between;
}

.flex-center {
    align-items: center;
}

.flex-gap-sm {
    gap: var(--space-sm);
}

.flex-gap-md {
    gap: var(--space-md);
}

.flex-1 {
    flex: 1;
}

.hidden {
    display: none !important;
}

/* ── Responsive ────────────────────────────────────────── */
@media (min-width: 768px) {
    :root {
        --content-max-width: 540px;
    }
}

@media (min-width: 1024px) {
    :root {
        --content-max-width: 480px;
    }
}

/* ── Print ─────────────────────────────────────────────── */
@media print {

    .bottom-nav,
    .top-header,
    .header,
    .fab {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .card {
        background: white;
        border: 1px solid #ddd;
    }
}


/* ── Header ────────────────────────────────────────────── */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    background: rgba(15, 10, 26, 0.88);
    border-bottom: var(--border-subtle);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.header__brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.header__title {
    font-size: var(--font-xl);
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.header__icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: var(--border-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    font-size: 0;
    line-height: 1;
}

.header__icon-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    transform: scale(1.05);
}

.header__icon-btn svg {
    width: 18px;
    height: 18px;
}


/* ── Theme Toggle ──────────────────────────────────────── */
.theme-icon {
    transition: all var(--transition-normal);
}

.theme-icon--moon {
    display: none;
}

.theme-icon--sun {
    display: block;
}

[data-theme="light"] .theme-icon--moon {
    display: block;
}

[data-theme="light"] .theme-icon--sun {
    display: none;
}

#theme-toggle:hover {
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.25);
}

[data-theme="light"] .header {
    background: rgba(248, 245, 255, 0.9);
}


/* ── Modal ─────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    width: 100%;
    max-width: var(--content-max-width);
    max-height: 85vh;
    background: var(--bg-card);
    border: var(--border-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform var(--transition-slow);
    position: relative;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: var(--border-subtle);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.modal__title {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.modal__close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: none;
    background: rgba(124, 58, 237, 0.1);
    color: var(--text-secondary);
    font-size: var(--font-xl);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    line-height: 1;
}

.modal__close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-400);
}

.modal__body {
    padding: var(--space-xl);
}

.modal__body .form-group {
    margin-bottom: var(--space-lg);
}

.modal__body .btn {
    margin-top: var(--space-sm);
}

.modal__actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

.modal__actions .btn {
    flex: 1;
}

[data-theme="light"] .modal-overlay {
    background: rgba(124, 58, 237, 0.08);
}

[data-theme="light"] .modal {
    background: #ffffff;
    box-shadow: 0 -8px 40px rgba(124, 58, 237, 0.15);
}

[data-theme="light"] .modal__header {
    background: #ffffff;
}

@media (min-width: 480px) {
    .modal-overlay {
        align-items: center;
    }

    .modal {
        border-radius: var(--radius-xl);
        max-height: 80vh;
    }
}


/* ── Goal Done ─────────────────────────────────────────── */
.goal-card--done {
    opacity: 0.7;
}

.goal-card--done .progress__bar {
    background: var(--gradient-success);
}


/* ── Item Actions Row ──────────────────────────────────── */
.item-actions {
    display: flex;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.item-actions .btn {
    padding: 4px 10px;
    font-size: 11px;
}