/* DyslexiaAssist — Napier AI
   Free. Forever. For everyone.
   Palette: deep indigo, teal accent, warm gold, clean white */

:root {
    --indigo:    #1e1b4b;
    --indigo-md: #312e81;
    --indigo-lt: #4338ca;
    --teal:      #0d9488;
    --teal-lt:   #14b8a6;
    --gold:      #d97706;
    --gold-lt:   #fbbf24;
    --white:     #ffffff;
    --off-white: #f8f9fc;
    --cream:     #fefce8;
    --grey-lt:   #eef1f7;
    --grey:      #d1d8e8;
    --grey-md:   #8a9bbf;
    --grey-dk:   #4a5568;
    --text:      #1a1a2e;
    --green:     #059669;
    --green-lt:  #d1fae5;
    --amber:     #d97706;
    --amber-lt:  #fef3c7;
    --red:       #dc2626;
    --red-lt:    #fee2e2;
    --shadow:    0 2px 12px rgba(30,27,75,0.10);
    --shadow-lg: 0 8px 32px rgba(30,27,75,0.14);
    --radius:    10px;
    --radius-lg: 16px;
    --font:      'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    --font-dy:   'OpenDyslexic', 'Comic Sans MS', cursive;
    --lh:        1.6;
    --ls:        0;
    --fs-base:   1rem;
    --bg-page:   var(--off-white);
}

/* ── DYSLEXIA-FRIENDLY MODE ──────────────────────────────────────────────────*/
body.dy-mode {
    --font:    var(--font-dy);
    --lh:      1.9;
    --ls:      0.03em;
    --fs-base: 1.08rem;
    --bg-page: #fefce8;
}
body.dy-mode * {
    font-family: var(--font-dy) !important;
    letter-spacing: var(--ls) !important;
    line-height: var(--lh) !important;
    word-spacing: 0.1em !important;
}
body.dy-mode p, body.dy-mode li, body.dy-mode td {
    font-size: var(--fs-base);
}

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

body {
    font-family: var(--font);
    background: var(--bg-page);
    color: var(--text);
    line-height: var(--lh);
    letter-spacing: var(--ls);
    min-height: 100vh;
}

a { color: var(--indigo-lt); text-decoration: none; }
a:hover { color: var(--teal); }

/* ── NAV ─────────────────────────────────────────────────────────────────────*/
.nav {
    background: var(--indigo);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-weight: 800;
    font-size: 1.1rem;
    text-decoration: none;
}
.nav-brand .badge-free {
    background: var(--teal);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.nav-links a {
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    transition: color 0.2s;
}
.nav-links a:hover { color: white; }
.nav-cta {
    background: var(--teal);
    color: white !important;
    padding: 0.45rem 1.1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: background 0.15s;
}
.nav-cta:hover { background: var(--teal-lt) !important; color: var(--indigo) !important; }

/* Reading mode toggle */
.dy-toggle {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    color: white;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    letter-spacing: 0.02em;
}
.dy-toggle:hover { background: rgba(255,255,255,0.2); }
body.dy-mode .dy-toggle { background: var(--gold); border-color: var(--gold); color: var(--indigo); }

/* ── HERO ────────────────────────────────────────────────────────────────────*/
.hero {
    background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-md) 60%, #1e3a8a 100%);
    color: white;
    padding: 4rem 2rem 3.5rem;
    text-align: center;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.9);
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}
.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 1rem;
}
.hero h1 span { color: var(--teal-lt); }
.hero p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.85);
    max-width: 580px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}
.hero-btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── BUTTONS ─────────────────────────────────────────────────────────────────*/
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.65rem 1.4rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.15s;
}
.btn-primary   { background: var(--teal); color: white; }
.btn-primary:hover { background: var(--teal-lt); color: var(--indigo); }
.btn-indigo    { background: var(--indigo-lt); color: white; }
.btn-indigo:hover { background: var(--indigo-md); color: white; }
.btn-outline   { background: transparent; color: var(--indigo); border: 2px solid var(--indigo); }
.btn-outline:hover { background: var(--indigo); color: white; }
.btn-outline-white { background: transparent; color: white; border: 2px solid rgba(255,255,255,0.5); }
.btn-outline-white:hover { background: rgba(255,255,255,0.1); color: white; }
.btn-gold      { background: var(--gold); color: white; }
.btn-gold:hover { background: var(--gold-lt); color: var(--indigo); }
.btn-sm        { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn-danger    { background: var(--red); color: white; }
.btn-danger:hover { opacity: 0.85; }
.btn-full      { width: 100%; justify-content: center; }

/* ── PAGE WRAPPER ────────────────────────────────────────────────────────────*/
.page { max-width: 1100px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.page-sm { max-width: 700px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.page-md { max-width: 860px; margin: 0 auto; padding: 2.5rem 1.5rem; }

/* ── CARDS ───────────────────────────────────────────────────────────────────*/
.card {
    background: white;
    border: 1px solid var(--grey);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}
.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--indigo);
    margin-bottom: 1rem;
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}
.feature-card {
    background: white;
    border: 1px solid var(--grey);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: box-shadow 0.2s, transform 0.2s;
}
.feature-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.feature-card .icon { font-size: 2rem; margin-bottom: 0.75rem; }
.feature-card h3 { font-size: 1rem; font-weight: 700; color: var(--indigo); margin-bottom: 0.4rem; }
.feature-card p { font-size: 0.875rem; color: var(--grey-dk); line-height: 1.6; }

/* ── STATS ───────────────────────────────────────────────────────────────────*/
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: white;
    border: 1px solid var(--grey);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.stat-num { font-size: 2rem; font-weight: 800; color: var(--indigo); }
.stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--grey-md); margin-top: 0.25rem; }

/* ── BADGES ──────────────────────────────────────────────────────────────────*/
.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.badge-teal   { background: #ccfbf1; color: #0f766e; }
.badge-indigo { background: #e0e7ff; color: var(--indigo-lt); }
.badge-gold   { background: var(--amber-lt); color: var(--amber); }
.badge-green  { background: var(--green-lt); color: var(--green); }
.badge-red    { background: var(--red-lt); color: var(--red); }
.badge-grey   { background: var(--grey-lt); color: var(--grey-dk); }

/* ── FORMS ───────────────────────────────────────────────────────────────────*/
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--indigo); margin-bottom: 0.4rem; }
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border: 1.5px solid var(--grey);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    background: white;
    color: var(--text);
    transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--indigo-lt);
    box-shadow: 0 0 0 3px rgba(67,56,202,0.1);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 0.78rem; color: var(--grey-md); margin-top: 0.3rem; }

/* ── CHECKBOXES / RADIO ──────────────────────────────────────────────────────*/
.check-group { display: flex; flex-direction: column; gap: 0.6rem; }
.check-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--grey-lt);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
}
.check-item:hover { background: #e0e7ff; }
.check-item input[type="checkbox"],
.check-item input[type="radio"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--indigo-lt);
    cursor: pointer;
}
.check-item label { font-size: 0.9rem; color: var(--text); cursor: pointer; line-height: 1.5; }

/* ── ALERTS ──────────────────────────────────────────────────────────────────*/
.alert {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}
.alert-success { background: var(--green-lt); color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: var(--red-lt);   color: #991b1b; border: 1px solid #fca5a5; }
.alert-info    { background: #e0e7ff;          color: var(--indigo); border: 1px solid #a5b4fc; }
.alert-warning { background: var(--amber-lt);  color: #92400e; border: 1px solid #fcd34d; }

/* ── PROGRESS BAR ────────────────────────────────────────────────────────────*/
.progress-bar-wrap { background: var(--grey-lt); border-radius: 99px; height: 12px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 99px; transition: width 0.6s ease; }
.progress-bar-fill.green  { background: var(--green); }
.progress-bar-fill.teal   { background: var(--teal); }
.progress-bar-fill.gold   { background: var(--gold); }
.progress-bar-fill.red    { background: var(--red); }

/* ── TABLE ───────────────────────────────────────────────────────────────────*/
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem 1rem; text-align: left; font-size: 0.875rem; border-bottom: 1px solid var(--grey-lt); }
th { background: var(--grey-lt); font-weight: 700; color: var(--indigo); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
tr:hover td { background: #f5f7ff; }

/* ── LETTER PREVIEW ──────────────────────────────────────────────────────────*/
.letter-box {
    background: white;
    border: 1px solid var(--grey);
    border-radius: var(--radius);
    padding: 2rem;
    font-family: 'Times New Roman', serif;
    font-size: 0.95rem;
    line-height: 1.8;
    white-space: pre-wrap;
    color: var(--text);
}

/* ── SECTION HEADERS ─────────────────────────────────────────────────────────*/
.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--indigo);
    margin-bottom: 0.4rem;
}
.section-sub { font-size: 0.95rem; color: var(--grey-dk); margin-bottom: 2rem; }

/* ── PAGE HEADER ─────────────────────────────────────────────────────────────*/
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}
.page-header h1 { font-size: 1.6rem; font-weight: 800; color: var(--indigo); }
.page-header p { font-size: 0.9rem; color: var(--grey-dk); margin-top: 0.25rem; }

/* ── DIVIDER ─────────────────────────────────────────────────────────────────*/
.divider { border: none; border-top: 1px solid var(--grey); margin: 2rem 0; }

/* ── EMPTY STATE ─────────────────────────────────────────────────────────────*/
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--grey-md); }
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; display: block; }
.empty-state p { font-size: 0.9rem; }

/* ── FOOTER ──────────────────────────────────────────────────────────────────*/
.footer {
    background: var(--indigo);
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
    margin-top: 4rem;
}
.footer a { color: var(--teal-lt); }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────────*/
@media (max-width: 640px) {
    .hero { padding: 2.5rem 1rem 2rem; }
    .hero h1 { font-size: 1.8rem; }
    .hero-btns { flex-direction: column; align-items: stretch; }
    .page, .page-sm, .page-md { padding: 1.5rem 1rem; }
    .nav-links .hide-mobile { display: none; }
    .stats-row { grid-template-columns: 1fr 1fr; }
}
