/* =========================================================
   OXFORD SCHOOL — Modern Frontend (v3)
   ========================================================= */

:root {
    --red: #e11d48;
    --red-dark: #be123c;
    --accent: #7c3aed;
    --accent-2: #2563eb;
    --accent-3: #ec4899;
    --grad: linear-gradient(120deg, #e11d48 0%, #7c3aed 50%, #2563eb 100%);
    --grad-soft: linear-gradient(120deg, rgba(225,29,72,0.12), rgba(124,58,237,0.12), rgba(37,99,235,0.12));

    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --soft: #f6f8fc;
    --white: #ffffff;
    --dark: #0b1120;
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 30px 80px rgba(15, 23, 42, 0.18);
    --radius: 20px;

    --bg: #ffffff;
    --bg-soft: #f6f8fc;
    --card-bg: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --header-bg: rgba(255, 255, 255, 0.72);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ---------- Dark theme ---------- */
body.site-theme-black {
    --bg: #0b1120;
    --bg-soft: #0f172a;
    --card-bg: #131c31;
    --text: #eef2f9;
    --text-muted: #9aa7bd;
    --border: rgba(255, 255, 255, 0.10);
    --header-bg: rgba(11, 17, 32, 0.72);
    --soft: #0f172a;
    --line: rgba(255,255,255,0.10);
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
    margin-top: 0;
    font-family: 'Sora', 'Plus Jakarta Sans', sans-serif;
    color: var(--text);
    letter-spacing: -0.02em;
}

p { margin-top: 0; color: var(--text); line-height: 1.6; }

img { max-width: 100%; }

/* ---------- Page progress bar ---------- */
.page-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    z-index: 60;
    background: var(--grad);
    background-size: 200% 100%;
    animation: gradShift 6s linear infinite;
    transition: width 0.1s linear;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    min-height: 78px;
    padding: 12px 5vw;
    background: var(--header-bg);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, min-height 0.3s ease;
}

.site-header.is-scrolled {
    border-bottom-color: var(--border);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    min-height: 66px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: 'Sora', sans-serif;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    border-radius: 13px;
    color: #fff;
    font-weight: 800;
    font-size: 22px;
    background: var(--grad);
    background-size: 200% 200%;
    animation: gradShift 6s ease infinite;
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.35);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
}
.brand-text span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 4px;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.main-nav a {
    position: relative;
    padding: 9px 16px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
    transition: color 0.2s ease, background 0.2s ease;
}
.main-nav a::after {
    content: "";
    position: absolute;
    left: 50%; bottom: 4px;
    width: 0; height: 2px;
    border-radius: 2px;
    background: var(--grad);
    transform: translateX(-50%);
    transition: width 0.25s ease;
}
.main-nav a:hover { color: var(--red); }
.main-nav a:hover::after { width: 40%; }

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.phone-stack { display: flex; flex-direction: column; line-height: 1.25; }
.phone-link {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--text);
    transition: color 0.2s ease;
}
.phone-link:hover { color: var(--red); }

/* nav CTA (Kirish) */
.nav-cta {
    color: #fff !important;
    background: var(--grad);
    background-size: 200% 200%;
    animation: gradShift 6s ease infinite;
    box-shadow: 0 10px 22px rgba(124, 58, 237, 0.30);
}
.nav-cta::after { display: none; }
.nav-cta:hover { color: #fff !important; transform: translateY(-2px); }

/* Call icon + dropdown */
.phone-dropdown { position: relative; display: inline-flex; }
.social-link-call {
    width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    background: var(--grad) !important;
    background-size: 200% 200% !important;
    animation: gradShift 6s ease infinite;
    border: none;
    cursor: pointer;
}
.phone-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 240px;
    padding: 14px;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: 60;
}
.phone-dropdown.is-open .phone-menu {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}
.phone-menu::before {
    content: "";
    position: absolute;
    top: -7px; right: 16px;
    width: 14px; height: 14px;
    background: var(--card-bg);
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
    transform: rotate(45deg);
}
.phone-menu-title {
    display: block;
    margin-bottom: 8px;
    padding: 0 8px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.phone-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 12px;
    color: var(--text);
    font-weight: 700;
    font-size: 15px;
    transition: background 0.2s ease, color 0.2s ease;
}
.phone-menu a svg { width: 18px; height: 18px; fill: var(--red); flex: 0 0 auto; }
.phone-menu a:hover { background: var(--grad-soft); color: var(--red); }

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    border-radius: 50%;
    color: #fff !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.social-link svg { width: 21px; height: 21px; display: block; fill: #fff !important; }
.social-link:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 12px 26px rgba(15,23,42,0.22); }
.social-link-telegram { background: #2aa7df !important; }
.social-link-instagram { background: linear-gradient(135deg, #515bd4, #8134af 30%, #dd2a7b 60%, #f58529) !important; }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 46px; height: 46px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 20px; height: 2px;
    margin: 0 auto;
    border-radius: 2px;
    background: var(--text);
    transition: transform 0.3s ease, opacity 0.2s ease;
}
.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Layout helpers ---------- */
.section-inner { width: min(92vw, 1280px); margin: 0 auto; }

.section { padding: 96px 0; position: relative; }
.section-soft { background: var(--bg-soft); }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--grad-soft);
    color: var(--red);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.grad-text {
    background: var(--grad);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradShift 6s ease infinite;
}

.section-heading { margin-bottom: 48px; }
.section-heading.center { text-align: center; max-width: 720px; margin-left: auto; margin-right: auto; }
.section-heading.center .eyebrow { margin-left: auto; margin-right: auto; }
.section-heading h2 { font-size: clamp(32px, 4vw, 48px); margin-bottom: 16px; font-weight: 800; }
.section-heading p { color: var(--text-muted); font-size: 18px; margin: 0; }

h2 { font-size: clamp(30px, 4vw, 46px); font-weight: 800; }
h3 { font-size: 22px; font-weight: 700; margin-bottom: 10px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    padding: 0 28px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.btn:hover { transform: translateY(-3px); }
.btn-primary {
    color: #fff;
    background: var(--grad);
    background-size: 200% 200%;
    box-shadow: 0 16px 34px rgba(124, 58, 237, 0.34);
    animation: gradShift 6s ease infinite;
}
.btn-primary:hover { box-shadow: 0 22px 44px rgba(124, 58, 237, 0.45); }
.btn-ghost {
    color: var(--text);
    background: transparent;
    border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--red); color: var(--red); }
.btn-light { color: var(--ink); background: #fff; box-shadow: 0 16px 34px rgba(0,0,0,0.18); }
.btn-ghost-light { color: #fff; border-color: rgba(255,255,255,0.5); }
.btn-ghost-light:hover { background: rgba(255,255,255,0.12); }

/* ---------- Reveal animations ---------- */
[data-reveal] {
    opacity: 0;
    transform: translateY(34px);
    transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1);
    transition-delay: var(--d, 0ms);
}
[data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1; transform: none; transition: none; }
    .blob, .brand-mark, .btn-primary, .grad-text, .page-progress { animation: none !important; }
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 92vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    overflow: hidden;
    background: var(--bg);
}

.hero-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.55;
    will-change: transform;
}
.blob-1 { width: 560px; height: 560px; top: -160px; left: -120px;
    background: radial-gradient(circle at 30% 30%, #e11d48, transparent 70%);
    animation: float1 16s ease-in-out infinite; }
.blob-2 { width: 620px; height: 620px; top: 40px; right: -180px;
    background: radial-gradient(circle at 70% 30%, #7c3aed, transparent 70%);
    animation: float2 20s ease-in-out infinite; }
.blob-3 { width: 480px; height: 480px; bottom: -180px; left: 30%;
    background: radial-gradient(circle at 50% 50%, #2563eb, transparent 70%);
    animation: float3 18s ease-in-out infinite; }

.hero-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(to right, rgba(100,116,139,0.10) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(100,116,139,0.10) 1px, transparent 1px);
    background-size: 54px 54px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}

.hero-content { position: relative; z-index: 1; }

.hero-eyebrow { background: var(--card-bg); box-shadow: var(--shadow); }
.ping {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 0 0 rgba(225,29,72,0.6);
    animation: ping 1.8s ease-out infinite;
}

.hero h1 {
    max-width: 16ch;
    margin: 0 0 22px;
    font-size: clamp(42px, 7vw, 88px);
    line-height: 1.04;
    font-weight: 800;
}

.hero-text {
    max-width: 56ch;
    margin: 0 0 34px;
    font-size: clamp(18px, 2vw, 23px);
    color: var(--text-muted);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 60px;
    max-width: 760px;
}
.hero-stat {
    padding: 22px 20px;
    border-radius: 18px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hero-stat:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.hero-stat strong {
    display: block;
    font-family: 'Sora', sans-serif;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    background: var(--grad);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-stat span { color: var(--text-muted); font-weight: 600; font-size: 14px; }

.hero-scroll {
    position: absolute;
    left: 50%; bottom: 26px;
    transform: translateX(-50%);
    width: 26px; height: 44px;
    border: 2px solid var(--text-muted);
    border-radius: 14px;
    opacity: 0.5;
    z-index: 1;
}
.hero-scroll span {
    position: absolute; left: 50%; top: 8px;
    width: 4px; height: 8px;
    margin-left: -2px;
    border-radius: 2px;
    background: var(--text-muted);
    animation: scrollDot 1.8s ease-in-out infinite;
}

/* ---------- Feature cards ---------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}
.feature-card {
    position: relative;
    padding: 34px 28px;
    border-radius: var(--radius);
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.feature-card::before {
    content: "";
    position: absolute; inset: 0;
    background: var(--grad-soft);
    opacity: 0;
    transition: opacity 0.35s ease;
}
.feature-card > * { position: relative; }
.feature-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-lg); }
.feature-card:hover::before { opacity: 1; }
.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px; height: 64px;
    margin-bottom: 20px;
    border-radius: 18px;
    font-size: 30px;
    background: var(--grad-soft);
    transition: transform 0.35s ease;
}
.feature-card:hover .feature-icon { transform: scale(1.1) rotate(-6deg); }
.feature-card h3 { font-size: 20px; }
.feature-card p { color: var(--text-muted); margin: 0; }

/* ---------- Split layout ---------- */
.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.8fr);
    gap: 56px;
    align-items: center;
}

.contact-card {
    padding: 34px;
    border-radius: var(--radius);
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.contact-card h3 { color: var(--text); }
.contact-card p { color: var(--text-muted); margin-bottom: 14px; }
.inline-link {
    display: inline-block;
    margin-right: 14px;
    font-weight: 700;
    color: var(--red);
}
.inline-link:hover { text-decoration: underline; }

/* ---------- Cards (teachers / achievements) ---------- */
.teacher-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}
.teacher-grid .founder-card { grid-column: 1 / -1; width: min(100%, 520px); justify-self: center; }
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}

.info-card {
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.info-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }

.card-visual {
    position: relative;
    min-height: 230px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--grad-soft);
    overflow: hidden;
}
.card-emoji { font-size: 56px; }
.card-photo-wrap { padding: 0; min-height: 250px; background: var(--bg-soft); }
.info-card .card-photo-wrap img,
.info-card .card-photo-wrap video {
    width: 100%;
    height: 340px;
    object-fit: cover;
    object-position: center 22%;
    background: var(--bg-soft);
    transition: transform 0.5s ease;
}
.info-card:hover .card-photo-wrap img { transform: scale(1.06); }

.card-body { padding: 24px; }
.card-kicker {
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--grad-soft);
    color: var(--red);
    font-size: 13px;
    font-weight: 800;
}
.card-body h3 { font-size: 21px; margin-bottom: 8px; }
.card-body p { color: var(--text-muted); margin: 0; }

/* ---------- School view gallery ---------- */
.school-view-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}
.school-view-item {
    overflow: hidden;
    margin: 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.school-view-item img {
    width: 100%; height: 280px;
    display: block;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.school-view-item:hover img { transform: scale(1.08); }

/* ---------- Page hero (about / achievements) ---------- */
.page-hero {
    position: relative;
    padding: 150px 0 90px;
    overflow: hidden;
    background: var(--bg);
}
.about-hero .split-layout { position: relative; z-index: 1; align-items: center; }
.page-hero h1 { font-size: clamp(40px, 6vw, 76px); font-weight: 800; line-height: 1.05; }

.achievements-hero { min-height: 60vh; display: flex; align-items: center; background: var(--dark); }
.achievements-hero .section-inner { position: relative; z-index: 2; text-align: center; max-width: 760px; }
.achievements-hero h1, .achievements-hero .hero-text { color: #fff; }
.achievements-hero .hero-text { color: rgba(255,255,255,0.82); margin-left: auto; margin-right: auto; }
.achievements-hero .eyebrow { background: rgba(255,255,255,0.12); color: #fff; margin-left: auto; margin-right: auto; }
.achievements-hero-bg {
    position: absolute; inset: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}
.achievements-hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.achievements-hero::after {
    content: ""; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(120deg, rgba(11,17,32,0.92), rgba(124,58,237,0.55), rgba(37,99,235,0.6));
}

/* ---------- CTA ---------- */
.cta-section { padding-bottom: 110px; }
.cta-box {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 56px;
    border-radius: 30px;
    overflow: hidden;
    color: #fff;
    background: var(--grad);
    background-size: 200% 200%;
    animation: gradShift 8s ease infinite;
    box-shadow: 0 30px 70px rgba(124, 58, 237, 0.4);
}
.blob-cta {
    position: absolute;
    width: 360px; height: 360px;
    top: -120px; right: -60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    filter: blur(40px);
}
.cta-content { position: relative; max-width: 620px; }
.cta-content h2 { color: #fff; margin-bottom: 12px; }
.cta-content p { color: rgba(255,255,255,0.9); margin: 0; font-size: 18px; }
.cta-actions { position: relative; display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--dark);
    color: #cbd5e1;
    padding: 56px 5vw 28px;
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 36px;
    width: min(92vw, 1280px);
    margin: 0 auto 36px;
    padding-bottom: 36px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand { display: flex; align-items: center; gap: 14px; max-width: 360px; }
.footer-brand strong { color: #fff; font-size: 18px; font-family: 'Sora', sans-serif; }
.footer-brand p { color: #94a3b8; margin: 4px 0 0; font-size: 14px; }
.footer-links, .footer-socials { display: flex; flex-direction: column; gap: 12px; }
.footer-links a, .footer-socials a { color: #cbd5e1; font-weight: 600; transition: color 0.2s ease; }
.footer-links a:hover, .footer-socials a:hover { color: #fff; }
.footer-bottom {
    width: min(92vw, 1280px);
    margin: 0 auto;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

/* ---------- Keyframes ---------- */
@keyframes gradShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes float1 {
    0%,100% { transform: translate(0,0) scale(1); }
    50% { transform: translate(40px, 50px) scale(1.12); }
}
@keyframes float2 {
    0%,100% { transform: translate(0,0) scale(1); }
    50% { transform: translate(-50px, 40px) scale(1.08); }
}
@keyframes float3 {
    0%,100% { transform: translate(0,0) scale(1); }
    50% { transform: translate(30px, -40px) scale(1.15); }
}
@keyframes ping {
    0% { box-shadow: 0 0 0 0 rgba(225,29,72,0.5); }
    70% { box-shadow: 0 0 0 10px rgba(225,29,72,0); }
    100% { box-shadow: 0 0 0 0 rgba(225,29,72,0); }
}
@keyframes scrollDot {
    0% { top: 8px; opacity: 1; }
    100% { top: 26px; opacity: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .teacher-grid, .achievement-grid, .school-view-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
    .site-header { grid-template-columns: auto 1fr; }
    .main-nav {
        position: fixed;
        inset: 78px 0 auto 0;
        flex-direction: column;
        gap: 4px;
        padding: 16px 5vw 24px;
        background: var(--header-bg);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-bottom: 1px solid var(--border);
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease, transform 0.25s ease;
    }
    .main-nav.is-open { opacity: 1; transform: none; pointer-events: auto; }
    .main-nav a { width: 100%; padding: 14px 16px; font-size: 17px; }
    .nav-toggle { display: flex; }
    .phone-stack { display: none; }
    .header-actions { gap: 8px; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
    .split-layout { grid-template-columns: 1fr; gap: 32px; }
    .cta-box { padding: 40px 28px; }
    .section { padding: 72px 0; }
}

@media (max-width: 560px) {
    .feature-grid, .teacher-grid, .achievement-grid, .school-view-grid { grid-template-columns: 1fr; }
    .hero { min-height: auto; padding: 110px 0 70px; }
    .social-link { width: 40px; height: 40px; }
}

/* =========================================================
   AUTH (login) — WOW
   ========================================================= */
.auth {
    position: relative;
    min-height: calc(100vh - 78px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 5vw;
    overflow: hidden;
    background: var(--bg);
}
.auth-bg { position: absolute; inset: 0; z-index: 0; }
.auth-card {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: min(100%, 980px);
    border-radius: 28px;
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.auth-side {
    position: relative;
    padding: 48px 44px;
    overflow: hidden;
    color: #fff;
    background: var(--grad);
    background-size: 200% 200%;
    animation: gradShift 8s ease infinite;
}
.auth-side-content { position: relative; z-index: 1; }
.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px; height: 56px;
    margin-bottom: 26px;
    border-radius: 16px;
    background: rgba(255,255,255,0.18);
    font-family: 'Sora', sans-serif;
    font-size: 28px;
    font-weight: 800;
}
.auth-side h2 { color: #fff; font-size: 30px; line-height: 1.2; margin-bottom: 16px; }
.auth-side p { color: rgba(255,255,255,0.9); margin-bottom: 26px; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.auth-points li {
    position: relative;
    padding-left: 30px;
    color: #fff;
    font-weight: 600;
}
.auth-points li::before {
    content: "✓";
    position: absolute; left: 0; top: -1px;
    width: 20px; height: 20px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.22);
    font-size: 12px;
}

.auth-form-wrap { padding: 48px 44px; }
.auth-title { font-size: 36px; font-weight: 800; margin-bottom: 10px; }
.auth-sub { color: var(--text-muted); margin-bottom: 26px; }

.auth-form { display: grid; gap: 18px; width: 100%; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.auth-field { display: grid; gap: 8px; }
.auth-field > span { font-weight: 700; font-size: 14px; color: var(--text); }
.auth-input {
    position: relative;
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    background: var(--bg-soft);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.auth-input:focus-within {
    border-color: var(--accent);
    background: var(--card-bg);
    box-shadow: 0 0 0 4px rgba(124,58,237,0.14);
}
.auth-input > svg {
    width: 20px; height: 20px;
    margin-left: 16px;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.auth-input input {
    flex: 1;
    width: 100%;
    min-height: 54px;
    padding: 0 14px;
    border: 0 !important;
    background: transparent !important;
    color: var(--text);
    font: inherit;
    box-shadow: none !important;
}
.auth-input input:focus { outline: none; }
.auth-eye {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    min-height: auto;
    margin-right: 4px;
    padding: 0;
    border: 0;
    background: transparent !important;
    color: var(--text-muted);
    cursor: pointer;
}
.auth-eye svg { width: 20px; height: 20px; fill: none; stroke: var(--text-muted); stroke-width: 2; }
.auth-eye.is-on svg { stroke: var(--accent); }
.auth-submit { width: 100%; margin-top: 6px; }
.auth-back {
    display: inline-block;
    margin-top: 22px;
    color: var(--text-muted);
    font-weight: 700;
    transition: color 0.2s ease;
}
.auth-back:hover { color: var(--red); }

@media (max-width: 760px) {
    .auth-card { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .auth-form-wrap { padding: 38px 28px; }
}

/* =========================================================
   DASHBOARD / CABINET — Modern admin panel
   ========================================================= */

.dash, .admin-page, .crm-dashboard {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: start;
    min-height: calc(100vh - 78px);
    background: var(--bg-soft);
}

/* ---------- Sidebar ---------- */
.crm-sidebar {
    position: sticky;
    top: 78px;
    align-self: start;
    min-height: calc(100vh - 78px);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 26px 18px;
    background: var(--card-bg);
    border-right: 1px solid var(--border);
}

.crm-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 8px 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    font-family: 'Sora', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}
.crm-brand::before {
    content: "O";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 12px;
    color: #fff;
    font-size: 20px;
    background: var(--grad);
    background-size: 200% 200%;
    animation: gradShift 6s ease infinite;
    box-shadow: 0 8px 20px rgba(124,58,237,0.32);
}

.crm-menu { display: grid; gap: 4px; }

.crm-menu-heading {
    display: block;
    margin: 18px 0 4px;
    padding: 0 14px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.crm-menu-link {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 14.5px;
    font-weight: 700;
    text-transform: none;
    transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.crm-menu-link:hover { color: var(--text); background: var(--grad-soft); transform: translateX(2px); }

.crm-icon { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.crm-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.crm-active {
    color: #fff;
    background: var(--grad);
    background-size: 200% 200%;
    animation: gradShift 6s ease infinite;
    box-shadow: 0 10px 24px rgba(124,58,237,0.30);
}
.crm-active:hover { color: #fff; background: var(--grad); transform: none; }

.crm-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    margin-top: auto;
    border-radius: 12px;
    color: #e11d48;
    background: rgba(225,29,72,0.10);
    font-size: 14.5px;
    font-weight: 800;
    transition: background 0.18s ease;
}
.crm-logout:hover { background: rgba(225,29,72,0.18); }

/* ---------- Dashboard content ---------- */
.dash-main, .crm-content {
    display: block;
    padding: 38px 40px 60px;
    background: var(--bg-soft);
}

.dash-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 32px;
}
.dash-head h1 { font-size: 32px; font-weight: 800; margin: 4px 0 8px; }
.dash-sub { color: var(--text-muted); margin: 0; }

.dash-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 40px;
}
.dash-stat {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px;
    border-radius: 18px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.dash-stat:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.dash-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px; height: 52px;
    border-radius: 14px;
    flex: 0 0 auto;
}
.dash-stat-icon svg { width: 26px; height: 26px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-teal { background: rgba(13,148,136,0.12); }
.icon-teal svg { stroke: #0d9488; }
.icon-amber { background: rgba(245,158,11,0.14); }
.icon-amber svg { stroke: #d97706; }
.icon-violet { background: rgba(124,58,237,0.12); }
.icon-violet svg { stroke: #7c3aed; }
.icon-rose { background: rgba(225,29,72,0.12); }
.icon-rose svg { stroke: #e11d48; }
.dash-stat-meta strong { display: block; font-family: 'Sora', sans-serif; font-size: 30px; font-weight: 800; line-height: 1; color: var(--text); }
.dash-stat-meta span { color: var(--text-muted); font-size: 14px; font-weight: 600; }

.dash-section-title { font-size: 20px; font-weight: 800; margin: 0 0 18px; }
.dash-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.dash-action {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.dash-action:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.dash-action-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px; height: 48px;
    border-radius: 14px;
    font-size: 22px;
    background: var(--grad-soft);
    flex: 0 0 auto;
}
.dash-action strong { display: block; font-size: 16px; color: var(--text); margin-bottom: 2px; }
.dash-action p { margin: 0; color: var(--text-muted); font-size: 13.5px; }

.crm-content { display: flex; flex-direction: column; justify-content: flex-start; }
.crm-content h2 { font-size: 32px; color: var(--text); }
.crm-content p:not(.eyebrow) { max-width: 720px; color: var(--text-muted); }

/* ---------- Admin cards / pages ---------- */
.admin-card {
    width: 100%;
    max-width: 1100px;
    margin: 38px 40px;
    padding: 34px;
    border-radius: 22px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.admin-confirm { max-width: 620px; }

.admin-layout-sidebar { /* sidebar already sticky via .crm-sidebar */ }

.admin-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.admin-card h1 { font-size: 30px; font-weight: 800; margin: 4px 0 8px; color: var(--text); }
.admin-muted { max-width: 640px; margin: 0; color: var(--text-muted); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.admin-back { min-height: 48px; }

.btn-light {
    color: var(--text);
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: none;
}
.btn-light:hover { border-color: var(--red); color: var(--red); }

/* ---------- Modern table ---------- */
.admin-table {
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    background: var(--card-bg);
}
.admin-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(160px, 1fr) minmax(170px, auto);
    gap: 16px;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 15px;
}
.achievement-admin-row { grid-template-columns: minmax(180px, 1fr) minmax(170px, auto); }
.admin-row:last-child { border-bottom: 0; }
.admin-row:not(.admin-row-head):hover { background: var(--grad-soft); }
.admin-row-head {
    background: var(--bg-soft);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.row-actions a {
    padding: 7px 14px;
    border-radius: 10px;
    background: var(--grad-soft);
    color: var(--accent);
    font-size: 13.5px;
    font-weight: 700;
    transition: background 0.18s ease;
}
.row-actions a:hover { background: rgba(124,58,237,0.18); }
.row-actions .danger-link {
    background: rgba(225,29,72,0.10);
    color: #e11d48 !important;
}
.row-actions .danger-link:hover { background: rgba(225,29,72,0.18); }
.admin-empty { padding: 26px 20px; color: var(--text-muted); }

/* ---------- Alerts ---------- */
.alert-error {
    margin: 0 0 20px;
    padding: 14px 16px;
    border: 1px solid rgba(225,29,72,0.3);
    border-radius: 12px;
    color: #be123c;
    background: rgba(225,29,72,0.08);
    font-weight: 700;
}

/* ---------- Admin forms ---------- */
.admin-form { display: grid; gap: 18px; }
.admin-form p, .admin-form label {
    display: grid;
    gap: 8px;
    margin: 0;
    color: var(--text);
    font-size: 14.5px;
    font-weight: 700;
}
.admin-form .helptext, .admin-form ul.helptext {
    margin: 2px 0 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 400;
}
.admin-form .errorlist {
    margin: 0; padding: 10px 14px;
    border: 1px solid rgba(225,29,72,0.3);
    border-radius: 10px;
    color: #be123c;
    background: rgba(225,29,72,0.08);
    list-style: none;
    font-size: 13.5px;
}

.admin-form input,
.admin-form textarea,
.admin-form select,
.media-form-item input,
.media-form-item select,
.media-form-item textarea {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--bg-soft);
    color: var(--text);
    font: inherit;
    font-weight: 500;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.admin-form textarea { min-height: 130px; resize: vertical; }
.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus,
.media-form-item input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--card-bg);
    box-shadow: 0 0 0 4px rgba(124,58,237,0.14);
}
.admin-form input[type="checkbox"] { width: auto; min-height: auto; }
.admin-form input[type="file"] { padding: 10px; background: var(--bg-soft); }

.admin-form button[type="submit"],
.admin-form button:not(.color-choice-btn):not(.danger-button),
.background-actions .btn {
    min-height: 52px;
    padding: 0 26px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background: var(--grad);
    background-size: 200% 200%;
    animation: gradShift 6s ease infinite;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(124,58,237,0.30);
    transition: transform 0.2s ease;
    justify-self: start;
}
.admin-form button[type="submit"]:hover { transform: translateY(-2px); }

/* ---------- Form sections / media ---------- */
.form-section-title {
    margin: 14px 0 4px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}
.form-section-title h2 { margin-bottom: 6px; font-size: 22px; font-weight: 800; }
.form-section-title p { color: var(--text-muted); margin: 0; }

.media-form-grid, .school-view-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.media-form-item {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-soft);
}
.media-form-item p, .media-form-item label { font-weight: 600; font-size: 14px; }
.school-view-admin-preview { width: 100%; height: 180px; display: block; margin-top: 12px; border-radius: 12px; object-fit: cover; }
.delete-check { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; color: #e11d48; font-weight: 700; }

/* ---------- Background / color settings ---------- */
.background-settings-box, .site-color-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg-soft);
}
.background-settings-box h2, .site-color-box h2 { margin-bottom: 4px; font-size: 20px; font-weight: 800; }
.background-settings-box p, .site-color-box p { margin: 0; color: var(--text-muted); font-weight: 400; }
.background-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.background-file-input, #id_image, #id_background_color { display: none; }
.color-choice-actions { display: flex; gap: 10px; }
.color-choice-btn {
    min-width: 84px;
    min-height: 48px;
    padding: 0 18px;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}
.color-choice-btn.is-dark { color: #fff; background: #0b1120; }
.color-choice-btn.is-light { color: #0b1120; background: #fff; border-color: var(--border); }
.color-choice-btn.active { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(124,58,237,0.16); }

/* ---------- Confirm delete ---------- */
.inline-confirm-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.danger-button {
    min-height: 52px;
    padding: 0 26px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background: #e11d48;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(225,29,72,0.30);
    transition: transform 0.2s ease, background 0.2s ease;
}
.danger-button:hover { transform: translateY(-2px); background: #be123c; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .dash, .admin-page, .crm-dashboard { grid-template-columns: 1fr; }
    .crm-sidebar {
        position: static;
        min-height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
    .crm-brand { width: 100%; margin-bottom: 8px; padding-bottom: 14px; }
    .crm-menu { grid-auto-flow: column; grid-template-columns: none; overflow-x: auto; }
    .crm-menu-heading { display: none; }
    .crm-logout { margin: 0; }
    .dash-main, .crm-content, .admin-card { padding: 26px 20px; margin: 20px; }
    .admin-card { margin: 20px; }
    .dash-stats { grid-template-columns: repeat(2, 1fr); }
    .dash-head { flex-direction: column; }
    .admin-row { grid-template-columns: 1fr; gap: 8px; }
    .media-form-grid, .school-view-admin-grid { grid-template-columns: 1fr; }
}
