@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* ===============================
   ROOT / THEME
   =============================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(180deg, #0f172a, #020617);
    color: #e5e7eb;
    /* Optional but VERY nice for finance apps */
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}


/* ===============================
   BASE COMPONENTS
   =============================== */

/* Inputs */
.input {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    border: 1px solid #1f2937;
    background: #020617;
    color: white;
    font-size: 0.95rem;
}

    .input::placeholder {
        color: #6b7280;
    }

    .input:focus {
        outline: none;
        border-color: #2563eb;
        box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.5);
    }

/* Buttons (BASE — NO LAYOUT ASSUMPTIONS) */
.primary-btn,
.secondary-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    border: none;
}

.primary-btn {
    background: #2563eb;
    color: white;
}

    .primary-btn:hover:not(:disabled) {
        background: #1d4ed8;
    }

    .primary-btn:disabled {
        background: #374151;
        cursor: not-allowed;
    }

.secondary-btn {
    background: transparent;
    border: 1px solid #374151;
    color: white;
}

/* Field groups */
.field-group {
    margin-bottom: 1rem;
}

    .field-group label {
        display: block;
        font-size: 0.8rem;
        color: #9ca3af;
        margin-bottom: 0.25rem;
    }

/* ===============================
   LOGIN
   =============================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #111827;
    padding: 2.25rem 2rem;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

    .login-card h1 {
        font-size: 1.9rem;
        margin-bottom: 0.25rem;
    }

.tagline {
    color: #9ca3af;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.google-btn {
    width: 100%;
    height: 3.25rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #111827;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

    .google-btn:hover {
        background: #f9fafb;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

    .google-btn img {
        width: 18px;
        height: 18px;
        object-fit: contain;
    }

    .google-btn span {
        font-size: 0.95rem;
    }


/* ===============================
   ONBOARDING
   =============================== */

.onboarding-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.onboarding-card {
    width: 100%;
    max-width: 420px;
    background: #111827;
    padding: 2rem;
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.45);
}

    .onboarding-card h2 {
        font-size: 1.4rem;
    }

.subtitle {
    color: #9ca3af;
    margin-bottom: 1.5rem;
}

/* Full-width buttons ONLY here */
.onboarding-card .primary-btn {
    width: 100%;
    margin-top: 1rem;
}

.actions-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}


.onboarding-progress {
    margin-bottom: 1.75rem;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: #020617;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid #1f2937;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    border-radius: 999px;
    transition: width 0.25s ease;
}

.progress-label {
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: right;
}


.bill-help {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: 10px;
    padding: 0.75rem;
    font-size: 0.8rem;
    color: #c7d2fe;
    margin-bottom: 1rem;
}

.skip-link {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
}

    .skip-link:hover {
        color: #e5e7eb;
    }



/* ===============================
   DASHBOARD
   =============================== */

.dashboard-container {
    padding: 1rem;
}

.dashboard-card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.dashboard-card-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #1f2937;
    color: #9ca3af;
    display: flex;
    justify-content: space-between;
}

.dashboard-card-body {
    padding: 1rem;
}

/* Dashboard wants full-width CTAs */
.dashboard-card .primary-btn {
    width: 100%;
    margin-top: 1rem;
}

/* ===============================
   DASHBOARD — UPCOMING BILLS
   =============================== */

.upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.upcoming-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.02);
    border: 1px solid #1f2937;
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
}

.upcoming-meta {
    font-size: 0.7rem;
    color: #9ca3af;
}

.upcoming-amount {
    font-weight: 600;
    font-size: 0.9rem;
}




/* ===============================
   MODAL (GLOBAL)
   =============================== */

.bc-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.bc-modal {
    width: calc(100% - 2rem);
    max-width: 420px;
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 25px 60px rgba(0,0,0,0.7);
}

    .bc-modal h3 {
        margin-top: 0;
    }

    .bc-modal .actions {
        display: flex;
        justify-content: flex-end;
        gap: 0.75rem;
        margin-top: 1.25rem;
    }

/* ===============================
   SPENDING PAGE (ISOLATED)
   =============================== */

.spending-page {
    max-width: 560px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
.spending-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.month-nav {
    display: flex;
    gap: 0.75rem;
    font-weight: 600;
}

    .month-nav button {
        background: none;
        border: none;
        color: #9ca3af;
        font-size: 1.4rem;
        cursor: pointer;
    }

.total-spent span {
    font-size: 0.75rem;
    color: #9ca3af;
}

.total-spent strong {
    font-size: 1.4rem;
}

/* Add Expense */
.add-expense-btn {
    width: 100%;
    padding: 0.9rem;
    border-radius: 12px;
    border: none;
    background: #2563eb;
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
    cursor: pointer;
}

/* List */
.expense-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.expense-item {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 14px;
    padding: 0.85rem 1rem;
}

.expense-main {
    display: flex;
    justify-content: space-between;
    font-weight: 500;
}

.expense-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.delete-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
}

/* Empty */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
}










/* ===============================
   MOBILE
   =============================== */

@media (max-width: 480px) {
    .spending-page {
        padding: 0.75rem;
    }

    .total-spent strong {
        font-size: 1.25rem;
    }
}



/* ===============================
   BILLS (CARDS)
   =============================== */

.bill-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bill-card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.35);
}

    .bill-card.inactive {
        opacity: 0.6;
    }

.bill-card-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.bill-name {
    margin: 0;
    font-size: 1rem;
}

.bill-meta {
    font-size: 0.75rem;
    color: #9ca3af;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.bill-tag {
    background: rgba(37, 99, 235, 0.15);
    color: #c7d2fe;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
}

.bill-amount {
    font-weight: 600;
    font-size: 1rem;
}

.bill-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bill-toggle {
    font-size: 0.8rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

    .bill-toggle input {
        transform: scale(1.1);
    }


/* ===============================
   BILL — RECURRING TOGGLE
   =============================== */

.recurring-toggle {
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

    .recurring-toggle:hover {
        background: rgba(37, 99, 235, 0.12);
    }

.recurring-toggle-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recurring-subtext {
    font-size: 0.75rem;
    color: #c7d2fe;
    margin-top: 0.15rem;
}

.recurring-toggle input {
    transform: scale(1.25);
    pointer-events: none;
}





/* ===============================
   404 / NOT FOUND
   =============================== */

.notfound-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.notfound-card {
    width: 100%;
    max-width: 420px;
    background: #111827;
    padding: 2.25rem 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 45px rgba(0,0,0,0.5);
    border: 1px solid #1f2937;
}

.notfound-code {
    font-size: 3.5rem;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 0.25rem;
    letter-spacing: 2px;
}

.notfound-card h1 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.notfound-card .subtitle {
    font-size: 0.9rem;
    color: #9ca3af;
    margin-bottom: 1.75rem;
}

.notfound-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

    .notfound-actions .primary-btn,
    .notfound-actions .secondary-btn {
        width: 100%;
    }




/* ===============================
   LOADING SPINNER
   =============================== */

.loading-container {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.loading-spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: #2563eb;
    animation: spin 0.9s linear infinite;
}

.loading-text {
    font-size: 0.9rem;
    color: #9ca3af;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
