/* ============================================================
   EduPortal — Website Stylesheet
   Design System: Token-driven, content-first, WCAG 2.2 AA
   Font: Inter | Primary: #7367F0 | Accent: #00c3d1
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── Reset ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background: #fff;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: inherit; transition: color 200ms ease; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ─── Container ─── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font);
    border: none;
    cursor: pointer;
    transition: all 200ms ease;
    line-height: 1.5;
    white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(115, 103, 240, 0.3);
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(115, 103, 240, 0.35);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 195, 209, 0.25);
}
.btn-accent:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 195, 209, 0.3);
}

.btn-outline {
    background: transparent;
    color: rgba(255,255,255,0.9);
    border: 1.5px solid rgba(255,255,255,0.3);
}
.btn-outline:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.6); }

.btn-ghost {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--primary-light); border-color: var(--primary); }

/* ─── TOPBAR ─── */
.topbar {
    background: #f8f9fa;
    border-bottom: 1px solid #eef0f2;
    padding: 6px 24px;
    font-size: 12px;
    color: #6b7280;
}
.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.topbar-left a, .topbar-left span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #6b7280;
    font-weight: 500;
    transition: color 200ms;
}
.topbar-left a:hover { color: var(--primary); }
.topbar-divider { color: #d1d5db; font-size: 14px; }
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.topbar-socials {
    display: flex;
    align-items: center;
    gap: 4px;
}
.topbar-socials a {
    width: 26px; height: 26px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 14px;
    transition: all 200ms;
}
.topbar-socials a:hover { background: var(--primary); color: #fff; }
.topbar .lang-switch {
    display: flex; align-items: center; gap: 2px;
    background: #e5e7eb; border-radius: 6px; padding: 2px;
}
.topbar .lang-switch a {
    padding: 2px 8px; border-radius: 4px; font-size: 11px;
    font-weight: 600; color: #6b7280; transition: all 200ms;
}
.topbar .lang-switch a.active { background: var(--primary); color: #fff; }

/* ─── NAVBAR ─── */
.navbar {
    position: sticky;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 0 24px;
    background: #fff;
    border-bottom: 1px solid #eef0f2;
    box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.02em;
}

.navbar-brand .brand-icon {
    width: 34px; height: 34px;
    background: var(--primary);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
    box-shadow: 0 2px 6px rgba(115, 103, 240, 0.3);
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 28px;
}
.navbar-links a {
    font-size: 13.6px;
    font-weight: 500;
    color: var(--text);
    transition: color 200ms;
    position: relative;
}
.navbar-links a::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 50%; transform: translateX(-50%);
    width: 0; height: 2px;
    background: var(--primary);
    border-radius: 1px;
    transition: width 250ms ease;
}
.navbar-links a:hover::after { width: 100%; }
.navbar-links a:hover { color: var(--primary); }

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--bg);
    border-radius: 8px;
    padding: 3px;
    font-size: 12px;
    font-weight: 600;
}
.lang-switch a {
    padding: 4px 10px;
    border-radius: 6px;
    color: var(--text-muted);
    transition: all 200ms;
}
.lang-switch a.active { background: var(--primary); color: #fff; }

.mobile-lang-switch { display: none; }

.btn-nav {
    padding: 7px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all 200ms;
    font-family: var(--font);
}
.btn-nav-outline {
    border: 1.5px solid var(--border);
    color: var(--text);
    background: transparent;
}
.btn-nav-outline:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.btn-nav-filled {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(115, 103, 240, 0.3);
}
.btn-nav-filled:hover { background: var(--primary-hover); transform: translateY(-1px); }

/* Mobile */
.mobile-toggle {
    display: none;
    background: none; border: none; cursor: pointer;
    width: 32px; height: 32px;
    flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.mobile-toggle span {
    display: block; width: 20px; height: 2px;
    background: var(--text); border-radius: 1px; transition: all 250ms;
}

/* ─── HERO ─── */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #2b2c40 0%, #1a1b2e 40%, #2b2c40 100%);
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(115, 103, 240, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 195, 209, 0.1) 0%, transparent 50%);
}

.hero-content { position: relative; z-index: 2; max-width: 640px; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(115, 103, 240, 0.12);
    border: 1px solid rgba(115, 103, 240, 0.2);
    border-radius: 50px;
    padding: 6px 18px;
    font-size: 12.8px;
    font-weight: 500;
    color: #a78bfa;
    margin-bottom: 24px;
    animation: fadeInUp 0.5s ease;
}

.hero h1 {
    font-size: clamp(32px, 4.5vw, 48px);
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    animation: fadeInUp 0.5s ease 0.08s both;
}

.hero p {
    font-size: 16px;
    color: rgba(255,255,255,0.6);
    line-height: 1.7;
    margin-bottom: 32px;
    animation: fadeInUp 0.5s ease 0.16s both;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    animation: fadeInUp 0.5s ease 0.24s both;
}

.hero-decor {
    position: absolute;
    right: -3%; top: 50%;
    transform: translateY(-50%);
    width: 440px; height: 440px;
    z-index: 1;
}
.hero-decor .circle {
    position: absolute; border-radius: 50%;
    border: 1px solid rgba(115, 103, 240, 0.1);
    animation: pulse 5s ease-in-out infinite;
}
.hero-decor .circle:nth-child(1) { width: 100%; height: 100%; }
.hero-decor .circle:nth-child(2) { width: 72%; height: 72%; top: 14%; left: 14%; animation-delay: 0.6s; }
.hero-decor .circle:nth-child(3) { width: 44%; height: 44%; top: 28%; left: 28%; animation-delay: 1.2s; }
.hero-decor .geo-star {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 60px; opacity: 0.08; color: var(--primary);
}

/* ─── STATS BAR ─── */
.stats-bar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 28px 0;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
}
.stat-item h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.01em;
}
.stat-item p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ─── SECTIONS ─── */
.section { padding: 80px 0; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.01em;
    margin-bottom: 10px;
}
.section-header p {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.6;
}
.section-header .accent-line {
    width: 48px; height: 3px;
    background: var(--primary);
    border-radius: 2px;
    margin: 14px auto 0;
}

/* ─── FEATURES GRID ─── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.feature-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px 20px;
    text-align: center;
    transition: all 250ms ease;
    position: relative;
}
.feature-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 8px 8px 0 0;
    transform: scaleX(0);
    transition: transform 250ms ease;
}
.feature-card:hover::before { transform: scaleX(1); }
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    border-color: transparent;
}
.feature-icon {
    width: 48px; height: 48px;
    background: var(--primary-light);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    margin: 0 auto 16px;
}
.feature-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
}
.feature-card p {
    font-size: 13.6px;
    color: var(--text-muted);
    line-height: 1.55;
}

/* ─── COURSES GRID ─── */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.course-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 250ms ease;
}
.course-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.course-color-bar { height: 4px; width: 100%; }
.course-card-body { padding: 24px 20px; }
.course-icon-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 14px;
}
.course-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
    line-height: 1.35;
}
.course-card p {
    font-size: 13.6px;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 14px;
}
.course-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.course-meta span { display: flex; align-items: center; gap: 4px; }

/* ─── CTA SECTION ─── */
.cta-section {
    background: linear-gradient(135deg, #2b2c40 0%, #1a1b2e 100%);
    padding: 72px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta-section::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 30% 50%, rgba(115, 103, 240, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 70% 50%, rgba(0, 195, 209, 0.08) 0%, transparent 50%);
}
.cta-section * { position: relative; z-index: 1; }
.cta-section h2 { font-size: 28px; font-weight: 700; color: #fff; margin-bottom: 10px; }
.cta-section p { font-size: 16px; color: rgba(255,255,255,0.55); margin-bottom: 28px; }

/* ─── FOOTER ─── */
.footer {
    background: #1a1b2e;
    color: rgba(255,255,255,0.55);
    padding: 56px 0 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-brand h3 {
    font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 10px;
}
.footer-brand p { font-size: 13.6px; line-height: 1.6; max-width: 280px; }
.footer-col h4 {
    font-size: 12.8px; font-weight: 600; color: rgba(255,255,255,0.8);
    margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.06em;
}
.footer-col a {
    display: block; font-size: 13.6px; padding: 4px 0;
    color: rgba(255,255,255,0.45); transition: color 200ms;
}
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
    padding: 20px 0; text-align: center;
    font-size: 12.8px; color: rgba(255,255,255,0.3);
}

/* ─── FLASH MESSAGES ─── */
.flash {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-radius: 8px;
    margin-bottom: 16px; font-size: 13.6px; font-weight: 500;
    animation: slideDown 250ms ease;
}
.flash-success { background: #E8F8EF; color: #1B7A41; border: 1px solid #B7E9C8; }
.flash-error { background: #FEF1F1; color: #C62828; border: 1px solid #F5C6C6; }
.flash-warning { background: #FFF8E6; color: #8D6C00; border: 1px solid #FAEAB8; }
.flash-icon { font-size: 16px; }
.flash-close { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 16px; opacity: 0.5; color: inherit; }

/* ─── ANIMATIONS ─── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 0.8; }
}

.reveal {
    opacity: 0; transform: translateY(24px);
    transition: opacity 500ms ease, transform 500ms ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .courses-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .topbar { display: none; }
    .mobile-lang-switch {
        display: flex; gap: 8px; padding-top: 16px; border-top: 1px solid var(--border); margin-top: 16px; width: 100%;
    }
    .mobile-lang-switch a {
        padding: 8px 12px; background: var(--bg); border-radius: 6px; font-size: 14px; font-weight: 600; color: var(--text-muted); text-align: center; flex: 1; border: 1px solid var(--border);
    }
    .mobile-lang-switch a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
    
    .navbar-links, .navbar-actions .btn-nav-outline { display: none; }
    .mobile-toggle { display: flex; }
    .navbar-links.open {
        display: flex; flex-direction: column;
        position: absolute; top: 64px; left: 0; right: 0;
        background: #fff; padding: 20px 24px; gap: 14px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.08);
        border-radius: 0 0 8px 8px;
    }
    .navbar-links.open a { color: var(--text); font-size: 15px; }
    .hero { min-height: auto; padding: 110px 0 72px; }
    .hero h1 { font-size: 28px; }
    .hero p { font-size: 15px; }
    .hero-decor { display: none; }
    .section { padding: 56px 0; }
    .section-header h2 { font-size: 24px; }
    .features-grid, .courses-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .stat-item h3 { font-size: 22px; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .hero-buttons { flex-direction: column; }
    .hero-buttons .btn { width: 100%; }
}
