/* ===== VARIABLES ===== */
:root {
    --navy: #1B2A4A;
    --white: #FFFFFF;
    --slate: #4A5568;
    --gold: #C5A55A;
    --emerald: #1A7F64;
    --emerald-dark: #15664F;
    --bg-alt: #F7F8FA;
    --border: #E2E8F0;
    --red: #E53E3E;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--slate);
    background: var(--white);
    line-height: 1.6;
}
h1, h2, h3, h4 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--navy);
    line-height: 1.2;
}
a { color: var(--emerald); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ===== LAYOUT ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4rem 0; }
.section-alt { background: var(--bg-alt); }
.text-center { text-align: center; }
.text-muted { color: #718096; }
.text-sm { font-size: 0.875rem; }
.text-gold { color: var(--gold); }

/* ===== NAVBAR ===== */
.navbar {
    background: var(--navy);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.logo-shield { font-size: 1.5rem; }
.logo-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--gold);
}
.logo-text sup { font-size: 0.6em; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: rgba(255,255,255,0.85); font-size: 0.9rem; }
.nav-links a:hover { color: var(--white); text-decoration: none; }
.nav-toggle { display: none; background: none; border: none; color: var(--white); font-size: 1.5rem; cursor: pointer; }

@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--navy);
        padding: 1rem 1.5rem;
        gap: 1rem;
    }
    .nav-links.open { display: flex; }
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid transparent;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
}
.btn-primary { background: var(--emerald); color: var(--white); border-color: var(--emerald); }
.btn-primary:hover { background: var(--emerald-dark); border-color: var(--emerald-dark); text-decoration: none; }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--border); }
.btn-outline:hover { border-color: var(--navy); text-decoration: none; }
.btn-sm { padding: 0.4rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-block { display: block; width: 100%; }

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-core { background: #EBF4FF; color: #2B6CB0; }
.badge-complete { background: #F0FFF4; color: #276749; }
.badge-none { background: #FFF5F5; color: #C53030; }
.badge-completed { background: #F0FFF4; color: #276749; }
.badge-pending { background: #FFFFF0; color: #B7791F; }

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, var(--navy) 0%, #2D3E5F 100%);
    color: var(--white);
    padding: 6rem 0 5rem;
    text-align: center;
}
.hero h1 { color: var(--white); font-size: 3rem; margin-bottom: 1.5rem; }
.hero-sub { font-size: 1.2rem; max-width: 600px; margin: 0 auto 2rem; opacity: 0.9; }
.hero-badge { margin-bottom: 1.5rem; }
.logo-shield-lg { font-size: 3.5rem; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-cta .btn-outline { color: var(--white); border-color: rgba(255,255,255,0.4); }
.hero-cta .btn-outline:hover { border-color: var(--white); }

@media (max-width: 768px) {
    .hero { padding: 4rem 0 3rem; }
    .hero h1 { font-size: 2rem; }
}

/* ===== SECTION TITLES ===== */
.section-title { text-align: center; font-size: 2rem; margin-bottom: 2.5rem; }

/* ===== MODULE GRID (landing) ===== */
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.module-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    transition: box-shadow 0.2s;
}
.module-card:hover { box-shadow: var(--shadow-lg); }
.module-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.module-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.module-card p { font-size: 0.9rem; }

/* ===== TESTIMONIALS ===== */
.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.testimonial-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}
.testimonial-quote { font-style: italic; font-size: 1.05rem; margin-bottom: 1rem; color: var(--navy); }
.testimonial-author { font-weight: 600; font-size: 0.9rem; color: var(--gold); }

/* ===== PRICING ===== */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; max-width: 700px; margin: 0 auto; }
.pricing-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative;
}
.pricing-featured { border-color: var(--emerald); box-shadow: var(--shadow-lg); }
.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold);
    color: var(--white);
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}
.pricing-amount { font-family: 'Playfair Display', serif; font-size: 3rem; font-weight: 800; color: var(--navy); margin: 0.5rem 0; }
.pricing-period { color: #718096; margin-bottom: 1.5rem; }
.pricing-features { list-style: none; text-align: left; margin-bottom: 2rem; }
.pricing-features li { padding: 0.4rem 0; font-size: 0.95rem; }
.pricing-features .muted { opacity: 0.5; }

/* ===== CTA SECTION ===== */
.section-cta {
    background: linear-gradient(135deg, var(--navy) 0%, #2D3E5F 100%);
    color: var(--white);
    text-align: center;
}
.section-cta h2 { color: var(--white); }
.section-cta p { opacity: 0.85; margin-bottom: 1.5rem; }

/* ===== AUTH FORMS ===== */
.auth-card {
    max-width: 440px;
    margin: 2rem auto;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
}
.auth-card h2 { text-align: center; margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.4rem; font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--emerald);
    box-shadow: 0 0 0 3px rgba(26,127,100,0.15);
}
.form-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; font-size: 0.9rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.link-sm { font-size: 0.85rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; }

/* ===== FLASH MESSAGES ===== */
.flash-container { margin-top: 1rem; }
.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
.flash-error { background: #FFF5F5; color: #C53030; border: 1px solid #FED7D7; }
.flash-success { background: #F0FFF4; color: #276749; border: 1px solid #C6F6D5; }
.flash-info { background: #EBF8FF; color: #2B6CB0; border: 1px solid #BEE3F8; }
.flash-warning { background: #FFFFF0; color: #B7791F; border: 1px solid #FEFCBF; }

/* ===== DASHBOARD ===== */
.dashboard-header { margin-bottom: 1.5rem; }
.dashboard-header h1 { margin-bottom: 0.25rem; }

.progress-overview { margin-bottom: 2rem; }
.progress-bar-outer {
    width: 100%;
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.progress-bar-inner {
    height: 100%;
    background: var(--emerald);
    border-radius: 5px;
    transition: width 0.3s;
}
.progress-label { font-size: 0.85rem; color: #718096; }

/* ===== MODULE ACCORDION ===== */
.module-list { display: flex; flex-direction: column; gap: 0.5rem; }
.module-accordion {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.module-accordion.open { border-color: var(--emerald); }
.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background 0.15s;
}
.module-header:hover { background: var(--bg-alt); }
.module-header-left { display: flex; align-items: center; gap: 1rem; }
.module-header-right { display: flex; align-items: center; gap: 0.75rem; }
.module-header h3 { font-size: 1rem; margin-bottom: 0; }
.module-status { font-size: 1.25rem; }
.chevron { font-size: 1.25rem; color: #718096; transition: transform 0.2s; }
.module-accordion.open .chevron { transform: rotate(180deg); }

.module-lessons { border-top: 1px solid var(--border); }
.lesson-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem 0.75rem 3.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--slate);
    transition: background 0.1s;
}
.lesson-row:last-child { border-bottom: none; }
.lesson-row:hover { background: var(--bg-alt); text-decoration: none; }
.lesson-check { font-size: 1rem; }

/* ===== MODULE DETAIL ===== */
.back-link { display: inline-block; margin-bottom: 1.5rem; font-size: 0.9rem; }
.module-detail-header { margin-bottom: 2rem; }
.module-detail-header h1 { margin-bottom: 0.5rem; }
.module-detail-header p { margin-bottom: 1rem; }

.lesson-list { display: flex; flex-direction: column; gap: 0.75rem; }
.lesson-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--slate);
    transition: all 0.15s;
}
.lesson-card:hover { border-color: var(--emerald); box-shadow: var(--shadow); text-decoration: none; }
.lesson-check-lg { font-size: 1.5rem; }

/* ===== LESSON CONTENT ===== */
.lesson-container { max-width: 800px; }
.lesson-content { margin-bottom: 2rem; }
.lesson-content h1 { margin-bottom: 1.5rem; }
.prose h2 { font-size: 1.4rem; margin: 2rem 0 0.75rem; }
.prose h3 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
.prose p { margin-bottom: 1rem; }
.prose ul, .prose ol { margin: 0.5rem 0 1rem 1.5rem; }
.prose li { margin-bottom: 0.3rem; }
.prose blockquote { border-left: 4px solid var(--gold); padding: 0.75rem 1rem; margin: 1rem 0; background: var(--bg-alt); }
.prose code { background: var(--bg-alt); padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.9em; }

.lesson-actions { margin-bottom: 2rem; }
.lesson-nav { display: flex; justify-content: space-between; }

/* ===== STATE EDITION ===== */
.state-selector { margin-bottom: 2rem; }
.state-selector select {
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    min-width: 250px;
    margin-left: 0.5rem;
}
.state-detail { margin-top: 2rem; }
.state-section { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.state-section:last-child { border-bottom: none; }
.state-section h3 { color: var(--navy); margin-bottom: 0.75rem; }

/* ===== UPGRADE BANNER ===== */
.upgrade-banner {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #EBF8FF, #F0FFF4);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.state-cta { margin-top: 2rem; }

/* ===== ADMIN ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
}
.stat-value { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 700; color: var(--navy); }
.stat-label { font-size: 0.85rem; color: #718096; margin-top: 0.25rem; }

.admin-section { margin-bottom: 2.5rem; }
.admin-section h2 { margin-bottom: 1rem; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th { background: var(--bg-alt); text-align: left; padding: 0.75rem; font-weight: 600; color: var(--navy); border-bottom: 2px solid var(--border); }
.admin-table td { padding: 0.75rem; border-bottom: 1px solid var(--border); }
.admin-table tr:hover td { background: var(--bg-alt); }
.actions-cell { white-space: nowrap; }
.actions-cell form { margin-right: 0.5rem; }

.admin-nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.admin-form { max-width: 600px; }
.admin-form .form-group { margin-bottom: 1.5rem; }

.search-form { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.search-form input { flex: 1; padding: 0.6rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.95rem; }

.pagination { display: flex; gap: 0.25rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* ===== FOOTER ===== */
.footer { padding: 2rem 0; border-top: 1px solid var(--border); text-align: center; font-size: 0.85rem; color: #718096; }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .pricing-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.75rem; }
    .section { padding: 2.5rem 0; }
    .auth-card { padding: 1.5rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .upgrade-banner { flex-direction: column; text-align: center; }
}
