/* ============================================================
   NaijaGuard — main.css
   Design system: light & airy — soft warm neutrals + light green.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
    /* Brand — light & soft */
    --forest: #2c2a26;      /* warm dark — text & headings only */
    --emerald: #7fc8a4;     /* light green — fills, accents */
    --accent: #3f8f6a;      /* readable green — accent text & links */
    --white: #ffffff;

    /* Surfaces & text — light warm neutrals */
    --page: #faf8f4;
    --soft: #f1efe9;        /* light gray panels / footer */
    --tint: #eef6f1;        /* faint green tint */
    --text: #3a3833;
    --muted: #8a857c;
    --border: #e9e5dd;

    /* Semantic (muted) */
    --danger: #c05a48;
    --gold: #c99a5b;
    --success: #3f8f6a;
    --info: #5a8aa0;

    /* Spacing scale (8px base) */
    --xs: 0.5rem;
    --sm: 1rem;
    --md: 1.5rem;
    --lg: 2rem;
    --xl: 3rem;
    --xxl: 4rem;

    /* Radius */
    --r-btn: 8px;
    --r-card: 12px;
    --r-modal: 16px;
    --r-pill: 20px;

    /* Shadows — soft neutral */
    --shadow-hover: 0 6px 20px rgba(44, 42, 38, 0.08);
    --shadow-float: 0 10px 40px rgba(44, 42, 38, 0.12);
    --shadow-header: 0 1px 3px rgba(44, 42, 38, 0.06);
    --shadow-widget: 0 8px 30px rgba(44, 42, 38, 0.14);

    --ease: all 0.25s ease;
    --container: 1200px;

    --font-display: 'Space Grotesk', 'IBM Plex Sans', system-ui, sans-serif;
    --font-body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text);
    background-color: var(--page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, .brand, .tier .price, .stat-item h3, .stat-card .value, .ebook-price {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

img { max-width: 100%; display: block; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
.faq-question:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    border-radius: 3px;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--sm);
}

@media (min-width: 1024px) {
    .container { padding: 0 var(--lg); }
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    display: inline-block;
    min-width: 120px;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--r-btn);
    cursor: pointer;
    transition: var(--ease);
}

/* Primary — light green fill, dark text */
.btn-primary {
    background-color: var(--emerald);
    color: #1f3d2c;
}
.btn-primary:hover { background-color: #6dbd96; transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }

/* Secondary — soft outline */
.btn-secondary {
    background-color: transparent;
    color: var(--forest);
    border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--emerald); background-color: var(--tint); }

/* White / light card button */
.btn-white {
    background-color: var(--white);
    color: var(--forest);
    border: 1.5px solid var(--border);
}
.btn-white:hover { border-color: var(--emerald); transform: translateY(-2px); }

/* Ghost — soft neutral */
.btn-ghost {
    background-color: transparent;
    color: var(--forest);
    border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--emerald); background-color: var(--tint); }

/* Gold — bundle / best value action */
.btn-gold {
    background-color: var(--gold);
    color: #ffffff;
}
.btn-gold:hover { filter: brightness(0.95); transform: translateY(-2px); }

/* Danger */
.btn-danger {
    background-color: var(--danger);
    color: var(--white);
}
.btn-danger:hover { filter: brightness(0.93); }

/* Neutral utility */
.btn-muted {
    background-color: var(--white);
    color: var(--forest);
    border: 1.5px solid var(--border);
}
.btn-muted:hover { border-color: var(--forest); }

.btn-block { display: block; width: 100%; }

/* ============================================================
   LOGO
   ============================================================ */

.brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--forest);
    text-decoration: none;
    letter-spacing: -0.03em;
}
.brand span { color: var(--accent); }
@media (min-width: 1024px) {
    .brand { font-size: 1.6rem; }
}

/* ============================================================
   TOP NAV (homepage)
   ============================================================ */

.mobile-header {
    background-color: var(--white);
    padding: 0.9rem var(--sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.hamburger {
    background: none;
    border: none;
    color: var(--forest);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    width: 44px;
    height: 44px;
}

nav#nav {
    position: fixed;
    left: -300px;
    top: 0;
    width: 250px;
    height: 100vh;
    background-color: var(--white);
    padding: 1rem 0;
    transition: left 0.3s ease;
    z-index: 999;
    overflow-y: auto;
    box-shadow: var(--shadow-float);
}
nav#nav.active { left: 0; }

nav#nav .close-btn {
    background: none;
    border: none;
    color: var(--forest);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0.5rem var(--sm);
    width: 100%;
    text-align: right;
}

nav#nav ul {
    list-style: none;
    padding-top: var(--sm);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

nav#nav a {
    display: block;
    color: var(--text);
    text-decoration: none;
    padding: 0.9rem var(--md);
    border-left: 3px solid transparent;
    transition: var(--ease);
}
nav#nav a:hover,
nav#nav a.active {
    background-color: var(--tint);
    border-left-color: var(--emerald);
    color: var(--accent);
}
nav#nav a.nav-cta {
    margin: 0.75rem var(--md);
    padding: 0.6rem 1rem;
    border-left: none;
    border-radius: var(--r-btn);
    background-color: var(--emerald);
    color: #1f3d2c;
    font-weight: 600;
    text-align: center;
}
nav#nav a.nav-cta:hover { background-color: #6dbd96; }

.nav-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 998;
}
.nav-overlay.active { display: block; }

@media (min-width: 768px) {
    .mobile-header { display: none; }

    nav#nav {
        position: sticky;
        top: 0;
        left: auto;
        width: 100%;
        height: auto;
        padding: 0;
        z-index: 100;
        box-shadow: none;
        border-bottom: 1px solid var(--border);
    }
    nav#nav .inner {
        max-width: var(--container);
        margin: 0 auto;
        padding: 0.9rem var(--lg);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    nav#nav .close-btn { display: none; }
    nav#nav ul {
        flex-direction: row;
        align-items: center;
        gap: var(--lg);
        padding-top: 0;
    }
    nav#nav a {
        padding: 0.25rem 0;
        border-left: none;
        border-bottom: 2px solid transparent;
    }
    nav#nav a:hover,
    nav#nav a.active {
        background: transparent;
        border-left: none;
        border-bottom-color: var(--emerald);
        color: var(--accent);
    }
    nav#nav a.nav-cta { margin: 0; padding: 0.55rem 1.1rem; }
    nav#nav a.nav-cta:hover { border-bottom: none; color: #1f3d2c; }
    .nav-overlay { display: none !important; }
}

nav#nav .inner .brand { display: none; }
@media (min-width: 768px) {
    nav#nav .inner .brand { display: inline-block; }
}

/* ============================================================
   HERO + SCAM TEARDOWN
   ============================================================ */

.hero {
    background: linear-gradient(165deg, var(--tint) 0%, var(--page) 60%);
    color: var(--text);
    padding: var(--xl) var(--sm) var(--xxl);
    border-bottom: 1px solid var(--border);
}

.hero .inner {
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    gap: var(--xl);
    align-items: center;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(127, 200, 164, 0.16);
    border: 1px solid rgba(127, 200, 164, 0.45);
    padding: 0.35rem 0.8rem;
    border-radius: var(--r-pill);
    margin-bottom: var(--md);
}

.hero h1 {
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--forest);
    margin-bottom: var(--sm);
}
.hero h1 .accent { color: var(--accent); }

.hero p.lede {
    font-size: 1.05rem;
    color: var(--muted);
    max-width: 540px;
    margin-bottom: var(--lg);
}

.hero-buttons {
    display: flex;
    gap: var(--sm);
    flex-wrap: wrap;
    margin-bottom: var(--lg);
}

.hero-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    font-size: 0.85rem;
    color: var(--muted);
}
.hero-trust span { white-space: nowrap; }
.hero-trust .tick { color: var(--accent); font-weight: 700; }

/* The phone / scam teardown card */
.teardown {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--r-modal);
    padding: 1.1rem;
    box-shadow: var(--shadow-float);
    max-width: 380px;
    width: 100%;
    margin: 0 auto;
}
.teardown-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
}
.teardown-bar .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--danger);
}
.sms {
    background: var(--soft);
    color: var(--text);
    border-radius: 14px 14px 14px 4px;
    padding: 0.9rem 1rem;
    font-size: 0.92rem;
    line-height: 1.5;
}
.sms .sender {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 0.35rem;
}
.flag {
    color: var(--danger);
    font-weight: 700;
    text-decoration: underline dotted var(--danger);
    text-underline-offset: 3px;
    cursor: help;
}
.teardown-flags {
    list-style: none;
    margin-top: 0.9rem;
    display: grid;
    gap: 0.45rem;
}
.teardown-flags li {
    display: flex;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text);
}
.teardown-flags .mark { color: var(--gold); flex-shrink: 0; }
.teardown-verdict {
    margin-top: 0.9rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #1f3d2c;
    background: var(--emerald);
    border-radius: var(--r-btn);
    padding: 0.55rem;
}

@media (min-width: 1024px) {
    .hero { padding: var(--xxl) var(--lg); }
    .hero .inner { grid-template-columns: 1.05fr 0.95fr; }
    .hero h1 { font-size: 3rem; }
    .hero p.lede { font-size: 1.2rem; }
    .teardown { margin: 0 0 0 auto; }
}

/* ============================================================
   SECTION SCAFFOLDING
   ============================================================ */

.section { padding: var(--lg) var(--sm); }
.section .inner { max-width: var(--container); margin: 0 auto; }
.section--gray { background-color: var(--soft); }
.section--white { background-color: var(--white); }

.section-head { text-align: center; margin-bottom: var(--lg); }
.section-head .eyebrow {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.5rem;
}
.section-head h2 {
    font-size: 1.6rem;
    line-height: 1.15;
    color: var(--forest);
}
.section-head p {
    color: var(--muted);
    max-width: 600px;
    margin: 0.5rem auto 0;
    font-size: 0.95rem;
}

@media (min-width: 1024px) {
    .section { padding: var(--xl) var(--lg); }
    .section--tall { padding: var(--xxl) var(--lg); }
    .section-head h2 { font-size: 2.1rem; }
}

/* ============================================================
   STATS
   ============================================================ */

.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--md);
    text-align: center;
}
.stat-item h3 {
    color: var(--forest);
    font-size: 1.9rem;
    line-height: 1.05;
    margin-bottom: 0.35rem;
}
.stat-item p { color: var(--muted); font-size: 0.9rem; }

@media (min-width: 768px) {
    .stats { grid-template-columns: repeat(4, 1fr); }
    .stat-item h3 { font-size: 2.3rem; }
}

/* ============================================================
   SCAM TYPE CARDS
   ============================================================ */

.scams-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--md);
}
.scam-card {
    background-color: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    padding: var(--md);
    text-align: left;
    transition: var(--ease);
}
.scam-card:hover {
    border-color: var(--emerald);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}
.scam-icon {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-display);
    margin-bottom: 0.6rem;
}
.scam-card h3 { color: var(--forest); font-size: 1.1rem; margin-bottom: 0.4rem; }
.scam-card p { color: var(--muted); font-size: 0.9rem; margin-bottom: var(--sm); }
.scam-card a { font-size: 0.9rem; padding: 0.55rem 1rem; min-width: 0; }

@media (min-width: 768px) {
    .scams-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}

/* ============================================================
   HOW IT WORKS
   ============================================================ */

.steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--md);
    counter-reset: step;
}
.step {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    padding: var(--md);
}
.step .num {
    counter-increment: step;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 10px;
    background: var(--tint);
    color: var(--accent);
    font-family: var(--font-display);
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.step .num::before { content: counter(step); }
.step h3 { color: var(--forest); font-size: 1.1rem; margin-bottom: 0.35rem; }
.step p { color: var(--muted); font-size: 0.92rem; }

@media (min-width: 768px) {
    .steps { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   TESTIMONIALS
   ============================================================ */

.testimonials-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--md);
}
.testimonial-card {
    background-color: var(--white);
    padding: var(--md);
    border-radius: var(--r-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--emerald);
}
.testimonial-card .rating { color: var(--gold); font-size: 0.95rem; margin-bottom: 0.5rem; }
.testimonial-card p { color: var(--text); margin-bottom: var(--sm); font-size: 0.95rem; }
.testimonial-author { font-weight: 600; color: var(--forest); font-size: 0.9rem; }

@media (min-width: 768px) {
    .testimonials-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   PRICING TIERS
   ============================================================ */

.pricing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--md);
    align-items: stretch;
}
.tier {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    padding: var(--md);
    display: flex;
    flex-direction: column;
    transition: var(--ease);
}
.tier:hover { border-color: var(--emerald); box-shadow: var(--shadow-hover); }
.tier h3 { color: var(--forest); font-size: 1.2rem; margin-bottom: 0.5rem; }
.tier .price {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--forest);
    line-height: 1.05;
}
.tier .price small { font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.tier .value { color: var(--muted); font-size: 0.9rem; margin: 0.5rem 0 var(--sm); }
.tier ul { list-style: none; display: grid; gap: 0.5rem; margin-bottom: var(--md); }
.tier ul li { font-size: 0.9rem; color: var(--text); display: flex; gap: 0.5rem; }
.tier ul li::before { content: '✓'; color: var(--accent); font-weight: 700; }
.tier ul li.no { color: var(--muted); }
.tier ul li.no::before { content: '✕'; color: var(--border); }
.tier .btn { margin-top: auto; }

.tier--featured {
    background: var(--tint);
    border: 1.5px solid var(--emerald);
    position: relative;
    overflow: hidden;
}
.tier--featured:hover { box-shadow: var(--shadow-float); transform: translateY(-2px); }
.best-badge {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    background: var(--accent);
    color: var(--white);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.25rem 0.6rem;
    border-radius: var(--r-pill);
}

@media (min-width: 768px) {
    .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .pricing-grid { grid-template-columns: repeat(4, 1fr); }
    .tier--featured { transform: scale(1.03); }
    .tier--featured:hover { transform: scale(1.03) translateY(-2px); }
}

/* ============================================================
   EMERGENCY
   ============================================================ */

.emergency {
    background-color: #fdf3f0;
    border: 1px solid #f2d3cb;
    border-left: 4px solid var(--danger);
    border-radius: var(--r-card);
    padding: var(--md);
}
.emergency h2 {
    color: var(--danger);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.emergency > p { color: var(--muted); margin-bottom: var(--md); font-size: 0.95rem; }
.emergency-contacts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sm);
}
.emergency-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--r-btn);
    padding: 0.9rem;
}
.emergency-item h4 { color: var(--forest); font-size: 0.9rem; margin-bottom: 0.25rem; }
.emergency-item p { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.emergency-item small { display: block; color: var(--muted); font-weight: 400; font-size: 0.78rem; }

@media (min-width: 768px) {
    .emergency-contacts { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================
   FAQ ACCORDION
   ============================================================ */

.faq-wrap { max-width: 800px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-question {
    width: 100%;
    background: transparent;
    border: none;
    text-align: left;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--forest);
    padding: var(--sm) var(--md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sm);
    cursor: pointer;
}
.faq-question .toggle { color: var(--accent); font-size: 1.4rem; line-height: 1; flex-shrink: 0; }
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    color: var(--muted);
}
.faq-answer .pad { padding: 0 var(--md) var(--sm); font-size: 0.95rem; }
.faq-item.open .faq-answer { max-height: 320px; }

/* ============================================================
   FOOTER
   ============================================================ */

footer.site-footer {
    background-color: var(--soft);
    color: var(--muted);
    padding: var(--xl) var(--sm) var(--lg);
    border-top: 1px solid var(--border);
}
.footer-grid {
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--lg);
}
.footer-grid h4 { color: var(--forest); font-size: 0.95rem; margin-bottom: 0.75rem; }
.footer-grid .brand { display: inline-block; margin-bottom: 0.5rem; }
.footer-grid p { font-size: 0.9rem; line-height: 1.7; }
.footer-grid ul { list-style: none; display: grid; gap: 0.5rem; }
.footer-grid a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.footer-grid a:hover { color: var(--accent); }
.footer-bottom {
    max-width: var(--container);
    margin: var(--lg) auto 0;
    padding-top: var(--sm);
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    justify-content: space-between;
}
.footer-trust { color: var(--muted); }

@media (min-width: 768px) {
    .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
}

/* ============================================================
   FLOATING CHATBOT SHORTCUT
   ============================================================ */

.chat-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--emerald);
    color: #1f3d2c;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: var(--shadow-widget);
    z-index: 500;
    transition: var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.chat-fab:hover { background: #6dbd96; transform: translateY(-2px); }

/* ============================================================
   LOGIN / SIGNUP PAGE
   ============================================================ */

body.auth-page {
    background: linear-gradient(165deg, var(--tint), var(--page));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--lg) var(--sm);
}
.auth-back { width: 100%; max-width: 420px; margin-bottom: var(--sm); }
.auth-back a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.auth-back a:hover { color: var(--accent); }

.auth-card {
    background-color: var(--white);
    border-radius: var(--r-modal);
    box-shadow: var(--shadow-float);
    border: 1px solid var(--border);
    max-width: 420px;
    width: 100%;
    padding: var(--lg);
}
.auth-logo { text-align: center; margin-bottom: var(--md); }
.auth-logo .brand { color: var(--forest); font-size: 1.6rem; }
.auth-logo p { color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem; }

.form-toggle {
    display: flex;
    margin-bottom: var(--md);
    border-bottom: 2px solid var(--border);
}
.form-toggle button {
    flex: 1;
    padding: 0.8rem;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
}
.form-toggle button.active { color: var(--forest); }
.form-toggle button.active::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    height: 3px;
    background-color: var(--emerald);
}

.form-section { display: none; }
.form-section.active { display: block; }

.form-group { margin-bottom: var(--sm); }
.form-row { display: flex; justify-content: space-between; align-items: baseline; }
.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}
.form-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--r-btn);
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s;
}
.form-group input:focus { outline: none; border-color: var(--emerald); }
.form-group input.invalid { border-color: var(--danger); }
.form-group input.valid { border-color: var(--success); }
.field-hint { color: var(--muted); font-size: 0.8rem; margin-top: 0.3rem; }
.forgot { font-size: 0.85rem; color: var(--accent); text-decoration: none; font-weight: 600; }
.forgot:hover { text-decoration: underline; }

.password-requirements { list-style: none; margin-top: 0.5rem; }
.password-requirements li {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 0.25rem;
    display: flex;
    gap: 0.4rem;
}
.password-requirements li::before { content: '✗'; color: var(--danger); font-weight: 700; }
.password-requirements li.met { color: var(--success); }
.password-requirements li.met::before { content: '✓'; color: var(--success); }

.auth-card .btn { margin-top: 0.5rem; }
.auth-alt { text-align: center; margin-top: var(--sm); color: var(--muted); font-size: 0.9rem; }
.auth-alt a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-alt a:hover { text-decoration: underline; }

.message-banner { padding: 0.8rem 1rem; border-radius: var(--r-btn); margin-bottom: var(--sm); font-size: 0.9rem; display: none; }
.message-banner.show { display: block; }
.message-banner.success { background-color: #e4f3ea; color: #256247; }
.message-banner.error { background-color: #fbe7e2; color: #8f3a2c; }

/* ============================================================
   DASHBOARD PAGE
   ============================================================ */

body.dashboard-page { background-color: var(--page); }

.dash-header {
    background-color: var(--white);
    padding: 0.9rem var(--sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.sidebar {
    position: fixed;
    left: 0; top: 0;
    width: 250px;
    height: 100vh;
    background-color: var(--white);
    color: var(--text);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid var(--border);
}
.sidebar.active { transform: translateX(0); }
.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sm) var(--md);
    border-bottom: 1px solid var(--border);
}
.sidebar-close {
    background: none; border: none; color: var(--forest);
    font-size: 1.5rem; cursor: pointer; width: 40px; height: 40px;
}
.sidebar-menu { list-style: none; padding-top: var(--sm); flex: 1; }
.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.9rem var(--md);
    color: var(--text);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: var(--ease);
    cursor: pointer;
}
.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: var(--tint);
    border-left-color: var(--emerald);
    color: var(--accent);
}
.sidebar-logout { padding: var(--md); border-top: 1px solid var(--border); }

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 998;
}
.sidebar-overlay.active { display: block; }

.main-content { padding: var(--md); max-width: var(--container); margin: 0 auto; }

.welcome-box {
    background-color: var(--white);
    padding: var(--md);
    border-radius: var(--r-card);
    margin-bottom: var(--lg);
    border: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    justify-content: space-between;
}
.welcome-box h2 { color: var(--forest); font-size: 1.3rem; }
.welcome-box p { color: var(--muted); font-size: 0.92rem; }
.tier-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: var(--r-pill);
    font-size: 0.78rem;
    font-weight: 600;
}
.tier-badge.free { background: var(--soft); color: var(--muted); }
.tier-badge.ebook { background: var(--tint); color: var(--accent); border: 1px solid var(--emerald); }
.tier-badge.premium { background: var(--gold); color: #ffffff; }

.dash-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sm);
    margin-bottom: var(--lg);
}
.stat-card {
    background-color: var(--white);
    padding: 1.1rem var(--sm);
    border-radius: var(--r-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--emerald);
}
.stat-card h3 { color: var(--muted); font-size: 0.82rem; font-weight: 600; margin-bottom: 0.35rem; }
.stat-card .value { color: var(--forest); font-size: 1.7rem; font-weight: 700; line-height: 1.05; }

.tab-buttons {
    display: flex;
    gap: 0.25rem;
    margin-bottom: var(--md);
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
}
.tab-button {
    padding: 0.8rem 1rem;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
}
.tab-button.active { color: var(--forest); }
.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    height: 3px;
    background-color: var(--emerald);
}

.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-content h2 { color: var(--forest); font-size: 1.3rem; margin-bottom: var(--md); }

.ebooks-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--md);
    margin-bottom: var(--lg);
}
.ebook-card {
    background-color: var(--white);
    border-radius: var(--r-card);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--ease);
    display: flex;
    flex-direction: column;
}
.ebook-card:hover { border-color: var(--emerald); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.ebook-icon {
    background: var(--tint);
    padding: var(--md);
    text-align: center;
    font-size: 1.6rem;
}
.ebook-info { padding: var(--md); display: flex; flex-direction: column; flex: 1; }
.ebook-info h3 { color: var(--forest); font-size: 1.1rem; margin-bottom: 0.25rem; }
.ebook-rating { color: var(--gold); font-size: 0.82rem; margin-bottom: 0.4rem; }
.ebook-info p { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.75rem; }
.ebook-price { font-size: 1.3rem; font-weight: 700; color: var(--forest); margin-bottom: 0.75rem; }
.ebook-info .btn { margin-top: auto; }

.bundle-card {
    background: var(--tint);
    border: 1.5px solid var(--emerald);
    color: var(--text);
    border-radius: var(--r-card);
    padding: var(--lg);
    position: relative;
    overflow: hidden;
    margin-bottom: var(--lg);
}
.bundle-card h3 { color: var(--forest); font-size: 1.4rem; margin-bottom: 0.5rem; }
.bundle-card p { color: var(--muted); margin-bottom: var(--sm); font-size: 0.95rem; }
.bundle-card .price { font-size: 1.9rem; font-weight: 700; color: var(--forest); margin-bottom: var(--sm); font-family: var(--font-display); }
.bundle-card .price small { font-size: 0.85rem; font-weight: 400; color: var(--muted); }

.panel {
    background-color: var(--white);
    padding: var(--md);
    border-radius: var(--r-card);
    border: 1px solid var(--border);
    margin-bottom: var(--md);
}
.panel h3 { color: var(--forest); margin-bottom: var(--sm); font-size: 1.1rem; }
.feature-list { list-style: none; display: grid; gap: 0.5rem; margin-bottom: var(--md); }
.feature-list li { display: flex; gap: 0.5rem; font-size: 0.92rem; color: var(--text); }
.feature-list li::before { content: '✓'; color: var(--accent); font-weight: 700; }

.callout {
    border-radius: var(--r-card);
    padding: var(--sm) var(--md);
    border-left: 4px solid var(--gold);
    background: #fbf5ea;
}
.callout h4 { color: #8a6023; margin-bottom: 0.35rem; font-size: 0.95rem; }
.callout p { color: #8a6023; font-size: 0.9rem; margin-bottom: 0.5rem; }

.profile-field { margin-bottom: var(--sm); }
.profile-field .label { color: var(--muted); font-size: 0.82rem; font-weight: 600; display: block; margin-bottom: 0.2rem; }
.profile-field .data { color: var(--forest); font-size: 1rem; }
.danger-zone {
    border: 1px solid #f2d3cb;
    border-radius: var(--r-card);
    padding: var(--md);
    background: #fdf3f0;
}
.danger-zone h3 { color: var(--danger); }
.danger-zone .row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: var(--sm); }

.story-card {
    background-color: var(--white);
    padding: var(--md);
    border-radius: var(--r-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--emerald);
    margin-bottom: var(--sm);
}
.story-card h4 { color: var(--forest); font-size: 1rem; margin-bottom: 0.25rem; }
.story-meta { color: var(--muted); font-size: 0.8rem; margin-bottom: 0.6rem; }
.story-card p { color: var(--text); font-size: 0.92rem; margin-bottom: 0.6rem; }
.story-badge {
    display: inline-block;
    background-color: var(--tint);
    color: var(--accent);
    border: 1px solid var(--emerald);
    padding: 0.2rem 0.7rem;
    border-radius: var(--r-pill);
    font-size: 0.72rem;
    font-weight: 600;
}
.empty-state { text-align: center; padding: var(--xl) var(--sm); color: var(--muted); }
.empty-state .emoji { font-size: 2.4rem; margin-bottom: var(--sm); }
.empty-state a { color: var(--accent); text-decoration: none; font-weight: 600; }

@media (min-width: 768px) {
    .dash-header { display: none; }
    body.dashboard-page .layout { display: flex; }
    .sidebar { transform: translateX(0); }
    .sidebar-close { display: none; }
    .sidebar-overlay { display: none !important; }
    .main-content { margin-left: 250px; padding: var(--lg); }
    .dash-stats { grid-template-columns: repeat(4, 1fr); }
    .ebooks-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
    .stat-card .value { font-size: 2rem; }
}

.sidebar .brand { font-size: 1.4rem; }

/* ============================================================
   MOTION PREFERENCES
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}
