:root {
    --primary: #C8102E;
    --primary-hover: #A50D25;
    --primary-soft: rgba(200, 16, 46, 0.08);
    --primary-glow: rgba(200, 16, 46, 0.25);
    --accent: #E8B923;
    --accent-soft: rgba(232, 185, 35, 0.15);
    --dark: #0F172A;
    --dark-mid: #1E293B;
    --dark-soft: #334155;
    --text: #1E293B;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --bg: #F1F5F9;
    --bg-elevated: #FFFFFF;
    --white: #FFFFFF;
    --success: #059669;
    --success-soft: #D1FAE5;
    --warning: #D97706;
    --warning-soft: #FEF3C7;
    --danger: #DC2626;
    --danger-soft: #FEE2E2;
    --info: #0284C7;
    --info-soft: #E0F2FE;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
    --shadow-primary: 0 8px 30px rgba(200, 16, 46, 0.25);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --nav-height: 76px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

.flash-wrap { padding-top: 16px; }

/* ─── Navbar ─── */
.navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--dark);
}

.logo-mark {
    flex-shrink: 0;
    border-radius: 10px;
    box-shadow: var(--shadow-xs);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.logo-text strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.02em;
}

.logo-text small {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links > a:not(.btn) {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-links > a:not(.btn):hover,
.nav-links > a:not(.btn).active {
    color: var(--primary);
    background: var(--primary-soft);
}

.nav-premium {
    color: var(--warning) !important;
    font-weight: 600 !important;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 8px;
    padding-left: 16px;
    border-left: 1px solid var(--border);
}

.user-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-badge {
    font-size: 0.65rem;
    padding: 4px 10px;
    border-radius: 100px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.user-badge.premium {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: #92400E;
}

.user-badge.free {
    background: var(--border-light);
    color: var(--text-muted);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--dark);
    border-radius: 2px;
    transition: var(--transition);
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 12px 36px rgba(200, 16, 46, 0.35);
}

.btn-secondary {
    background: var(--accent);
    color: var(--dark);
    border-color: var(--accent);
}

.btn-secondary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--border);
}

.btn-outline:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--border-light);
    color: var(--dark);
}

.btn-hero-outline {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-color: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px);
}

.btn-hero-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-lg { padding: 15px 28px; font-size: 0.95rem; }
.btn-block { width: 100%; }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }

/* ─── Hero ─── */
.hero {
    background: var(--dark);
    color: var(--white);
    padding: 72px 0 88px;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 70% 20%, rgba(200, 16, 46, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 10% 80%, rgba(232, 185, 35, 0.12) 0%, transparent 50%),
        linear-gradient(160deg, #0F172A 0%, #1E293B 45%, #0F172A 100%);
}

.hero-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
}

.hero-content { max-width: 560px; }

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 14px 6px 8px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: rgba(255, 255, 255, 0.9);
}

.hero-eyebrow-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero h1 {
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.12;
    margin-bottom: 20px;
    letter-spacing: -0.03em;
}

.hero h1 .highlight {
    background: linear-gradient(135deg, var(--accent) 0%, #F5D76E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 32px;
    line-height: 1.75;
    max-width: 480px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.hero-stats {
    display: flex;
    gap: 32px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-stat strong {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.hero-stat span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
}

/* Hero visual card */
.hero-visual { position: relative; }

.hero-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    padding: 28px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
}

.hero-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-card-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.hero-card-title { font-weight: 700; font-size: 0.95rem; }
.hero-card-sub { font-size: 0.75rem; color: rgba(255,255,255,0.5); }

.hero-module-list { display: flex; flex-direction: column; gap: 10px; }

.hero-module-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.85rem;
    transition: var(--transition);
}

.hero-module-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.hero-module-icon { font-size: 1.25rem; }
.hero-module-progress {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 700;
}

.hero-float-badge {
    position: absolute;
    bottom: -16px;
    left: -16px;
    background: var(--white);
    color: var(--dark);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-float-badge span { color: var(--success); font-size: 1.1rem; }

/* Trust bar */
.trust-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
}

.trust-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.trust-item svg { color: var(--primary); flex-shrink: 0; }

/* ─── Sections ─── */
.section { padding: 88px 0; }
.section-alt { background: var(--white); }
.section-dark { background: var(--dark); color: white; }

.section-header {
    text-align: center;
    margin-bottom: 56px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-bottom: 12px;
}

.section-header h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    color: var(--dark);
    margin-bottom: 14px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.section-dark .section-header h2 { color: white; }
.section-dark .section-label { color: var(--accent); }

.section-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ─── Cards ─── */
.card {
    background: var(--bg-elevated);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
    border-color: #CBD5E1;
}

.card-body { padding: 24px; }
.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 { font-size: 1rem; font-weight: 700; color: var(--dark); }
.card-footer { padding: 16px 24px; border-top: 1px solid var(--border); background: var(--bg); }

/* ─── Features ─── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.feature-card {
    padding: 28px 24px;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: var(--transition);
}

.feature-card:hover {
    border-color: transparent;
    box-shadow: var(--shadow);
    transform: translateY(-4px);
}

.feature-card:hover::before { opacity: 1; }

.feature-icon-wrap {
    width: 48px;
    height: 48px;
    background: var(--primary-soft);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 18px;
}

.feature-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark);
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ─── Modules ─── */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.module-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    border: 1px solid var(--border);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    position: relative;
}

.module-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.module-card-num {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-light);
    background: var(--bg);
    padding: 4px 10px;
    border-radius: 100px;
}

.module-icon {
    width: 52px;
    height: 52px;
    background: var(--bg);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 18px;
}

.module-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark);
    letter-spacing: -0.01em;
}

.module-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    flex: 1;
    line-height: 1.6;
}

.module-meta {
    display: flex;
    gap: 16px;
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 500;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.module-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.module-arrow {
    margin-left: auto;
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
    opacity: 0;
    transition: var(--transition);
}

.module-card:hover .module-arrow { opacity: 1; }

/* ─── Pricing ─── */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 820px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    border: 1px solid var(--border);
    position: relative;
    transition: var(--transition);
}

.pricing-card.featured {
    border: 2px solid var(--primary);
    box-shadow: var(--shadow-lg);
}

.pricing-badge {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 5px 16px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pricing-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.pricing-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.pricing-price {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 24px;
}

.pricing-card.featured .pricing-price { color: var(--primary); }

.pricing-price small {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.pricing-features {
    list-style: none;
    margin-bottom: 28px;
}

.pricing-features li {
    padding: 10px 0;
    font-size: 0.875rem;
    color: var(--text);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-bottom: 1px solid var(--border-light);
}

.pricing-features li:last-child { border-bottom: none; }

.pricing-features li::before {
    content: '✓';
    color: var(--success);
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ─── CTA ─── */
.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, #8B0A1F 100%);
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 50%, rgba(255,255,255,0.1) 0%, transparent 60%);
}

.cta-inner { position: relative; z-index: 1; }

.cta-section h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 800;
    color: white;
    margin-bottom: 14px;
    letter-spacing: -0.02em;
}

.cta-section p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.05rem;
    margin-bottom: 32px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

/* ─── How it works ─── */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.step-card { text-align: center; }

.step-num {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-primary);
}

.step-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark);
}

.step-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ─── Forms ─── */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 7px;
    font-size: 0.875rem;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
    color: var(--text);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-control::placeholder { color: var(--text-light); }

textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

/* ─── Auth ─── */
.auth-layout {
    min-height: calc(100vh - var(--nav-height));
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.auth-brand {
    background: var(--dark);
    color: white;
    padding: 60px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 70%, rgba(200,16,46,0.3) 0%, transparent 60%);
}

.auth-brand-inner { position: relative; z-index: 1; }

.auth-brand h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.auth-brand p {
    color: rgba(255,255,255,0.7);
    line-height: 1.7;
    margin-bottom: 32px;
}

.auth-features { list-style: none; }

.auth-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.85);
}

.auth-features li::before {
    content: '✓';
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--accent);
    flex-shrink: 0;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: var(--bg);
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.auth-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--dark);
    letter-spacing: -0.02em;
}

.auth-card .subtitle {
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 0.9rem;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover { text-decoration: underline; }

.auth-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

/* ─── Dashboard ─── */
.dashboard-header {
    background: var(--dark);
    color: white;
    padding: 48px 0;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.dashboard-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 80% 0%, rgba(200,16,46,0.25) 0%, transparent 55%);
}

.dashboard-header .container { position: relative; z-index: 1; }

.dashboard-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.dashboard-header p { color: rgba(255,255,255,0.65); font-size: 0.95rem; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 22px 24px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: #CBD5E1;
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-card .stat-icon.red { background: var(--danger-soft); }
.stat-card .stat-icon.yellow { background: var(--warning-soft); }
.stat-card .stat-icon.green { background: var(--success-soft); }
.stat-card .stat-icon.blue { background: var(--info-soft); }

.stat-card .stat-info strong {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.02em;
}

.stat-card .stat-info span {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ─── Quiz ─── */
.quiz-container { max-width: 760px; margin: 0 auto; padding: 32px 24px; }

.quiz-progress {
    background: var(--border);
    border-radius: 100px;
    height: 6px;
    margin-bottom: 28px;
    overflow: hidden;
}

.quiz-progress-bar {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    height: 100%;
    border-radius: 100px;
    transition: width 0.5s ease;
}

.quiz-question {
    background: var(--white);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.quiz-question h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 24px;
    line-height: 1.65;
    color: var(--dark);
}

.quiz-number {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.quiz-options { display: flex; flex-direction: column; gap: 10px; }

.quiz-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    background: var(--white);
}

.quiz-option:hover { border-color: var(--primary); background: var(--primary-soft); }
.quiz-option.selected { border-color: var(--primary); background: var(--primary-soft); }
.quiz-option.correct { border-color: var(--success); background: var(--success-soft); }
.quiz-option.incorrect { border-color: var(--danger); background: var(--danger-soft); }

.quiz-option .option-letter {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    color: var(--text-muted);
}

.quiz-option.selected .option-letter,
.quiz-option:hover .option-letter {
    background: var(--primary);
    color: white;
}

.quiz-explanation {
    background: var(--info-soft);
    border-left: 3px solid var(--info);
    padding: 16px 18px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-top: 16px;
    font-size: 0.875rem;
    line-height: 1.6;
}

.quiz-timer {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 16px;
    font-variant-numeric: tabular-nums;
}

/* ─── Tables ─── */
.ranking-table { width: 100%; border-collapse: collapse; }

.ranking-table th,
.ranking-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.ranking-table th {
    background: var(--bg);
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ranking-table tbody tr { transition: var(--transition); }
.ranking-table tbody tr:hover { background: var(--primary-soft); }

.rank-position {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
}

.rank-1 { background: #FEF3C7; color: #92400E; }
.rank-2 { background: #F1F5F9; color: #475569; }
.rank-3 { background: #FFEDD5; color: #9A3412; }
.rank-other { background: var(--bg); color: var(--text-muted); }

/* ─── AI Chat ─── */
.ai-container { max-width: 760px; margin: 0 auto; padding: 32px 24px; }

.ai-chat {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    height: 520px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ai-message {
    max-width: 82%;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    line-height: 1.65;
}

.ai-message.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message.bot {
    align-self: flex-start;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.ai-input-area {
    display: flex;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.ai-input-area input {
    flex: 1;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    background: white;
}

.ai-input-area input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.ai-input-area .btn { padding: 12px 16px; min-width: 48px; }

.gpt-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
}

.gpt-badge-off {
    color: rgba(255,255,255,0.6);
    border-color: rgba(255,255,255,0.15);
}

.ai-msg-content { line-height: 1.65; }
.ai-msg-content strong { font-weight: 700; color: inherit; }

.ai-msg-meta {
    display: block;
    font-size: 0.65rem;
    opacity: 0.55;
    margin-top: 6px;
    font-weight: 500;
}

.ai-message.user .ai-msg-meta { text-align: right; }

.ai-typing .ai-msg-content {
    display: flex;
    gap: 5px;
    padding: 4px 0;
}

.ai-typing .dot {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: aiBounce 1.2s infinite;
}

.ai-typing .dot:nth-child(2) { animation-delay: 0.15s; }
.ai-typing .dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes aiBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

.ai-suggestions {
    margin-top: 20px;
}

.ai-suggestions p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 600;
}

.ai-suggestion-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-btn {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
}

.suggestion-btn:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
}

/* ─── Certificate ─── */
.certificate {
    background: var(--white);
    border: 2px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 56px 48px;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.certificate::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius-lg) - 6px);
    pointer-events: none;
}

.certificate h2 {
    color: var(--primary);
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.certificate .cert-code {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 24px;
    font-family: monospace;
}

/* ─── Alerts ─── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success { background: var(--success-soft); color: #065F46; border: 1px solid #A7F3D0; }
.alert-danger { background: var(--danger-soft); color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background: var(--warning-soft); color: #92400E; border: 1px solid #FDE68A; }
.alert-info { background: var(--info-soft); color: #075985; border: 1px solid #BAE6FD; }

/* ─── Admin ─── */
.admin-sidebar {
    background: var(--dark);
    color: white;
    width: 260px;
    min-height: calc(100vh - var(--nav-height));
    padding: 20px 0;
    position: fixed;
    left: 0;
    top: var(--nav-height);
    border-right: 1px solid rgba(255,255,255,0.06);
}

.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    margin: 2px 12px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: rgba(255,255,255,0.08);
    color: white;
}

.admin-sidebar hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 16px 20px;
}

.admin-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    min-height: calc(100vh - var(--nav-height));
    min-width: 0;
}

.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}
.data-table th {
    background: var(--bg);
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.data-table tbody tr:hover { background: var(--bg); }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
}

.badge-success { background: var(--success-soft); color: #065F46; }
.badge-danger { background: var(--danger-soft); color: #991B1B; }
.badge-warning { background: var(--warning-soft); color: #92400E; }
.badge-info { background: var(--info-soft); color: #075985; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.02em;
}

.page-content {
    padding-bottom: 56px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.form-row-split { gap: 12px; }
.form-group-compact { margin-bottom: 0; }

@media (max-width: 480px) {
    .form-row-split { grid-template-columns: 1fr; }
    .form-group-compact { margin-bottom: 20px; }
}

/* ─── Study ─── */
.topic-list { list-style: none; }

.topic-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.topic-item:last-child { border-bottom: none; }
.topic-item:hover { background: var(--primary-soft); }
.topic-item.completed .topic-title::before { content: '✓ '; color: var(--success); font-weight: 700; }

.topic-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 36px;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
    line-height: 1.8;
}

.apostila-body h2 { color: var(--primary); margin: 24px 0 12px; font-size: 1.25rem; font-weight: 700; }
.apostila-body h3 { color: var(--dark); margin: 16px 0 8px; font-size: 1rem; font-weight: 600; }
.apostila-body ul { margin: 12px 0 12px 24px; }
.apostila-body li { margin-bottom: 6px; }
.apostila-body p { margin-bottom: 12px; color: var(--text); }

/* ─── Footer ─── */
.footer {
    background: var(--dark);
    color: rgba(255,255,255,0.65);
    padding: 0 0 28px;
    margin-top: auto;
    position: relative;
}

.footer-top-accent {
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding: 56px 0 40px;
}

.footer-logo { margin-bottom: 16px; }
.footer-logo .logo-text strong { color: white; }
.footer-logo .logo-text small { color: rgba(255,255,255,0.45); }

.footer-tagline {
    font-size: 0.9rem;
    line-height: 1.65;
    margin-bottom: 16px;
    max-width: 300px;
}

.footer-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.4);
}

.footer h4 {
    color: white;
    margin-bottom: 16px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.footer-links { display: flex; flex-direction: column; gap: 10px; }

.footer-links a,
.footer-contact a {
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
}

.footer-links a:hover,
.footer-contact a:hover { color: var(--accent); }

.footer-contact p { font-size: 0.875rem; margin-bottom: 6px; }
.footer-hours { font-size: 0.78rem !important; color: rgba(255,255,255,0.35) !important; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 24px;
    text-align: center;
}

.footer-bottom p { font-size: 0.8rem; }
.footer-legal { font-size: 0.75rem !important; color: rgba(255,255,255,0.35) !important; margin-top: 4px; }

/* ─── Animations ─── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Layout utilities ─── */
.admin-layout {
    display: flex;
    min-height: calc(100vh - var(--nav-height));
    position: relative;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.table-responsive table {
    min-width: 560px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.back-link:hover { text-decoration: underline; }

.container-page {
    padding-bottom: 48px;
}

.dashboard-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 768px) {
    .btn-row .btn { flex: 1 1 auto; min-width: calc(50% - 6px); }
    .btn-row .btn-block { min-width: 100%; }
}

/* Admin mobile */
.admin-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--nav-height);
    background: rgba(15, 23, 42, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.admin-overlay.active {
    display: block;
    opacity: 1;
}

.admin-nav-toggle {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--dark);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.admin-sidebar-head {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: white;
    font-weight: 700;
}

.admin-sidebar-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

.admin-sidebar-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 12px 20px;
}

.admin-sidebar-nav {
    display: flex;
    flex-direction: column;
}

/* Prevent horizontal scroll */
html { overflow-x: hidden; }
img, svg { max-width: 100%; height: auto; }

/* Touch targets */
@media (pointer: coarse) {
    .btn, .nav-links > a, .quiz-option, .suggestion-btn {
        min-height: 44px;
    }
}

/* Safe areas (notched phones) */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(24px, env(safe-area-inset-left));
        padding-right: max(24px, env(safe-area-inset-right));
    }
    .footer-bottom {
        padding-bottom: max(28px, env(safe-area-inset-bottom));
    }
}

/* ─── Tablet (≤1024px) ─── */
@media (max-width: 1024px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-inner { grid-template-columns: 1fr; gap: 40px; }
    .hero-visual { display: none; }
    .modules-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .admin-content { padding: 24px 20px; }
}

/* ─── Mobile (≤768px) ─── */
@media (max-width: 768px) {
    :root { --nav-height: 68px; }

    .container { padding: 0 16px; }

    /* Navbar */
    .nav-container { height: var(--nav-height); }
    .nav-toggle { display: flex; }
    .admin-nav-toggle { display: inline-flex; }

    .logo-text strong { font-size: 0.82rem; }
    .logo-text small { font-size: 0.62rem; }
    .logo-mark { width: 36px; height: 36px; }

    .nav-links {
        display: none;
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--white);
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        padding-bottom: max(24px, env(safe-area-inset-bottom));
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--border);
        gap: 4px;
        overflow-y: auto;
        z-index: 999;
    }

    .nav-links.active { display: flex; }

    .nav-links > a:not(.btn) {
        padding: 14px 16px;
        font-size: 0.95rem;
    }

    .nav-links .btn {
        width: 100%;
        justify-content: center;
        margin-top: 4px;
    }

    .nav-user {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid var(--border);
        padding-top: 16px;
        margin-top: 12px;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .nav-user .user-name { max-width: none; }

    body.nav-open { overflow: hidden; }

    /* Hero */
    .hero { padding: 40px 0 56px; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; justify-content: center; }
    .hero-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 20px;
    }
    .hero-stat { flex: 1; min-width: 80px; }

    /* Sections */
    .section { padding: 56px 0; }
    .section-header { margin-bottom: 40px; }
    .features-grid { grid-template-columns: 1fr; }
    .steps-grid { grid-template-columns: 1fr; gap: 28px; }
    .pricing-grid { grid-template-columns: 1fr; max-width: 100%; }
    .modules-grid { grid-template-columns: 1fr; }
    .trust-bar { padding: 16px 0; }
    .trust-bar-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .cta-section { padding: 56px 0; }

    /* Auth */
    .auth-layout { grid-template-columns: 1fr; min-height: auto; }
    .auth-brand { display: none; }
    .auth-panel { padding: 32px 16px; }
    .auth-card { padding: 28px 22px; }

    /* Dashboard */
    .dashboard-header { padding: 32px 0; margin-bottom: 24px; }
    .dashboard-header h1 { font-size: 1.4rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 16px; flex-direction: column; text-align: center; gap: 10px; }
    .stat-card .stat-info strong { font-size: 1.25rem; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .page-header .btn { width: 100%; }
    .grid-2 { grid-template-columns: 1fr; gap: 20px; }

    /* Quiz */
    .quiz-container, .ai-container { padding: 20px 16px; }
    .quiz-question { padding: 20px 16px; }
    .quiz-question h3 { font-size: 1rem; }
    .quiz-option {
        padding: 12px 14px;
        align-items: flex-start;
    }
    .quiz-option span:not(.option-letter) { font-size: 0.9rem; line-height: 1.45; }

    /* AI Chat */
    .ai-chat { height: min(70vh, 520px); border-radius: var(--radius); }
    .ai-message { max-width: 92%; font-size: 0.875rem; }
    .ai-input-area {
        flex-wrap: wrap;
        padding: 12px;
    }
    .ai-input-area input { min-width: 0; width: 100%; flex: 1 1 100%; }
    .ai-input-area .btn { flex: 1; }
    .suggestion-btn {
        width: 100%;
        text-align: left;
        border-radius: var(--radius-sm);
        white-space: normal;
    }

    /* Tables */
    .ranking-table th,
    .ranking-table td,
    .data-table th,
    .data-table td {
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    .ranking-table .hide-mobile,
    .data-table .hide-mobile { display: none; }

    /* Topics */
    .topic-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .topic-item .btn { width: 100%; }
    .topic-content { padding: 24px 18px; }

    /* Certificate */
    .certificate { padding: 32px 20px; }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 40px 0 32px;
    }

    /* Admin sidebar off-canvas */
    .admin-sidebar {
        position: fixed;
        left: 0;
        top: var(--nav-height);
        bottom: 0;
        width: min(300px, 88vw);
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        padding: 0;
    }

    .admin-sidebar.open { transform: translateX(0); }

    .admin-sidebar-head { display: flex; }

    .admin-sidebar a { margin: 2px 10px; }

    .admin-content {
        margin-left: 0;
        padding: 20px 16px;
        width: 100%;
    }

    .gpt-badge {
        width: 100%;
        justify-content: center;
        font-size: 0.72rem;
    }
}

/* ─── Small phones (≤480px) ─── */
@media (max-width: 480px) {
    .hero h1 { font-size: 1.75rem; }
    .hero-desc { font-size: 0.95rem; }
    .hero-stat strong { font-size: 1.4rem; }
    .pricing-price { font-size: 2.25rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .module-card { padding: 22px 18px; }
    .feature-card { padding: 22px 18px; }
    .logo-text small { display: none; }
    .dashboard-header-row { flex-direction: column; align-items: flex-start; }
}

/* ─── Landscape phones ─── */
@media (max-height: 500px) and (orientation: landscape) {
    .hero { padding: 32px 0; }
    .ai-chat { height: 55vh; }
    .nav-links { padding-bottom: 16px; }
}

@media print {
    .navbar, .footer, .btn, .admin-sidebar, .admin-nav-toggle { display: none !important; }
    .admin-content { margin-left: 0 !important; padding: 0 !important; }
    .certificate { border: 2px solid #000; box-shadow: none; }
}
