/* ============================================================
   Fehm Web — design tokens lifted directly from the Flutter app's
   app_colors.dart / app_text_styles.dart / app_shadows.dart, so this
   site reads as the same product, not a generic marketing site bolted
   onto an app. Mobile-first base, with dedicated tablet (768px) and
   desktop (1200px) breakpoints so the site doesn't just look like a
   stretched phone screen on a laptop.
   ============================================================ */

:root {
    /* Brand greens — from app_colors.dart */
    --primary: #1B4332;
    --primary-dark: #0F2A1F;
    --primary-mid: #2D6A4F;
    --primary-light: #40916C;
    --accent: #52B788;
    --accent-mist: #D8F3DC;
    --accent-pale: #B7E4C7;
    /* Surfaces */
    --background: #EEF5F0;
    --background-alt: #E3EFE7;
    --surface: #FFFFFF;
    --border: #D3E8DC;
    /* Text */
    --text-primary: #0F2A1F;
    --text-secondary: #3D6B54;
    --text-muted: #6B9E84;
    --text-inverse: #FFFFFF;
    /* Semantic */
    --warning: #D68910;
    --warning-bg: #FEF9E7;
    --danger: #C0392B;
    --danger-bg: #FDEDEC;
    /* Shadows — green-tinted, matches app_shadows.dart's shadowColor (#1B4332) */
    --shadow-card: 0 3px 10px rgba(27, 67, 50, 0.07);
    --shadow-hero: 0 6px 18px rgba(27, 67, 50, 0.22);
    --shadow-small: 0 2px 6px rgba(27, 67, 50, 0.15);
    /* Radii — matches the app's .r() rounded-corner convention (14–20px) */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --font-display: 'Lora', Georgia, serif;
    --font-heading: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: radial-gradient(circle at top, rgba(82, 183, 136, 0.10), transparent 45%), linear-gradient(180deg, #F7FCF8, #EEF5F0);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--primary-mid);
    text-decoration: none;
}

/* ── Header ─────────────────────────────────────────────────── */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo-word {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 24px;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 14px;
}

    .main-nav a {
        font-family: var(--font-heading);
        font-size: 13px;
        font-weight: 600;
        color: var(--text-secondary);
        transition: color 0.2s;
    }

        .main-nav a:hover {
            color: var(--primary-mid);
        }

    .main-nav .nav-cta {
        background: var(--primary-mid);
        color: var(--text-inverse);
        padding: 8px 16px;
        border-radius: var(--radius-sm);
        transition: background 0.2s;
    }

        .main-nav .nav-cta:hover {
            background: var(--primary-dark);
            color: var(--text-inverse);
        }

/* ── Footer ─────────────────────────────────────────────────── */

.site-footer {
    background: var(--primary);
    color: var(--accent-mist);
    margin-top: 48px;
    padding: 36px 0 24px;
}

.footer-inner {
    text-align: center;
}

.footer-logo-word {
    color: var(--surface);
    font-size: 22px;
}

.footer-brand p {
    margin: 6px 0 20px;
    font-size: 13px;
    color: var(--accent-pale);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

    .footer-links a {
        color: var(--accent-mist);
        font-size: 13px;
        font-family: var(--font-heading);
        font-weight: 500;
    }

        .footer-links a:hover {
            color: var(--surface);
        }

.footer-copy {
    font-size: 11px;
    color: var(--primary-light);
    margin: 0;
}

/* ── Cards / shared components ─────────────────────────────────── */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

    .card:hover {
        transform: translateY(-4px);
        box-shadow: 0 20px 50px rgba(27, 67, 50, 0.12);
    }

.card-hero {
    background: var(--primary-mid);
    color: var(--text-inverse);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hero);
    padding: 24px 20px;
    text-align: center;
}

    .card-hero .hero-label {
        font-family: var(--font-heading);
        font-size: 13px;
        font-weight: 600;
        color: rgba(255,255,255,0.85);
        margin: 0 0 6px;
    }

    .card-hero .hero-value {
        font-family: var(--font-heading);
        font-size: 32px;
        font-weight: 800;
        color: var(--text-inverse);
        margin: 0;
    }

.btn-primary {
    display: inline-block;
    width: 100%;
    text-align: center;
    background: var(--primary-mid);
    color: var(--text-inverse) !important;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 15px;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
}

    .btn-primary:hover {
        background: var(--primary-dark);
        transform: translateY(-2px);
        box-shadow: 0 16px 40px rgba(27, 67, 50, 0.18);
    }

/* ── Headings ───────────────────────────────────────────────── */

h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    line-height: 1.3;
}

h1 {
    font-size: 26px;
    font-weight: 800;
}

h2 {
    font-size: 20px;
    font-weight: 700;
    margin-top: 32px;
}

h3 {
    font-size: 16px;
    font-weight: 700;
}

p, li {
    color: var(--text-secondary);
}

/* ── Hero / landing section ────────────────────────────────────── */

.hero {
    text-align: center;
    padding: 56px 0 40px;
}

    .hero .tagline {
        font-family: var(--font-heading);
        color: var(--text-secondary);
        font-size: 15px;
        margin-top: 6px;
    }

    .hero h1 {
        margin: 20px 0 10px;
    }

    .hero p {
        margin-bottom: 0;
    }

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 280px;
    margin: 28px auto 0;
}

.btn-secondary {
    display: inline-block;
    text-align: center;
    background: var(--surface);
    color: var(--primary-mid) !important;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 15px;
    padding: 13px 20px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: transform 0.25s, box-shadow 0.25s;
}

    .btn-secondary:hover {
        transform: translateY(-2px);
        box-shadow: 0 16px 40px rgba(27, 67, 50, 0.10);
    }

/* ── Legal pages (Privacy / Terms) ─────────────────────────────── */

.legal-page {
    padding-top: 32px;
    padding-bottom: 60px;
}

.legal-updated {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.legal-page section {
    margin-bottom: 28px;
}

.legal-page ul {
    padding-left: 20px;
}

.legal-page li {
    margin-bottom: 6px;
}

/* ── Login page ─────────────────────────────────────────────────── */

.auth-page {
    padding-top: 40px;
    padding-bottom: 40px;
    max-width: 380px;
    margin: 0 auto;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 28px 24px;
    transition: transform 0.3s, box-shadow 0.3s;
}

    .auth-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 20px 50px rgba(27, 67, 50, 0.12);
    }

    .auth-card h1 {
        text-align: center;
        margin: 0 0 6px;
    }

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin: 0 0 24px;
}

.form-group {
    margin-bottom: 16px;
}

    .form-group label {
        display: block;
        font-family: var(--font-heading);
        font-size: 13px;
        font-weight: 600;
        color: var(--text-secondary);
        margin-bottom: 6px;
    }

    .form-group input {
        width: 100%;
        padding: 13px 14px;
        border: 1.5px solid var(--border);
        border-radius: var(--radius-sm);
        font-family: var(--font-body);
        font-size: 15px;
        background: var(--surface);
        color: var(--text-primary);
        transition: border-color 0.2s;
    }

        .form-group input:focus {
            outline: none;
            border-color: var(--accent);
        }

.form-error {
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 13px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.field-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* ── Dashboard page ─────────────────────────────────────────────── */

.dashboard-page {
    padding-top: 28px;
    padding-bottom: 48px;
}

.dashboard-greeting {
    margin-bottom: 20px;
}

    .dashboard-greeting p {
        color: var(--text-muted);
        font-size: 13px;
        margin: 2px 0 0;
    }

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-small);
    padding: 16px;
}

    .stat-card .stat-label {
        font-family: var(--font-heading);
        font-size: 12px;
        font-weight: 600;
        color: var(--text-muted);
        margin: 0 0 4px;
    }

    .stat-card .stat-value {
        font-family: var(--font-heading);
        font-size: 22px;
        font-weight: 800;
        color: var(--text-primary);
        margin: 0;
    }

.tier-badge {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--primary-mid);
    background: var(--accent-mist);
    padding: 4px 10px;
    border-radius: 20px;
    margin-top: 8px;
}

.dashboard-note {
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

form.logout-form {
    margin-top: 24px;
}

.btn-outline-danger {
    display: inline-block;
    width: 100%;
    text-align: center;
    background: var(--danger-bg);
    color: var(--danger) !important;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* ── Tablet enhancements (mobile is the default above) ─────────── */

@media (min-width: 768px) {
    .container {
        max-width: 900px;
        padding: 0 32px;
    }

    h1 {
        font-size: 36px;
    }

    .hero {
        padding: 80px 0 56px;
    }

    .hero-actions {
        flex-direction: row;
        max-width: none;
        justify-content: center;
    }

    .btn-primary, .btn-secondary {
        width: auto;
        min-width: 180px;
    }

    .footer-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }

    .footer-brand p {
        margin-bottom: 0;
    }

    .footer-links {
        flex-direction: row;
        gap: 24px;
        margin-bottom: 0;
    }

    .footer-copy {
        text-align: right;
    }

    .auth-page {
        max-width: 460px;
    }

    .auth-card {
        padding: 40px;
    }
}

/* ── Desktop / large-screen enhancements ────────────────────────── */

@media (min-width: 1200px) {
    .container {
        width: min(92%, 1200px);
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 40px;
    }

    /* Header */
    .header-inner {
        height: 82px;
    }

    .logo-word {
        font-size: 30px;
    }

    .main-nav {
        gap: 24px;
    }

        .main-nav a {
            font-size: 15px;
        }

        .main-nav .nav-cta {
            padding: 11px 22px;
        }

    /* Baseline heading bump for non-hero pages (legal, dashboard, etc.)
       — modest, not the hero's oversized display type */
    h1 {
        font-size: 40px;
    }

    /* Hero — this is the ONLY place that gets the big landing-page treatment */
    .hero {
        min-height: 70vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 80px 0;
    }

        .hero > * {
            max-width: 760px;
            margin-inline: auto;
        }

        .hero h1 {
            font-size: 56px;
            line-height: 1.1;
            margin-bottom: 24px;
        }

        .hero p {
            font-size: 20px;
            margin-bottom: 36px;
        }

        .hero .tagline {
            font-size: 18px;
        }

    .hero-actions {
        margin-top: 8px;
    }

    /* Buttons — used everywhere, kept to a sensible desktop size
       rather than hero-scale */
    .btn-primary, .btn-secondary {
        padding: 15px 28px;
        font-size: 16px;
    }

    /* Footer */
    .site-footer {
        padding: 56px 0 32px;
    }

    .footer-inner {
        align-items: flex-start;
    }

    .footer-logo-word {
        font-size: 26px;
    }

    /* Login card */
    .auth-page {
        max-width: 480px;
        padding: 60px 0;
    }

    .auth-card {
        padding: 40px;
    }

    .form-group input {
        height: 50px;
        font-size: 16px;
        padding: 0 14px;
    }

    /* Legal pages — keep tight, no extra breathing room needed here */
    .legal-page {
        padding-top: 40px;
        padding-bottom: 70px;
    }

    /* Dashboard — a touch more room, not hero-scale */
    .dashboard-page {
        padding-top: 36px;
        padding-bottom: 56px;
    }

    .card-hero .hero-value {
        font-size: 36px;
    }
}
