/* ============================================================
   EasyBillsReminder — Core Stylesheet
   Scheme: White / Black / Blue / Red
   Fonts: Barlow Condensed (display) + Barlow (body)
   ============================================================ */

:root {
    --white:      #ffffff;
    --off-white:  #f6f7f9;
    --light-grey: #e8eaed;
    --mid-grey:   #9aa0a8;
    --dark-grey:  #4a4f57;
    --black:      #111214;

    --blue:       #0047AB;
    --blue-dark:  #003380;
    --blue-light: #e8eef8;
    --blue-mid:   #2563c4;

    --red:        #CC0000;
    --red-dark:   #990000;
    --red-light:  #fdecea;

    --success:    #006400;
    --success-bg: #edf7ed;

    --radius:     6px;
    --radius-lg:  10px;
    --shadow:     0 2px 8px rgba(0,0,0,.09);
    --shadow-lg:  0 4px 20px rgba(0,0,0,.13);

    --font-display: 'Barlow Condensed', sans-serif;
    --font-body:    'Barlow', sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--off-white);
    color: var(--black);
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────── */
.site-header {
    background: var(--white);
    border-bottom: 3px solid var(--blue);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Logo */
.logo {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: .5px;
    text-decoration: none;
    line-height: 1;
}
.logo-easy     { color: var(--black); }
.logo-bills    { color: var(--blue); }
.logo-reminder { color: var(--red); font-weight: 600; }

/* Nav */
.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.nav-greeting {
    font-size: .875rem;
    color: var(--dark-grey);
    margin-right: 8px;
}
.nav-link {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: .875rem;
    color: var(--blue);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: var(--radius);
    transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--blue-light); }
.nav-cta {
    background: var(--blue);
    color: var(--white) !important;
    font-weight: 600;
}
.nav-cta:hover { background: var(--blue-dark) !important; }
.nav-logout { color: var(--red) !important; }
.nav-logout:hover { background: var(--red-light) !important; }

/* ── Main ────────────────────────────────────────────────── */
.site-main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px 48px;
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
    background: var(--black);
    color: var(--mid-grey);
    padding: 20px 24px;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    font-size: .8rem;
    gap: 8px;
    flex-wrap: wrap;
}
.footer-brand { color: var(--white); font-weight: 600; }

/* ── Flash messages ──────────────────────────────────────── */
.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: var(--radius);
    font-weight: 500;
    margin-bottom: 20px;
    font-size: .9rem;
}
.flash--error   { background: var(--red-light);   color: var(--red-dark);  border-left: 4px solid var(--red); }
.flash--success { background: var(--success-bg);  color: var(--success);   border-left: 4px solid var(--success); }
.flash--info    { background: var(--blue-light);  color: var(--blue-dark); border-left: 4px solid var(--blue); }
.flash-icon { font-weight: 700; font-size: 1.1rem; }

/* ── Page titles ─────────────────────────────────────────── */
.page-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--black);
    margin-bottom: 24px;
    letter-spacing: .3px;
}
.page-title span { color: var(--blue); }
.page-subtitle {
    font-size: 1rem;
    color: var(--dark-grey);
    margin-top: -16px;
    margin-bottom: 24px;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 24px;
}
.card-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--light-grey);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title .ct-icon { color: var(--blue); }

/* ── Summary bar ─────────────────────────────────────────── */
.summary-bar {
    background: var(--blue);
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: 22px 28px;
    margin-bottom: 28px;
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: 0 4px 16px rgba(0,71,171,.3);
}
.summary-item { display: flex; flex-direction: column; gap: 2px; }
.summary-label { font-size: .75rem; text-transform: uppercase; letter-spacing: 1px; opacity: .75; font-weight: 600; }
.summary-value { font-family: var(--font-display); font-size: 2rem; font-weight: 800; line-height: 1; }
.summary-value.sv-red { color: #ffcccc; }
.summary-divider { width: 1px; background: rgba(255,255,255,.25); height: 40px; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-weight: 600;
    font-size: .85rem;
    margin-bottom: 6px;
    color: var(--dark-grey);
    letter-spacing: .3px;
}
.form-label .required { color: var(--red); margin-left: 2px; }
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--light-grey);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: .95rem;
    color: var(--black);
    background: var(--white);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.form-control:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0,71,171,.12);
}
.form-control.error { border-color: var(--red); }
.form-hint { font-size: .78rem; color: var(--mid-grey); margin-top: 4px; }
.form-row { display: grid; gap: 16px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background .15s, transform .1s, box-shadow .15s;
    line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary  { background: var(--blue); color: var(--white); }
.btn-primary:hover  { background: var(--blue-dark); box-shadow: 0 3px 10px rgba(0,71,171,.3); }
.btn-danger   { background: var(--red); color: var(--white); }
.btn-danger:hover   { background: var(--red-dark); }
.btn-outline  { background: transparent; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-outline:hover  { background: var(--blue-light); }
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-full { width: 100%; justify-content: center; padding: 13px; font-size: 1rem; }

/* ── Bills table ─────────────────────────────────────────── */
.bills-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.bills-table th {
    background: var(--black);
    color: var(--white);
    font-family: var(--font-display);
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 10px 14px;
    text-align: left;
}
.bills-table th:first-child { border-radius: var(--radius) 0 0 0; }
.bills-table th:last-child  { border-radius: 0 var(--radius) 0 0; }
.bills-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--light-grey);
    vertical-align: middle;
}
.bills-table tr:last-child td { border-bottom: none; }
.bills-table tr:hover td { background: var(--blue-light); }
.bills-table tr.paid-row td { opacity: .55; text-decoration: line-through; }

.category-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--white);
}
.amount-cell { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--blue); }
.amount-cell.overdue { color: var(--red); }
.due-date-cell { font-weight: 600; }
.days-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: .78rem;
    font-weight: 600;
    background: var(--blue-light);
    color: var(--blue-dark);
}
.days-badge.urgent { background: var(--red-light); color: var(--red-dark); }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 20px;
}
.pagination a, .pagination span {
    padding: 7px 14px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: .85rem;
    text-decoration: none;
    color: var(--blue);
    background: var(--white);
    border: 1.5px solid var(--light-grey);
    transition: background .15s;
}
.pagination a:hover   { background: var(--blue-light); }
.pagination .current  { background: var(--blue); color: var(--white); border-color: var(--blue); }
.pagination .disabled { color: var(--mid-grey); pointer-events: none; }

/* ── Auth forms ──────────────────────────────────────────── */
.auth-wrap {
    max-width: 460px;
    margin: 40px auto;
}
.auth-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 36px 40px;
    border-top: 4px solid var(--blue);
}
.auth-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--black);
    margin-bottom: 6px;
}
.auth-subtitle {
    color: var(--dark-grey);
    font-size: .9rem;
    margin-bottom: 28px;
}
.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: .875rem;
    color: var(--dark-grey);
}
.auth-footer a { color: var(--blue); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* ── Hero (landing) ──────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 60px 24px;
}
.hero-title {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 18px;
}
.hero-title .ht-blue { color: var(--blue); }
.hero-title .ht-red  { color: var(--red); }
.hero-desc {
    font-size: 1.1rem;
    color: var(--dark-grey);
    max-width: 520px;
    margin: 0 auto 32px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    margin-top: 48px;
}
.feature-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    border-top: 3px solid var(--blue);
    text-align: left;
}
.feature-card:nth-child(even) { border-top-color: var(--red); }
.feature-icon { font-size: 1.8rem; margin-bottom: 10px; }
.feature-title { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; margin-bottom: 6px; }
.feature-desc { font-size: .875rem; color: var(--dark-grey); }

/* ── Filter bar ──────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.filter-bar label { font-weight: 600; font-size: .85rem; color: var(--dark-grey); }
.filter-bar select { width: auto; min-width: 180px; }

/* ── Misc ────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-red { color: var(--red); }
.text-blue { color: var(--blue); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.divider { border: none; border-top: 1px solid var(--light-grey); margin: 24px 0; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--mid-grey); }
.empty-state .es-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { margin-bottom: 16px; }
.actions-cell { display: flex; gap: 6px; }
.frequency-tag {
    display: inline-block;
    font-size: .7rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: .5px;
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--light-grey);
    color: var(--dark-grey);
}

/* ── Color picker swatches ──────────────────────────────── */
.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.color-swatch {
    width: 28px; height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform .15s, border-color .15s;
}
.color-swatch:hover, .color-swatch.selected { transform: scale(1.2); border-color: var(--black); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 700px) {
    .header-inner { height: auto; padding: 12px 16px; flex-direction: column; align-items: flex-start; gap: 10px; }
    .site-main { padding: 20px 14px 40px; }
    .auth-card { padding: 24px 20px; }
    .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
    .bills-table { font-size: .8rem; }
    .bills-table th, .bills-table td { padding: 8px 10px; }
    .hero-title { font-size: 2.4rem; }
    .summary-bar { gap: 20px; }
}
