/* ==========================================================================
   Al-Athar Institute — معهد الأثر
   Colour palette derived from the official logo.
   ========================================================================== */

:root {
    --primary-green: #092F23;
    --secondary-green: #173E2E;
    --dark-green: #06251B;
    --primary-gold: #C69B56;
    --light-gold: #E3C38A;
    --background: #F8F3E9;
    --card-background: #FFFDF8;
    --section-background: #EDE2CF;
    --text-primary: #252A26;
    --text-secondary: #806A4F;
    --border: #E4D6BE;
    --white: #FFFFFF;

    --font-heading: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-arabic-heading: 'Amiri', 'Noto Naskh Arabic', serif;
    --font-arabic-body: 'Noto Naskh Arabic', 'Amiri', serif;

    --radius: 14px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(9, 47, 35, .06), 0 2px 8px rgba(9, 47, 35, .05);
    --shadow: 0 2px 6px rgba(9, 47, 35, .06), 0 12px 32px rgba(9, 47, 35, .08);
    --container: 1180px;
    --header-height: 84px;

    --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23C69B56' stroke-width='1'%3E%3Cpath d='M48 8l11.3 28.7L88 48 59.3 59.3 48 88 36.7 59.3 8 48l28.7-11.3z'/%3E%3Cpath d='M19.7 19.7L48 31.4l28.3-11.7L64.6 48l11.7 28.3L48 64.6 19.7 76.3 31.4 48z'/%3E%3Ccircle cx='48' cy='48' r='9'/%3E%3Cpath d='M0 0l8 8M96 0l-8 8M0 96l8-8M96 96l-8-8'/%3E%3C/g%3E%3C/svg%3E");
}

html[lang="ru"] { --font-heading: 'PT Serif', Georgia, serif; }
html[lang="ar"] {
    --font-heading: var(--font-arabic-heading);
    --font-body: var(--font-arabic-body);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-size: 1.075rem; line-height: 1.9; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-green); text-decoration-color: var(--primary-gold); text-underline-offset: 3px; }
a:hover { color: var(--secondary-green); }

h1, h2, h3, h4, .h3 {
    font-family: var(--font-heading);
    color: var(--primary-green);
    line-height: 1.2;
    margin: 0 0 .5em;
    font-weight: 600;
}
h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h3, .h3 { font-size: 1.5rem; }
html[lang="ar"] h1 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.45; }
html[lang="ar"] h2 { line-height: 1.5; }
html[lang="ar"] h3, html[lang="ar"] .h3 { font-size: 1.35rem; line-height: 1.6; }
html[lang="ru"] h1 { font-size: clamp(2rem, 4vw, 3.1rem); }

p { margin: 0 0 1em; }
[lang="ar"] { font-family: var(--font-arabic-heading); }
html:not([lang="ar"]) [lang="ar"] { font-family: var(--font-arabic-heading); }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.narrow { max-width: 820px; margin-inline: auto; }
.text-center { text-align: center; }
.spaced { margin-top: 2.5rem; }
.muted { color: var(--text-secondary); }
.small { font-size: .9rem; }
.lead { font-size: 1.15rem; color: var(--text-secondary); max-width: 720px; }
.lead-sm { font-size: 1.07rem; }
.text-center .lead, .section-heading .lead { margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: absolute; inset-inline-start: 1rem; top: -100px; background: var(--primary-green); color: var(--white); padding: .6rem 1rem; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 1rem; }

:focus-visible { outline: 3px solid var(--primary-gold); outline-offset: 2px; }

.icon { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -.2em; flex-shrink: 0; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* ---------- Decorative ---------- */

.pattern-overlay {
    position: absolute; inset: 0;
    background-image: var(--pattern);
    background-size: 96px;
    opacity: .09;
    pointer-events: none;
}
.eyebrow {
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: .16em;
    font-size: .78rem;
    font-weight: 600;
    color: var(--primary-gold);
    margin-bottom: .6rem;
}
html[lang="ar"] .eyebrow { letter-spacing: 0; text-transform: none; font-size: .95rem; }

.ornament {
    display: flex; align-items: center; gap: 30px;
    margin: .25rem auto 1.25rem; max-width: 260px; min-height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 1l2.6 6.4L19 10l-6.4 2.6L10 19l-2.6-6.4L1 10l6.4-2.6z%27 fill=%27none%27 stroke=%27%23C69B56%27 stroke-width=%271.4%27/%3E%3C/svg%3E") no-repeat center / 18px;
}
.ornament::before, .ornament::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--primary-gold)); }
.ornament::after { background: linear-gradient(90deg, var(--primary-gold), transparent); }
.ornament-start { margin-inline: 0; max-width: 140px; }

.gold-rule { display: inline-block; width: 42px; height: 1px; background: var(--primary-gold); vertical-align: middle; margin-inline-end: .75rem; }
.gold-divider { border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--border), var(--primary-gold), var(--border), transparent); margin: 1.5rem 0; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .75rem 1.4rem; border-radius: 999px;
    font-family: var(--font-body); font-weight: 600; font-size: .95rem; line-height: 1.2;
    text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-lg { padding: .95rem 1.8rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary-green); color: var(--white); }
.btn-primary:hover { background: var(--secondary-green); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-gold { background: linear-gradient(135deg, var(--light-gold), var(--primary-gold)); color: var(--dark-green); }
.btn-gold:hover { color: var(--dark-green); box-shadow: 0 6px 20px rgba(198, 155, 86, .35); }
.btn-outline { border-color: var(--primary-green); color: var(--primary-green); background: transparent; }
.btn-outline:hover { background: var(--primary-green); color: var(--white); }
.btn-outline-light { border-color: rgba(227, 195, 138, .7); color: var(--light-gold); background: transparent; }
.btn-outline-light:hover { background: rgba(227, 195, 138, .12); color: var(--white); }
.button-row { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 1.75rem; }
.button-row-center { justify-content: center; }

/* ---------- Header ---------- */

.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(248, 243, 233, .94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1.25rem; min-height: var(--header-height); }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; flex-shrink: 0; }
.brand-logo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--border); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700; color: var(--primary-green); }
html[lang="ru"] .brand-name { font-size: 1.1rem; }
.brand-arabic { font-family: var(--font-arabic-heading); color: var(--primary-gold); font-size: 1.05rem; }
html[lang="ar"] .brand-arabic { display: none; }

.main-nav { display: flex; align-items: center; gap: 1rem; margin-inline-start: auto; }
.main-nav ul { display: flex; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.main-nav ul a {
    display: block; padding: .45rem .6rem; border-radius: 8px;
    text-decoration: none; color: var(--text-primary); font-size: .92rem; font-weight: 500; white-space: nowrap;
}
.main-nav ul a:hover { color: var(--primary-green); background: rgba(198, 155, 86, .12); }
.main-nav ul a.is-active { color: var(--primary-green); box-shadow: inset 0 -2px 0 var(--primary-gold); border-radius: 0; }
.nav-cta { white-space: nowrap; padding: .6rem 1.1rem; font-size: .88rem; }

.header-tools { display: flex; align-items: center; gap: .5rem; }
.language-switcher { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; padding: 3px; background: var(--card-background); }
.language-switcher a { text-decoration: none; font-size: .78rem; font-weight: 600; color: var(--text-secondary); padding: .3rem .55rem; border-radius: 999px; line-height: 1; }
.language-switcher a[lang="ar"] { font-family: var(--font-arabic-body); font-size: .85rem; }
.language-switcher a:hover { color: var(--primary-green); }
.language-switcher a.is-current { background: var(--primary-green); color: var(--light-gold); }
.language-switcher-menu { display: none; }

.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 10px; width: 44px; height: 44px; padding: 10px; cursor: pointer; flex-direction: column; justify-content: space-between; }
.nav-toggle-bar { display: block; height: 2px; background: var(--primary-green); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(4) { transform: translateY(-9px) rotate(-45deg); }

@media (max-width: 1180px) {
    .nav-toggle { display: flex; }
    .header-tools { margin-inline-start: auto; }
    .main-nav {
        position: absolute; inset-inline: 0; top: 100%;
        flex-direction: column; align-items: stretch; gap: .75rem;
        background: var(--card-background); border-bottom: 1px solid var(--border);
        padding: 1rem 1.25rem 1.5rem; box-shadow: var(--shadow);
        display: none;
    }
    .main-nav.is-open { display: flex; }
    .main-nav ul { flex-direction: column; }
    .main-nav ul a { padding: .7rem .5rem; font-size: 1rem; border-bottom: 1px solid var(--border); border-radius: 0; }
    .main-nav ul a.is-active { box-shadow: none; color: var(--primary-gold); }
}
@media (max-width: 640px) {
    :root { --header-height: 70px; }
    .header-inner { gap: .6rem; }
    .brand { gap: .55rem; min-width: 0; }
    .brand-logo { width: 46px; height: 46px; }
    .brand-name { font-size: 1.12rem; white-space: nowrap; }
    html[lang="ru"] .brand-name { font-size: .98rem; }
    .brand-arabic { font-size: .95rem; }
    .language-switcher-bar { display: none; }
    .language-switcher-menu { display: flex; justify-content: space-between; border-radius: 999px; }
    .language-switcher-menu a { flex: 1; text-align: center; padding: .55rem .4rem; font-size: .85rem; }
    .nav-cta { padding: .8rem 1.1rem; font-size: .95rem; }
}

/* ---------- Hero ---------- */

.hero {
    position: relative; overflow: hidden;
    background:
        radial-gradient(ellipse at 80% 20%, rgba(227, 195, 138, .22), transparent 55%),
        linear-gradient(160deg, var(--primary-green) 0%, var(--dark-green) 100%);
    color: var(--background);
    padding: clamp(3.5rem, 8vw, 6.5rem) 0;
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
.hero h1 { color: var(--white); }
.hero .lead { color: rgba(248, 243, 233, .85); }
.hero-arabic { font-family: var(--font-arabic-heading); font-size: 1.6rem; color: var(--light-gold); margin-bottom: .5rem; }
html[lang="ar"] .hero-arabic { display: none; }
.hero-tagline { font-family: var(--font-heading); font-style: italic; font-size: 1.3rem; color: var(--light-gold); margin-top: 1.25rem; }
html[lang="ar"] .hero-tagline { font-style: normal; }
.hero-visual { display: flex; justify-content: center; }
.hero-arch {
    position: relative; width: min(100%, 420px); aspect-ratio: 1;
    border-radius: 50%; padding: 14px;
    background: linear-gradient(145deg, var(--light-gold), var(--primary-gold) 50%, #9c7638);
    box-shadow: 0 30px 60px rgba(0, 0, 0, .35);
}
.hero-arch img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; gap: 2.25rem; }
    .hero-arch { width: min(78%, 300px); padding: 10px; }
}
@media (max-width: 640px) {
    .hero .button-row .btn { flex: 1 1 auto; }
}

/* ---------- Page hero ---------- */

.page-hero {
    position: relative; overflow: hidden;
    background: linear-gradient(160deg, var(--primary-green), var(--dark-green));
    color: var(--background);
    padding: clamp(3rem, 6vw, 4.75rem) 0 clamp(3.5rem, 6vw, 5rem);
    text-align: center;
}
.page-hero::after {
    content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 28px;
    background: var(--background);
    clip-path: polygon(0 100%, 0 60%, 45% 60%, 50% 0, 55% 60%, 100% 60%, 100% 100%);
}
.page-hero-inner { position: relative; }
.page-hero h1 { color: var(--white); }
.page-hero .lead { color: rgba(248, 243, 233, .85); margin-inline: auto; }
.page-hero .eyebrow { color: var(--light-gold); font-family: var(--font-arabic-heading); font-size: 1.3rem; letter-spacing: 0; text-transform: none; }

/* ---------- Sections ---------- */

.section { padding: clamp(3.5rem, 7vw, 5.5rem) 0; position: relative; }
.section-alt { background: var(--section-background); }
.section-alt + .section-alt { padding-top: 0; }
.section-heading { text-align: center; margin-bottom: 2.75rem; }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-center:has(> :only-child) { grid-template-columns: minmax(0, 560px); justify-content: center; }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Cards ---------- */

.card {
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.card h3 { margin-bottom: .4rem; }
.feature-card:hover, .teacher-card:hover, .course-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: var(--light-gold); }
.icon-badge {
    display: inline-grid; place-items: center; width: 54px; height: 54px; margin-bottom: 1rem;
    border-radius: 50% 50% 12px 12px;
    background: linear-gradient(160deg, var(--primary-green), var(--secondary-green));
    color: var(--light-gold);
}
.icon-badge .icon { width: 26px; height: 26px; }

.pathway-card {
    position: relative; overflow: hidden; display: block; text-decoration: none; color: var(--background);
    padding: 2.5rem 2.25rem; border-radius: 160px 160px var(--radius-lg) var(--radius-lg);
    background: linear-gradient(170deg, var(--secondary-green), var(--dark-green));
    border: 1px solid rgba(198, 155, 86, .5); box-shadow: var(--shadow);
    text-align: center; transition: transform .25s ease, box-shadow .25s ease;
}
.pathway-card::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(227, 195, 138, .35); border-radius: 150px 150px 16px 16px; pointer-events: none; }
.pathway-card:hover { transform: translateY(-4px); color: var(--background); box-shadow: 0 20px 44px rgba(6, 37, 27, .3); }
.pathway-card h3 { color: var(--white); font-size: 1.8rem; }
.pathway-card p { color: rgba(248, 243, 233, .82); max-width: 420px; margin-inline: auto; }
.pathway-arabic { display: block; font-family: var(--font-arabic-heading); color: var(--light-gold); font-size: 2.1rem; margin: 1rem 0 .25rem; }
html[lang="ar"] .pathway-card h3 { display: none; }
.link-arrow { display: inline-flex; align-items: center; gap: .4rem; color: var(--light-gold); font-weight: 600; font-size: .95rem; }

/* Arch-framed portraits */
.arch-frame {
    position: relative; aspect-ratio: 4 / 5; overflow: hidden;
    border-radius: 999px 999px var(--radius) var(--radius);
    border: 3px solid var(--primary-gold);
    box-shadow: inset 0 0 0 6px var(--card-background), var(--shadow-sm);
    background: var(--section-background);
}
.arch-frame img { width: 100%; height: 100%; object-fit: cover; }
.arch-placeholder {
    position: absolute; inset: 0; display: grid; place-items: center;
    background: var(--pattern) center / 64px, linear-gradient(170deg, var(--secondary-green), var(--dark-green));
}
.arch-placeholder span { font-family: var(--font-arabic-heading); font-size: 5rem; color: var(--light-gold); line-height: 1; text-shadow: 0 4px 18px rgba(0, 0, 0, .35); }
.arch-frame-lg { width: min(100%, 300px); }

.teacher-card { display: grid; grid-template-columns: 170px 1fr; gap: 1.5rem; align-items: start; }
.teacher-card .arch-frame { width: 170px; }
.teacher-card-body h3 { font-size: 1.65rem; }
.card-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.card-actions .btn { padding: .6rem 1.1rem; font-size: .88rem; }
@media (max-width: 640px) {
    .card { padding: 1.35rem; }
    .teacher-card { grid-template-columns: 104px 1fr; gap: 1rem; }
    .teacher-card .arch-frame { width: 104px; border-width: 2px; box-shadow: inset 0 0 0 4px var(--card-background), var(--shadow-sm); }
    .teacher-card-body h3 { font-size: 1.4rem; }
    .card-actions .btn { flex: 1 1 auto; }
    .pathway-card { padding: 2.25rem 1.5rem; }
}

.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: .6rem 0; }
.tag-list li { font-size: .8rem; padding: .25rem .7rem; border-radius: 999px; background: rgba(198, 155, 86, .14); color: var(--secondary-green); border: 1px solid rgba(198, 155, 86, .3); }
.tag-list-lg li { font-size: .92rem; padding: .4rem .9rem; }
html[lang="ar"] .tag-list li { font-size: .9rem; }

.department-card { text-align: center; position: relative; border-top: 4px solid var(--primary-green); }
.department-card.is-coming-soon { border-top-color: var(--primary-gold); background: linear-gradient(180deg, var(--card-background), #f6efe2); }
.department-arabic { font-family: var(--font-arabic-heading); font-size: 2rem; color: var(--primary-gold); margin-bottom: .1rem; }
html[lang="ar"] .department-card h3 { display: none; }
.status-badge { display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: .3rem .8rem; border-radius: 999px; margin-bottom: 1rem; background: rgba(198, 155, 86, .18); color: #8a6a35; }
.status-badge.is-active { background: rgba(9, 47, 35, .1); color: var(--primary-green); }
html[lang="ar"] .status-badge { letter-spacing: 0; font-size: .85rem; }

.course-card { position: relative; }
.course-number { font-family: var(--font-heading); font-size: 2.2rem; color: var(--light-gold); line-height: 1; display: block; margin-bottom: .5rem; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; counter-reset: step; }
.step { text-align: center; padding: 0 .5rem; position: relative; }
.step-number {
    display: inline-grid; place-items: center; width: 56px; height: 56px; margin-bottom: 1rem;
    font-family: var(--font-heading); font-size: 1.6rem; font-weight: 700; color: var(--primary-green);
    border: 1.5px solid var(--primary-gold); border-radius: 50%; background: var(--card-background);
    box-shadow: 0 0 0 6px var(--background);
}
.step h3 { font-size: 1.3rem; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) {
    .steps { gap: 1.5rem 1rem; }
    .step { padding: 0; }
    .step h3 { font-size: 1.15rem; }
    .step p { font-size: .92rem; }
}

/* Arabic level pathway */
.level-path { list-style: none; padding: 0; margin: 0; position: relative; }
.level-path::before { content: ""; position: absolute; inset-inline-start: 23px; top: 24px; bottom: 24px; width: 2px; background: linear-gradient(var(--primary-gold), var(--light-gold)); }
.level { display: grid; grid-template-columns: 48px 1fr; gap: 1.25rem; align-items: start; margin-bottom: 1.1rem; position: relative; }
.level-marker { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--primary-green); color: var(--light-gold); font-family: var(--font-heading); font-size: 1.4rem; font-weight: 700; box-shadow: 0 0 0 5px var(--background); }
.level .card { padding: 1.25rem 1.5rem; }
.level .card h3 { font-size: 1.35rem; }

.notice { display: flex; gap: 1rem; align-items: flex-start; background: var(--card-background); border: 1px solid var(--border); border-inline-start: 4px solid var(--primary-gold); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.notice > .icon { color: var(--primary-gold); width: 1.6rem; height: 1.6rem; margin-top: .15rem; }
.notice p:last-child { margin-bottom: 0; }

.check-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.check-list li { display: flex; gap: .65rem; align-items: baseline; padding: .4rem 0; border-bottom: 1px dashed var(--border); }
.check-list li:last-child { border-bottom: 0; }
.check-list .icon { color: var(--primary-gold); }

.grade-scale { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.grade-scale li { padding: .55rem 1.1rem; border-radius: 999px; background: var(--card-background); border: 1px solid var(--primary-gold); color: var(--primary-green); font-weight: 600; }

/* Teacher profile */
.teacher-hero { text-align: start; }
.teacher-hero-grid { position: relative; display: grid; grid-template-columns: 300px 1fr; grid-template-rows: auto 1fr; column-gap: 3rem; align-items: center; }
.teacher-hero-grid > .arch-frame { grid-row: 1 / span 2; }
.teacher-hero-heading { align-self: end; }
.teacher-hero-heading h1 { margin-bottom: .15rem; }
.teacher-hero-details { align-self: start; }
.teacher-hero .eyebrow { font-family: var(--font-body); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; }
html[lang="ar"] .teacher-hero .eyebrow { font-size: 1rem; letter-spacing: 0; }
.teacher-arabic-name { font-family: var(--font-arabic-heading); color: var(--light-gold); font-size: 1.6rem; }
html[lang="ar"] .teacher-arabic-name { display: none; }
.teacher-hero .arch-frame { box-shadow: inset 0 0 0 6px var(--primary-green), 0 24px 50px rgba(0, 0, 0, .35); }
.fact-list { display: flex; flex-wrap: wrap; gap: 1.25rem 2.25rem; margin: 1.25rem 0 0; }
.fact-list dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--light-gold); }
html[lang="ar"] .fact-list dt { letter-spacing: 0; font-size: .9rem; }
.fact-list dd { margin: 0; font-weight: 500; }
.fact-list-stacked { flex-direction: column; gap: 1rem; margin-bottom: 1.25rem; }
.fact-list-stacked dt { color: var(--text-secondary); display: flex; align-items: center; gap: .4rem; }
@media (max-width: 860px) {
    .teacher-hero-grid { grid-template-columns: 200px 1fr; column-gap: 2rem; }
}
@media (max-width: 640px) {
    .teacher-hero-grid { grid-template-columns: 112px 1fr; column-gap: 1.25rem; }
    .teacher-hero-grid > .arch-frame { grid-row: 1; width: 112px; }
    .teacher-hero-heading { align-self: center; }
    .teacher-hero-heading h1 { font-size: 1.85rem; }
    .teacher-hero-heading .teacher-arabic-name { font-size: 1.3rem; }
    .teacher-hero-details { grid-column: 1 / -1; margin-top: .5rem; }
    .teacher-hero .button-row .btn { flex: 1 1 auto; }
}
.profile-grid { display: grid; grid-template-columns: 1fr 340px; gap: 3rem; align-items: start; }
.profile-main h2 { font-size: 1.9rem; margin-top: 1.5rem; margin-bottom: .2rem; }
.profile-main h2:first-child { margin-top: 0; }
.profile-aside { position: sticky; top: calc(var(--header-height) + 1.5rem); }
.profile-aside h3 { font-size: 1.3rem; }
.day-list { list-style: none; padding: 0; margin: 0 0 .75rem; display: grid; grid-template-columns: 1fr 1fr; gap: .25rem; }
.day-list .icon { color: var(--primary-gold); }
@media (max-width: 900px) { .profile-grid { grid-template-columns: 1fr; } .profile-aside { position: static; } }

/* ---------- Pricing calculator ---------- */

.calculator { display: grid; grid-template-columns: 1fr 400px; gap: 2rem; align-items: start; }
@media (max-width: 980px) { .calculator { grid-template-columns: 1fr; } }
.calculator-form fieldset, .form fieldset { border: 0; padding: 0; margin: 0 0 1.75rem; min-width: 0; }
.calculator-form fieldset:last-child { margin-bottom: 0; }
legend { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 600; color: var(--primary-green); margin-bottom: .75rem; padding: 0; }
.form legend { font-family: var(--font-body); font-size: .92rem; font-weight: 600; color: var(--text-primary); margin-bottom: .5rem; }

.choice-grid { display: grid; gap: .65rem; }
.choice-grid-2 { grid-template-columns: repeat(2, 1fr); }
.choice-grid-3 { grid-template-columns: repeat(3, 1fr); }
.choice-grid-4 { grid-template-columns: repeat(4, 1fr); }
.choice-grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 640px) {
    .choice-grid-3 { grid-template-columns: 1fr; }
    .choice-grid-4, .choice-grid-5 { grid-template-columns: repeat(3, 1fr); }
    .choice > span { padding: .75rem .8rem; }
}
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice > span {
    display: flex; flex-direction: column; gap: .1rem; height: 100%;
    padding: .9rem 1rem; border-radius: var(--radius);
    border: 1.5px solid var(--border); background: var(--white);
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.choice-compact > span { text-align: center; align-items: center; justify-content: center; padding: .7rem .5rem; }
.choice strong { font-weight: 600; color: var(--primary-green); }
.choice small { color: var(--text-secondary); font-size: .8rem; }
.choice:hover > span { border-color: var(--light-gold); }
.choice input:checked + span { border-color: var(--primary-green); background: rgba(9, 47, 35, .04); box-shadow: inset 0 0 0 1px var(--primary-green); }
.choice input:focus-visible + span { outline: 3px solid var(--primary-gold); outline-offset: 2px; }
.choice input:disabled + span { opacity: .4; cursor: not-allowed; background: var(--background); }
.choice.is-unavailable { display: none; }
.save-badge { color: #8a6a35 !important; font-weight: 600; }

.calculator-summary {
    position: sticky; top: calc(var(--header-height) + 1.5rem); overflow: hidden;
    background: linear-gradient(170deg, var(--primary-green), var(--dark-green));
    color: var(--background); border-radius: var(--radius-lg); padding: 2rem;
    border: 1px solid rgba(198, 155, 86, .5); box-shadow: var(--shadow);
}
@media (max-width: 980px) { .calculator-summary { position: relative; top: 0; } }
.calculator-summary > * { position: relative; }
.calculator-summary h3 { color: var(--white); text-align: center; margin-bottom: 0; }
.summary-list { margin: 0 0 1.25rem; }
.summary-list > div { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid rgba(227, 195, 138, .18); font-size: .93rem; }
.summary-list dt { color: rgba(248, 243, 233, .7); }
.summary-list dd { margin: 0; font-weight: 600; text-align: end; }
.summary-list [data-row][hidden] { display: none; }
.summary-total { text-align: center; padding: 1.25rem; border-radius: var(--radius); background: rgba(227, 195, 138, .1); border: 1px solid rgba(227, 195, 138, .35); margin-bottom: 1.25rem; }
.summary-total span { display: block; font-size: .85rem; color: var(--light-gold); text-transform: uppercase; letter-spacing: .12em; }
html[lang="ar"] .summary-total span { letter-spacing: 0; font-size: 1rem; }
.summary-total strong { display: block; font-family: var(--font-heading); font-size: 2.8rem; color: var(--white); line-height: 1.2; margin: .25rem 0; }
.summary-total small { color: rgba(248, 243, 233, .75); }

.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--card-background); }
.price-table { width: 100%; border-collapse: collapse; }
.price-table th, .price-table td { padding: 1rem 1.25rem; text-align: start; border-bottom: 1px solid var(--border); }
.price-table thead th { background: var(--primary-green); color: var(--light-gold); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
html[lang="ar"] .price-table thead th { letter-spacing: 0; font-size: .95rem; }
.price-table tbody tr:last-child > * { border-bottom: 0; }
.price-table tbody th { font-weight: 500; }
.price-table td { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 600; color: var(--primary-green); }
.badge { display: inline-block; margin-inline-start: .4rem; font-size: .72rem; padding: .15rem .55rem; border-radius: 999px; background: rgba(198, 155, 86, .18); color: #8a6a35; font-weight: 600; vertical-align: middle; }
.note-list { margin-top: 1.5rem; padding-inline-start: 1.25rem; color: var(--text-secondary); font-size: .92rem; }
.note-list li { margin-bottom: .3rem; }

/* ---------- Forms ---------- */

.form-layout { display: grid; grid-template-columns: 340px 1fr; gap: 2rem; align-items: start; }
@media (max-width: 900px) { .form-layout { grid-template-columns: 1fr; } .form-layout .trial-aside { order: 2; } }
.form-card { padding: clamp(1.5rem, 4vw, 2.5rem); }
.form { display: grid; gap: 1.1rem; margin-top: 1.25rem; }
.form fieldset { margin-bottom: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.field { display: grid; gap: .35rem; }
.field > span { font-size: .92rem; font-weight: 600; }
.field input, .field select, .field textarea {
    width: 100%; font: inherit; font-size: 1rem; color: var(--text-primary);
    padding: .75rem .9rem; border-radius: 10px; border: 1.5px solid var(--border); background: var(--white);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary-green); box-shadow: 0 0 0 3px rgba(198, 155, 86, .3); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #a5432f; }
.hint { color: var(--text-secondary); font-size: .82rem; }
.error { color: #a5432f; font-size: .85rem; font-weight: 500; }
.required { color: var(--primary-gold); }
.checkbox { display: flex; gap: .65rem; align-items: flex-start; font-size: .93rem; cursor: pointer; }
.checkbox input { width: 1.15rem; height: 1.15rem; margin-top: .25rem; accent-color: var(--primary-green); flex-shrink: 0; }
.checkbox.has-error { color: #a5432f; }
.custom-frequency { margin-top: .9rem; max-width: 260px; }
.alert { padding: 1rem 1.25rem; border-radius: var(--radius); margin: 1rem 0; font-weight: 500; }
.alert-success { background: rgba(9, 47, 35, .08); border: 1px solid rgba(9, 47, 35, .25); color: var(--primary-green); }
.alert-error { background: rgba(165, 67, 47, .08); border: 1px solid rgba(165, 67, 47, .3); color: #8a3523; }
.trial-aside { position: sticky; top: calc(var(--header-height) + 1.5rem); }
@media (max-width: 900px) { .trial-aside { position: static; } }
.contact-logo { width: 140px; border-radius: 50%; margin: 0 auto 1.5rem; }

/* ---------- FAQ & prose ---------- */

.faq-list { display: grid; gap: .75rem; }
.faq-item { background: var(--card-background); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 1.5rem; transition: border-color .2s ease; }
.faq-item[open] { border-color: var(--light-gold); box-shadow: var(--shadow-sm); }
.faq-item summary { cursor: pointer; list-style: none; padding: 1.15rem 0; font-weight: 600; color: var(--primary-green); display: flex; justify-content: space-between; gap: 1rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--primary-gold); transition: transform .2s ease; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { color: var(--text-secondary); padding-bottom: 1.15rem; margin: 0; }

.prose h2 { font-size: 1.6rem; margin-top: 2rem; }
.prose h2:first-child { margin-top: 0; }

/* ---------- Closing CTA ---------- */

.closing-cta { position: relative; overflow: hidden; padding: clamp(3.5rem, 7vw, 5.5rem) 0; background: linear-gradient(160deg, var(--secondary-green), var(--dark-green)); color: var(--background); text-align: center; }
.closing-inner { position: relative; }
.closing-cta h2 { color: var(--white); }
.closing-cta .lead { color: rgba(248, 243, 233, .85); margin-inline: auto; }

/* ---------- Footer ---------- */

.site-footer { position: relative; overflow: hidden; background: var(--dark-green); color: rgba(248, 243, 233, .78); padding: 4rem 0 1.5rem; border-top: 3px solid var(--primary-gold); }
.site-footer .pattern-overlay { opacity: .05; }
.footer-grid { position: relative; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .footer-grid { gap: 2rem 1.25rem; } .footer-brand img { width: 88px; } }
.footer-brand img { width: 110px; border-radius: 50%; margin-bottom: 1rem; }
.footer-name { font-family: var(--font-heading); font-size: 1.5rem; color: var(--white); margin: 0; font-weight: 600; }
.footer-arabic { font-family: var(--font-arabic-heading); font-size: 1.4rem; color: var(--light-gold); margin: 0; }
html[lang="ar"] .footer-arabic { display: none; }
.footer-tagline { font-style: italic; color: var(--light-gold); margin-top: .5rem; }
html[lang="ar"] .footer-tagline { font-style: normal; }
.footer-heading { font-family: var(--font-body); font-size: .8rem; text-transform: uppercase; letter-spacing: .16em; color: var(--primary-gold); margin-bottom: 1rem; }
html[lang="ar"] .footer-heading { letter-spacing: 0; font-size: 1rem; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.footer-links a { color: rgba(248, 243, 233, .78); text-decoration: none; font-size: .93rem; overflow-wrap: anywhere; }
.footer-links a:hover { color: var(--light-gold); }
.footer-bottom { position: relative; margin-top: 3rem; text-align: center; font-size: .85rem; color: rgba(248, 243, 233, .55); }
.footer-bottom .gold-rule { display: block; width: 100%; margin: 0 0 1.25rem; background: linear-gradient(90deg, transparent, rgba(198, 155, 86, .5), transparent); }

/* ---------- Accounts & booking ---------- */

.account-link { display: inline-flex; align-items: center; gap: .35rem; text-decoration: none; font-size: .85rem; font-weight: 600; color: var(--primary-green); padding: .4rem .7rem; border-radius: 999px; border: 1px solid var(--border); background: var(--card-background); white-space: nowrap; }
.account-link:hover { border-color: var(--primary-gold); }
@media (max-width: 680px) { .account-link span { display: none; } }

.spaced-sm { margin-top: 1.25rem; }
.split-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

.auth-section { background: linear-gradient(180deg, var(--section-background), var(--background)); overflow: hidden; }
.auth-section .pattern-overlay { opacity: .07; }
.auth-card { position: relative; max-width: 520px; margin-inline: auto; padding: clamp(1.75rem, 5vw, 2.75rem); box-shadow: var(--shadow); }
.auth-card h1 { text-align: center; margin-bottom: .25rem; }
.auth-logo { width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 1rem; }

.choice-link { display: flex; flex-direction: column; gap: .1rem; padding: .9rem 1rem; border-radius: var(--radius); border: 1.5px solid var(--border); background: var(--white); text-decoration: none; color: inherit; transition: border-color .2s ease; }
.choice-link strong { color: var(--primary-green); }
.choice-link small { color: var(--text-secondary); font-size: .8rem; }
.choice-link:hover { border-color: var(--light-gold); color: inherit; }
.choice-link.is-selected { border-color: var(--primary-green); box-shadow: inset 0 0 0 1px var(--primary-green); background: rgba(9, 47, 35, .04); }

.day-picker { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .5rem; scroll-snap-type: x proximity; }
.day-chip { flex: 0 0 auto; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; min-width: 64px; padding: .55rem .5rem; border-radius: 14px; border: 1.5px solid var(--border); background: var(--white); text-decoration: none; color: var(--text-secondary); font-size: .78rem; line-height: 1.3; }
.day-chip strong { font-family: var(--font-heading); font-size: 1.5rem; color: var(--primary-green); line-height: 1.1; }
.day-chip:hover { border-color: var(--light-gold); color: var(--text-secondary); }
.day-chip.is-selected { background: var(--primary-green); border-color: var(--primary-green); color: var(--light-gold); }
.day-chip.is-selected strong { color: var(--white); }
.slot-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }

.dashboard-hero { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--primary-green), var(--dark-green)); color: var(--background); padding: 2.5rem 0 0; }
.dashboard-hero .container { position: relative; }
.dashboard-hero h1 { color: var(--white); }
.dashboard-nav { display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; margin-top: 1.25rem; }
.dashboard-nav a, .dashboard-nav .link-button { padding: .8rem 1.1rem; color: rgba(248, 243, 233, .8); text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent; }
.dashboard-nav a.is-active { color: var(--white); border-bottom-color: var(--primary-gold); }
.dashboard-nav form { margin-inline-start: auto; }
.link-button { background: none; border: 0; font: inherit; cursor: pointer; color: var(--primary-green); text-decoration: underline; text-decoration-color: var(--primary-gold); padding: 0; }
.link-danger { color: #a5432f; font-size: .85rem; }

.dashboard-grid { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; align-items: start; }
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }
.next-lesson { border-top: 4px solid var(--primary-gold); }
.next-lesson .notice { margin-top: 1rem; }
.lesson-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .6rem; }
.lesson-row { display: grid; grid-template-columns: 56px 1fr auto auto; gap: 1rem; align-items: center; background: var(--card-background); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; }
@media (max-width: 560px) { .lesson-row { grid-template-columns: 56px 1fr; } }
.lesson-row .status-badge { margin: 0; }
.lesson-row p { margin: 0; }
.lesson-title { font-weight: 600; color: var(--primary-green); }
.lesson-date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 12px; background: var(--section-background); line-height: 1.1; font-size: .75rem; color: var(--text-secondary); }
.lesson-date strong { font-family: var(--font-heading); font-size: 1.5rem; color: var(--primary-green); }
.status-scheduled { background: rgba(9, 47, 35, .1); color: var(--primary-green); }
.status-completed { background: rgba(198, 155, 86, .2); color: #7a5b2a; }
.status-cancelled, .status-missed { background: rgba(165, 67, 47, .1); color: #8a3523; }
.summary-plain { margin: 0 0 1rem; }
.summary-plain > div { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--border); font-size: .93rem; }
.summary-plain dt { color: var(--text-secondary); }
.summary-plain dd { margin: 0; font-weight: 600; text-align: end; }

.arch-frame img { object-position: center 20%; }

/* ---------- Arabic course levels ---------- */

.course-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; max-width: 760px; margin: 2rem auto 0; }
.course-facts > div { display: flex; flex-direction: column-reverse; padding: 1rem .75rem; border: 1px solid rgba(227, 195, 138, .35); border-radius: var(--radius); background: rgba(227, 195, 138, .08); }
.course-facts dd { margin: 0; font-family: var(--font-heading); font-size: 1.9rem; font-weight: 600; color: var(--white); line-height: 1.2; }
.course-facts dt { font-size: .85rem; color: var(--light-gold); }
@media (max-width: 640px) { .course-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; } }

.level-stage { margin: 1.75rem 0 .9rem; padding-inline-start: 68px; font-family: var(--font-heading); font-size: 1.35rem; font-weight: 600; color: var(--primary-gold); }
.level-stage:first-child { margin-top: 0; }
.level-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .25rem 1rem; margin-bottom: .35rem; font-size: .8rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .08em; }
html[lang="ar"] .level-meta { text-transform: none; letter-spacing: 0; font-size: .9rem; }
.level-meta .icon { color: var(--primary-gold); }
.level .card p.muted { margin-bottom: 0; }

.exam-rules { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1.5rem; }
.exam-rule { display: flex; gap: 1rem; align-items: flex-start; padding: 1.5rem; border-radius: var(--radius-lg); background: var(--card-background); border: 1px solid var(--border); border-inline-start: 4px solid var(--primary-gold); }
.exam-rule p { margin: 0; }
.exam-rule p + p { margin-top: .35rem; }
.exam-rule > .icon { width: 1.6rem; height: 1.6rem; color: var(--primary-gold); margin-top: .1rem; }
.exam-rule-pass { align-items: center; background: linear-gradient(160deg, var(--primary-green), var(--dark-green)); border-color: rgba(198, 155, 86, .5); border-inline-start-color: var(--primary-gold); }
.exam-rule-pass strong { font-family: var(--font-heading); font-size: 1.45rem; color: var(--white); }
.exam-rule-pass > .icon { color: var(--light-gold); }
@media (max-width: 760px) { .exam-rules { grid-template-columns: 1fr; } }
.skills-panel { background: var(--card-background); border: 1px solid var(--border); border-top: 4px solid var(--primary-gold); border-radius: var(--radius-lg); padding: 1.75rem; }
.skills-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; margin-bottom: 0; }
@media (max-width: 640px) { .skills-list { grid-template-columns: 1fr; } }
.text-start { text-align: start; }

/* Arabic curriculum stages */
.level-marker-range { font-size: .95rem; letter-spacing: -.02em; }
.stage-topics { margin: .75rem 0 1rem; }
.stage-goal { margin: 0; padding: .75rem 1rem; border-radius: var(--radius); background: rgba(198, 155, 86, .1); }
