/* ==========================================================
   الرواد – مركز التكوين · Site styles (public, auth, student)
   ========================================================== */
:root {
  --teal: #4cb5ae;
  --blue: #2f9fd4;
  --blue-d: #1f7fb0;
  --navy: #0f2a3d;
  --ink: #1b2b3a;
  --muted: #64748b;
  --line: #e4ebf1;
  --bg: #ffffff;
  --bg-soft: #f5f9fb;
  --sand: #fbf6ee;
  --saffron: #e9a23b;
  --terra: #c8553d;
  --ok: #16a34a;
  --err: #dc2626;
  --grad: linear-gradient(135deg, var(--teal), var(--blue));
  --radius: 16px;
  --shadow: 0 10px 30px -12px rgba(15, 42, 61, .18);
  --shadow-lg: 0 30px 60px -20px rgba(15, 42, 61, .28);
  --font: "Tajawal", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Moroccan 8-point star (khatam) tile */
  --zellige: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%232f9fd4' stroke-width='1'%3E%3Crect x='18' y='18' width='20' height='20'/%3E%3Crect x='18' y='18' width='20' height='20' transform='rotate(45 28 28)'/%3E%3Cpath d='M0 0l10 10M56 0L46 10M0 56l10-10M56 56L46 46'/%3E%3C/g%3E%3C/svg%3E");
}
.lang-fr, .lang-en { --font: "Inter", "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.65; font-size: 16px; }
img { max-width: 100%; display: block; }
a { color: var(--blue-d); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; color: var(--navy); font-weight: 800; }
p { margin: 0 0 1em; }
.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
[hidden] { display: none !important; }
.ic { width: 1.15em; height: 1.15em; flex: none; }
[dir="rtl"] .ic-arrow, [dir="rtl"] .ic-chevron { transform: scaleX(-1); }
[dir="ltr"] .flip .ic-arrow { transform: scaleX(-1); }
[dir="rtl"] .flip .ic-arrow { transform: none; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: .7em 1.25em; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none !important; transition: transform .15s, box-shadow .15s, background .15s; white-space: nowrap; color: inherit; background: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px -8px rgba(47, 159, 212, .6); }
.btn-primary:hover { box-shadow: 0 12px 26px -8px rgba(47, 159, 212, .75); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: #163a52; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-outline { background: #fff; color: var(--navy); border-color: #cfdbe5; }
.btn-outline:hover { border-color: var(--blue); color: var(--blue-d); }
.btn-soft { background: #e8f4fb; color: var(--blue-d); }
.btn-light { background: #fff; color: var(--navy); }
.btn-outline-light { border-color: rgba(255,255,255,.6); color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,.12); }
.btn-lg { padding: .9em 1.6em; font-size: 1.02rem; border-radius: 14px; }
.btn-sm { padding: .42em .8em; font-size: .85rem; border-radius: 10px; }
.btn.block { display: flex; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; font-size: .7rem; padding: 0; }
.icon-btn:hover:not(:disabled) { color: var(--blue-d); border-color: var(--blue); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.danger:hover { color: var(--err); border-color: #fca5a5; background: #fef2f2; }

/* ---------- Alerts / forms ---------- */
.alert { padding: .85em 1.1em; border-radius: 12px; margin-bottom: 1rem; font-weight: 500; border: 1px solid; }
.alert-ok { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-err { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.form { display: grid; gap: 1rem; }
.form label { display: grid; gap: .4rem; font-weight: 600; font-size: .92rem; color: var(--navy); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
  width: 100%; font: inherit; font-weight: 500; font-size: .98rem; color: var(--ink); background: #fff; border: 1.5px solid #d9e3ea; border-radius: 12px; padding: .72em .95em; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(47, 159, 212, .14); }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem 1.2rem; display: grid; gap: .9rem; margin: 0; }
legend { font-weight: 800; padding: 0 .4rem; color: var(--navy); }

/* ---------- Announcement + header ---------- */
.announce { display: flex; align-items: center; justify-content: center; gap: .75rem; flex-wrap: wrap; padding: .55rem 1rem; color: #fff; font-size: .92rem; font-weight: 500;
  background: linear-gradient(90deg, var(--navy), #164a6b 45%, var(--blue)); }
.announce a { color: #fff; font-weight: 700; display: inline-flex; gap: .3em; align-items: center; text-decoration: underline; text-underline-offset: 3px; }
.announce-tag { background: var(--saffron); color: var(--navy); font-weight: 800; padding: .05em .7em; border-radius: 99px; font-size: .8rem; }
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .88); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 1.5rem; min-height: 76px; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none !important; }
.brand-mark { height: 42px; width: auto; }
.brand-sub { font-size: .78rem; font-weight: 700; color: var(--muted); border-inline-start: 2px solid var(--line); padding-inline-start: .7rem; line-height: 1.2; max-width: 7.5em; }
.main-nav { display: flex; gap: 1.75rem; margin-inline: auto; }
.main-nav a { color: var(--ink); font-weight: 600; font-size: .98rem; }
.main-nav a:hover { color: var(--blue-d); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: .6rem; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; width: 42px; height: 42px; place-items: center; cursor: pointer; color: var(--navy); }
.nav-toggle .ic { width: 22px; height: 22px; }
.lang-menu { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: .35rem; font: inherit; font-weight: 700; font-size: .85rem; color: var(--navy); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: .5em .7em; cursor: pointer; }
.lang-list { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: .35rem; min-width: 150px; display: none; z-index: 60; }
.lang-menu.open .lang-list { display: block; }
.lang-list a { display: block; padding: .5em .8em; border-radius: 8px; color: var(--ink); font-weight: 600; text-decoration: none; }
.lang-list a:hover { background: var(--bg-soft); }
.lang-list a.active { background: #e8f4fb; color: var(--blue-d); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 5rem); }
.hero-bg { position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(700px 420px at 85% 10%, rgba(233, 162, 59, .14), transparent 60%),
              radial-gradient(640px 480px at 10% 70%, rgba(47, 159, 212, .14), transparent 60%), var(--bg); }
.hero-bg::after { content: ""; position: absolute; inset: 0; background-image: var(--zellige); opacity: .07; mask-image: linear-gradient(to bottom, #000, transparent 85%); -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: .45rem; background: #fff; border: 1px solid var(--line); padding: .35em .9em; border-radius: 99px; font-weight: 700; font-size: .88rem; color: var(--blue-d); box-shadow: 0 4px 14px -8px rgba(15, 42, 61, .2); margin-bottom: 1.2rem; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 4.1rem); font-weight: 900; letter-spacing: -.01em; margin-bottom: 1.1rem; }
.lang-fr .hero h1, .lang-en .hero h1 { letter-spacing: -.03em; }
.hero h1 .hl { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: #475569; max-width: 36em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.8rem 0 2.2rem; }
.hero-stats { list-style: none; margin: 0; padding: 1.4rem 0 0; display: flex; gap: clamp(1.5rem, 4vw, 3rem); border-top: 1px solid var(--line); }
.hero-stats b { display: block; font-size: 2rem; font-weight: 900; color: var(--navy); line-height: 1.1; font-family: "Inter", var(--font); }
.hero-stats span { color: var(--muted); font-weight: 600; font-size: .92rem; }

.hero-visual { position: relative; height: 520px; }
.arch { position: absolute; margin: 0; overflow: hidden; border-radius: 999px 999px 22px 22px; box-shadow: var(--shadow-lg); border: 6px solid #fff; background: var(--bg-soft); }
.arch img { width: 100%; height: 100%; object-fit: cover; }
.arch-1 { width: 54%; height: 88%; inset-inline-start: 23%; top: 2%; z-index: 2; }
.arch-2 { width: 36%; height: 60%; inset-inline-start: 0; top: 24%; z-index: 1; transform: rotate(-4deg); }
.arch-3 { width: 36%; height: 60%; inset-inline-end: 0; top: 30%; z-index: 1; transform: rotate(4deg); }
.arch-ph { width: 100%; height: 100%; display: grid; place-content: center; justify-items: center; gap: .7rem; color: #fff; font-weight: 800; position: relative; text-align: center; padding: 1rem; }
.arch-ph::before { content: ""; position: absolute; inset: 0; background-image: var(--zellige); opacity: .35; filter: brightness(10); }
.arch-ph .ic { width: 54px; height: 54px; position: relative; }
.arch-ph span { position: relative; font-size: 1.05rem; }
.ph-1 { background: linear-gradient(160deg, var(--teal), var(--blue) 70%, var(--navy)); }
.ph-2 { background: linear-gradient(160deg, var(--saffron), var(--terra)); }
.ph-3 { background: linear-gradient(160deg, #3d7fa8, var(--navy)); }
.float-card { position: absolute; z-index: 3; display: flex; align-items: center; gap: .7rem; background: #fff; border-radius: 14px; padding: .7rem 1rem; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.float-card > .ic { width: 38px; height: 38px; padding: 9px; border-radius: 10px; background: var(--grad); color: #fff; }
.float-card b { display: block; font-size: .92rem; color: var(--navy); }
.float-card small { color: var(--muted); font-size: .78rem; }
.fc-1 { bottom: 6%; inset-inline-start: 4%; }
.fc-2 { top: 8%; inset-inline-end: 0; }
.fc-2 > .ic { background: var(--saffron); }
.star-deco { position: absolute; width: 90px; height: 90px; bottom: -2%; inset-inline-end: 10%; background: var(--saffron); opacity: .9; z-index: 0;
  clip-path: polygon(50% 0, 61% 26%, 85% 15%, 74% 39%, 100% 50%, 74% 61%, 85% 85%, 61% 74%, 50% 100%, 39% 74%, 15% 85%, 26% 61%, 0 50%, 26% 39%, 15% 15%, 39% 26%); }

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section-tint { background: var(--sand); position: relative; }
.section-tint::before { content: ""; position: absolute; inset: 0; background-image: var(--zellige); opacity: .05; pointer-events: none; }
.section-tint > .container { position: relative; }
.section-head { max-width: 720px; margin: 0 auto 2.8rem; text-align: center; }
.section-head h2, .center-text h2, .cta h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.section-head p { color: var(--muted); font-size: 1.08rem; }
.pill { display: inline-block; background: #e8f4fb; color: var(--blue-d); font-weight: 800; font-size: .82rem; padding: .35em 1em; border-radius: 99px; margin-bottom: .9rem; }

/* Programs */
.programs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.8rem; }
.program { background: #fff; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.program:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.program-cover { position: relative; padding: 2rem 2rem 1.8rem; color: #fff; overflow: hidden; min-height: 200px; }
.program-college .program-cover { background: linear-gradient(135deg, var(--teal), #2b8fb8); }
.program-lycee .program-cover { background: linear-gradient(135deg, #1f6f9e, var(--navy)); }
.program-pattern { position: absolute; inset: 0; background-image: var(--zellige); filter: brightness(10); opacity: .18; }
.program-cover h3 { color: #fff; font-size: 1.8rem; margin: .7rem 0 .4rem; position: relative; }
.program-cover p { opacity: .92; position: relative; max-width: 26em; margin: 0; padding-inline-end: 6.5rem; }
.program-cover h3 { padding-inline-end: 5rem; }
.program-tag { position: relative; display: inline-block; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); font-weight: 700; font-size: .8rem; padding: .2em .8em; border-radius: 99px; }
.program-big { position: absolute; inset-inline-end: 1.4rem; bottom: -1.4rem; font-family: "Inter", sans-serif; font-weight: 900; font-size: 9rem; line-height: 1; color: var(--saffron); opacity: .95; }
.program-body { padding: 1.6rem 2rem 2rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.program-body h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: .4rem 0 .3rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { background: var(--bg-soft); border: 1px solid var(--line); padding: .35em .85em; border-radius: 99px; font-weight: 700; font-size: .88rem; color: var(--navy); }
.subject-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.subject-list li { display: flex; align-items: center; gap: .55rem; font-weight: 600; font-size: .95rem; }
.s-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); flex: none; }
.s-ic svg { width: 18px; height: 18px; }
.program-meta { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1rem 0 1.2rem; padding-top: 1rem; border-top: 1px dashed var(--line); color: var(--muted); font-size: .88rem; font-weight: 600; }
.program-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.program-body .btn { margin-top: auto; }

/* Features */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.3rem; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 1.6rem; box-shadow: 0 6px 20px -14px rgba(15, 42, 61, .25); }
.feature-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--grad); color: #fff; margin-bottom: 1rem; }
.feature:nth-child(2) .feature-ic { background: linear-gradient(135deg, var(--saffron), var(--terra)); }
.feature:nth-child(3) .feature-ic { background: linear-gradient(135deg, #3d7fa8, var(--navy)); }
.feature:nth-child(4) .feature-ic { background: linear-gradient(135deg, #2bb673, var(--teal)); }
.feature-ic .ic { width: 26px; height: 26px; }
.feature h3 { font-size: 1.12rem; }
.feature p { color: var(--muted); margin: 0; font-size: .95rem; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; counter-reset: s; position: relative; }
.step { position: relative; padding: 2rem 1.6rem 1.6rem; background: #fff; border-radius: 18px; border: 1px solid var(--line); text-align: center; }
.step-n { display: grid; place-items: center; width: 58px; height: 58px; margin: -3.2rem auto 1rem; font-family: "Inter", sans-serif; font-weight: 900; font-size: 1.5rem; color: #fff; background: var(--grad);
  clip-path: polygon(50% 0, 61% 26%, 85% 15%, 74% 39%, 100% 50%, 74% 61%, 85% 85%, 61% 74%, 50% 100%, 39% 74%, 15% 85%, 26% 61%, 0 50%, 26% 39%, 15% 15%, 39% 26%); }
.step:nth-child(2) .step-n { background: var(--saffron); }
.step:nth-child(3) .step-n { background: var(--navy); }
.step h3 { font-size: 1.15rem; }
.step p { color: var(--muted); margin: 0; }
.steps { margin-top: 2rem; }

/* Center / gallery */
.center-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 3rem; align-items: center; }
.center-text p { color: #475569; font-size: 1.05rem; }
.ticks { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: .7rem; }
.ticks li { display: flex; gap: .6rem; align-items: flex-start; font-weight: 600; }
.ticks .ic { color: #fff; background: var(--teal); border-radius: 50%; padding: 3px; width: 22px; height: 22px; margin-top: 2px; }
.ticks.light li { color: #fff; }
.ticks.light .ic { background: rgba(255, 255, 255, .25); }
.gallery { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 120px; gap: .9rem; }
.gallery figure { margin: 0; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); background: var(--bg-soft); }
.gallery figure img { width: 100%; height: 100%; object-fit: cover; }
.gallery figure:nth-child(1) { grid-column: span 4; grid-row: span 2; border-radius: 999px 999px 18px 18px; }
.gallery figure:nth-child(2) { grid-column: span 2; grid-row: span 2; }
.gallery figure:nth-child(3) { grid-column: span 2; }
.gallery figure:nth-child(4) { grid-column: span 2; }
.gallery figure:nth-child(5) { grid-column: span 2; }
.gallery-empty figure:nth-child(3), .gallery-empty figure:nth-child(4) { grid-column: span 3; }
.g-ph { display: grid; place-items: center; color: rgba(255, 255, 255, .8); position: relative; }
.g-ph .ic { width: 40px; height: 40px; }
.gallery .g-ph-1 { background: linear-gradient(160deg, var(--teal), var(--blue)); }
.gallery .g-ph-2 { background: linear-gradient(160deg, var(--saffron), var(--terra)); }
.gallery .g-ph-3 { background: linear-gradient(160deg, #3d7fa8, var(--navy)); }
.gallery .g-ph-4 { background: linear-gradient(160deg, #2bb673, var(--teal)); }

/* CTA */
.cta { position: relative; overflow: hidden; border-radius: 26px; padding: clamp(2rem, 5vw, 3.5rem); background: linear-gradient(120deg, var(--navy), #155177 55%, var(--blue)); color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cta-pattern { position: absolute; inset: 0; background-image: var(--zellige); filter: brightness(10); opacity: .1; }
.cta > div { position: relative; }
.cta h2 { color: #fff; margin-bottom: .4rem; }
.cta p { opacity: .85; margin: 0; }
.cta-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* Footer */
.site-footer { background: var(--navy); color: #c5d3df; padding-bottom: 1.5rem; }
.zellige-band { height: 14px; background: linear-gradient(90deg, var(--teal), var(--blue), var(--saffron), var(--terra), var(--teal)); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2.5rem; padding: 3.5rem 0 2.5rem; }
.footer-logo { height: 46px; width: auto; background: #fff; border-radius: 12px; padding: 8px 12px; margin-bottom: 1rem; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.site-footer a { color: #c5d3df; }
.site-footer a:hover { color: #fff; }
.contact-list li { display: flex; gap: .55rem; align-items: center; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 1.4rem; font-size: .88rem; color: #8ea3b5; }

/* ---------- Auth pages ---------- */
.auth-body { background: var(--bg-soft); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, .8fr) 1.2fr; }
.auth-wrap.single { grid-template-columns: 1fr; place-items: center; padding: 2rem 1rem; }
.auth-side { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--teal), var(--blue) 55%, var(--navy)); color: #fff; display: grid; place-items: center; padding: 3rem; }
.auth-side::before { content: ""; position: absolute; inset: 0; background-image: var(--zellige); filter: brightness(10); opacity: .14; }
.auth-side-inner { position: relative; max-width: 380px; }
.auth-side-logo { height: 70px; width: auto; background: #fff; border-radius: 16px; padding: 12px 18px; margin-bottom: 2rem; box-shadow: var(--shadow-lg); }
.auth-side h2 { color: #fff; font-size: 2rem; }
.auth-side p { opacity: .9; font-size: 1.05rem; }
.auth-card { background: #fff; width: min(560px, 100% - 32px); margin: 2.5rem auto; padding: clamp(1.5rem, 4vw, 2.6rem); border-radius: 22px; box-shadow: var(--shadow-lg); align-self: center; }
.auth-card.wide { width: min(640px, 100% - 32px); }
.auth-card h1 { font-size: 1.8rem; margin-bottom: .3rem; }
.auth-logo { height: 54px; width: auto; margin: 0 auto 1rem; }
.auth-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.6rem; }
.back-link { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-weight: 600; font-size: .9rem; }
.level-pick { display: grid; gap: .65rem; }
.level-pick .label { font-weight: 700; font-size: .92rem; color: var(--navy); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; background: var(--bg-soft); padding: .35rem; border-radius: 14px; border: 1px solid var(--line); }
.seg-opt input, .year-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span { display: block; text-align: center; padding: .7em; border-radius: 10px; font-weight: 700; cursor: pointer; color: var(--muted); transition: all .15s; }
.seg-opt input:checked + span { background: #fff; color: var(--blue-d); box-shadow: 0 4px 12px -6px rgba(15, 42, 61, .3); }
.seg-opt input:focus-visible + span, .year-opt input:focus-visible + span { outline: 2px solid var(--blue); }
.year-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.year-opt span { display: grid; gap: .15rem; text-align: center; padding: .75em .5em; border: 1.5px solid #d9e3ea; border-radius: 12px; cursor: pointer; font-weight: 600; font-size: .84rem; color: var(--ink); line-height: 1.35; transition: all .15s; height: 100%; }
.year-opt span b { font-family: "Inter", sans-serif; font-size: 1.05rem; color: var(--navy); }
.year-opt input:checked + span { border-color: var(--blue); background: #eef8fd; box-shadow: 0 0 0 3px rgba(47, 159, 212, .15); }
.pending-card { text-align: center; }
.pending-ic { width: 84px; height: 84px; margin: 0 auto 1rem; display: grid; place-items: center; border-radius: 50%; background: #fff7e8; color: var(--saffron); }
.pending-ic .ic { width: 42px; height: 42px; }
.pending-info { display: grid; gap: .5rem; background: var(--bg-soft); border-radius: 14px; padding: 1rem 1.2rem; margin: 1.2rem 0; text-align: start; }
.pending-info div { display: flex; justify-content: space-between; gap: 1rem; }
.pending-info span { color: var(--muted); }

/* ---------- Student area ---------- */
.student { background: var(--bg-soft); }
.student-header .header-row { justify-content: space-between; }
.student-chip { display: flex; align-items: center; gap: .65rem; }
.student-chip b { display: block; font-size: .95rem; color: var(--navy); line-height: 1.2; }
.student-chip small { color: var(--muted); font-size: .8rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 800; flex: none; }
.student-main { padding: 2rem 0 4rem; }
.welcome { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 2rem 2.2rem; border-radius: 22px; color: #fff;
  background: linear-gradient(120deg, var(--teal), var(--blue) 60%, #1f6f9e); box-shadow: var(--shadow); margin-bottom: 2.2rem; }
.welcome-pattern { position: absolute; inset: 0; background-image: var(--zellige); filter: brightness(10); opacity: .15; }
.welcome > div { position: relative; }
.welcome h1 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); margin: .5rem 0 .3rem; }
.welcome p { margin: 0; opacity: .9; }
.welcome-year { display: inline-flex; align-items: center; gap: .4rem; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3); padding: .25em .85em; border-radius: 99px; font-weight: 700; font-size: .88rem; }
.ring { position: relative; flex: none; width: 112px; height: 112px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: conic-gradient(var(--saffron) calc(var(--p) * 1%), rgba(255, 255, 255, .25) 0); }
.ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: #1f86b8; }
.ring b, .ring small { position: relative; }
.ring b { font-size: 1.6rem; font-family: "Inter", sans-serif; line-height: 1; }
.ring small { font-size: .75rem; opacity: .85; }
.block-title { font-size: 1.3rem; margin: 0 0 1rem; }
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.1rem; margin-bottom: 2.5rem; }
.subject-card { display: flex; flex-direction: column; gap: .55rem; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 1.4rem; text-decoration: none !important; color: inherit;
  position: relative; overflow: hidden; transition: transform .18s, box-shadow .18s; }
.subject-card::after { content: ""; position: absolute; inset-inline-end: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%; background: color-mix(in srgb, var(--c) 10%, transparent); }
.subject-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.subject-ic { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: var(--c); box-shadow: 0 8px 18px -8px var(--c); }
.subject-ic svg { width: 26px; height: 26px; }
.subject-ic.big { width: 72px; height: 72px; border-radius: 20px; }
.subject-ic.big svg { width: 36px; height: 36px; }
.subject-card h3 { font-size: 1.12rem; margin: .4rem 0 0; }
.subject-meta { display: flex; gap: .9rem; color: var(--muted); font-size: .85rem; font-weight: 600; }
.subject-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.bar { height: 7px; border-radius: 99px; background: #eef2f6; overflow: hidden; margin-top: .3rem; }
.bar i { display: block; height: 100%; background: var(--c, var(--blue)); border-radius: inherit; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; font-size: .9rem; font-weight: 600; color: var(--muted); margin-bottom: 1.2rem; }
.crumbs .ic { width: 14px; height: 14px; opacity: .6; }
.crumbs span { color: var(--navy); }
.subject-hero { display: flex; align-items: center; gap: 1.2rem; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 1.5rem 1.8rem; margin-bottom: 1.6rem;
  border-inline-start: 6px solid var(--c); }
.subject-hero h1 { margin: 0; font-size: 1.8rem; }
.subject-hero p { margin: 0; color: var(--muted); font-weight: 600; }
.lesson-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.lesson-row { display: flex; align-items: center; gap: 1rem; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.2rem; color: inherit; text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
.lesson-row:hover { border-color: var(--c, var(--blue)); box-shadow: 0 8px 24px -16px rgba(15, 42, 61, .4); }
.lesson-num, .lesson-dot { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-family: "Inter", sans-serif;
  background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); }
.lesson-dot svg { width: 22px; height: 22px; }
.lesson-row.is-seen .lesson-num { background: #dcfce7; color: var(--ok); }
.lesson-info { flex: 1; min-width: 0; display: grid; gap: .2rem; }
.lesson-info b { color: var(--navy); font-size: 1.02rem; }
.lesson-info small { color: var(--muted); }
.lesson-badges { display: flex; flex-wrap: wrap; gap: .8rem; color: var(--muted); font-size: .84rem; font-weight: 600; }
.lesson-badges span { display: inline-flex; align-items: center; gap: .3rem; }
.lesson-go { color: #b6c3cf; }
.lesson-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.6rem; align-items: start; }
.lesson-layout:not(:has(.playlist)) { grid-template-columns: 1fr; max-width: 980px; }
.lesson-title { font-size: clamp(1.5rem, 3vw, 2rem); }
.player { background: #000; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 16 / 9; }
.player video { width: 100%; height: 100%; display: block; }
.now-playing { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-weight: 600; margin: .8rem 0 1.2rem; }
.lesson-desc { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.2rem 1.4rem; margin-bottom: 1.4rem; }
.files-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.files-box { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.2rem; }
.files-box h2 { font-size: 1.05rem; display: flex; align-items: center; gap: .45rem; }
.file-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.file-ic { width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center; flex: none; }
.file-ic.pdf { background: #fdecec; color: #dc2626; }
.file-ic.exercise { background: #fff4e0; color: #c47b12; }
.file-ic.video { background: #e8f4fb; color: var(--blue-d); }
.file-info { flex: 1; min-width: 0; display: grid; }
.file-info b { font-size: .95rem; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info small { color: var(--muted); }
.playlist { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 1rem; position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow: auto; }
.playlist h2 { font-size: 1rem; display: flex; align-items: center; gap: .4rem; padding: .3rem .4rem .7rem; }
.pl-item { display: flex; align-items: center; gap: .7rem; padding: .65rem; border-radius: 12px; color: var(--ink); font-weight: 600; font-size: .92rem; text-decoration: none !important; }
.pl-item:hover { background: var(--bg-soft); }
.pl-item.active { background: #e8f4fb; color: var(--blue-d); }
.pl-n { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-soft); font-family: "Inter", sans-serif; font-size: .85rem; flex: none; }
.pl-item.active .pl-n { background: var(--grad); color: #fff; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; background: #fff; border: 1px dashed #cfdbe5; border-radius: 18px; }
.empty .ic { width: 40px; height: 40px; color: #b6c3cf; margin: 0 auto .8rem; }
.empty.sm { padding: 1.6rem 1rem; }
.empty p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .hero-grid, .center-grid { grid-template-columns: 1fr; }
  .hero-visual { height: 440px; max-width: 560px; margin-inline: auto; width: 100%; }
  .lesson-layout { grid-template-columns: 1fr; }
  .playlist { position: static; max-height: none; }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-grid; }
  .main-nav { position: absolute; top: 100%; inset-inline: 0; background: #fff; flex-direction: column; gap: 0; padding: .5rem 16px 1rem; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); display: none; }
  .main-nav.open { display: flex; }
  .main-nav a { padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .header-actions { margin-inline-start: auto; }
  .programs, .steps { grid-template-columns: 1fr; }
  .steps { gap: 2.6rem; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .hide-sm { display: none !important; }
  .brand-sub { display: none; }
  .brand-mark { height: 36px; }
  .header-row { gap: .6rem; min-height: 66px; }
  .header-actions .btn { padding: .55em .8em; font-size: .88rem; }
  .features { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .subject-list { grid-template-columns: 1fr; }
  .hero-visual { height: 360px; }
  .arch-2 { inset-inline-start: 3%; } .arch-3 { inset-inline-end: 3%; }
  .float-card { padding: .5rem .7rem; }
  .float-card small { display: none; }
  .hero-stats b { font-size: 1.6rem; }
  .program-cover, .program-body { padding-inline: 1.3rem; }
  .program-big { font-size: 6.5rem; }
  .welcome { flex-direction: column; align-items: flex-start; padding: 1.5rem; }
  .ring { width: 92px; height: 92px; }
  .year-grid { grid-template-columns: 1fr 1fr 1fr; }
  .year-opt span { font-size: .76rem; }
  .gallery { grid-auto-rows: 90px; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta { flex-direction: column; align-items: flex-start; }
  .student-main { padding-top: 1.2rem; }
  .file-row .btn-soft { padding: .42em .6em; }
}

/* ==========================================================
   Photos & motion
   ========================================================== */
/* Headline: gradient text was clipped at the line box (Arabic descenders/shadda) */
.hero h1 { line-height: 1.3; }
.hero h1 .hl { display: inline-block; padding: .06em .04em .22em; margin-bottom: -.16em; line-height: 1.35; }

/* Hero text entrance */
.js .hero-anim > * { opacity: 0; transform: translateY(22px); animation: rise .8s cubic-bezier(.2, .7, .2, 1) forwards; }
.js .hero-anim > :nth-child(1) { animation-delay: .05s; }
.js .hero-anim > :nth-child(2) { animation-delay: .18s; }
.js .hero-anim > :nth-child(3) { animation-delay: .32s; }
.js .hero-anim > :nth-child(4) { animation-delay: .46s; }
.js .hero-anim > :nth-child(5) { animation-delay: .6s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* Arches: photos, entrance, gentle float */
.arch { background: linear-gradient(160deg, var(--teal), var(--blue) 70%, var(--navy)); }
.arch::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(15, 42, 61, .28), transparent 45%); }
.arch-2 { transform: none; rotate: -4deg; }
.arch-3 { transform: none; rotate: 4deg; background: linear-gradient(160deg, var(--saffron), var(--terra)); }
.js .hero-visual .arch { opacity: 0; animation: archIn 1s cubic-bezier(.2, .7, .2, 1) forwards, floatY 7s ease-in-out 1.2s infinite; }
.js .hero-visual .arch-1 { animation-delay: .25s, 1.3s; }
.js .hero-visual .arch-2 { animation-delay: .45s, 2.2s; animation-duration: 1s, 8s; }
.js .hero-visual .arch-3 { animation-delay: .6s, 1.7s; animation-duration: 1s, 7.5s; }
@keyframes archIn { from { opacity: 0; translate: 0 50px; scale: .94; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes floatY { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }

/* Main arch slideshow (cross-fade + slow zoom) */
.slideshow img.slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.4s ease; }
.slideshow img.slide:first-of-type, .slideshow img.slide.active { opacity: 1; }
.js .slideshow img.slide:first-of-type:not(.active) { opacity: 0; }
.js .slideshow:not(.ready) img.slide:first-of-type { opacity: 1; }
.slideshow img.slide.active { animation: kenburns 9s ease-out forwards; }
.arch-2 img, .arch-3 img { animation: kenburns 14s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.12); } }

/* Floating cards bob */
.js .float-card { opacity: 0; animation: popIn .6s cubic-bezier(.2, .9, .3, 1.3) forwards, bob 5s ease-in-out infinite; }
.js .fc-1 { animation-delay: 1s, 1.6s; }
.js .fc-2 { animation-delay: 1.2s, 2.4s; }
.js .fc-3 { animation-delay: 1.4s, 3s; }
.fc-3 { top: 46%; inset-inline-start: -2%; }
.fc-3 > .ic { background: linear-gradient(135deg, #e5484d, var(--terra)); }
@keyframes popIn { from { opacity: 0; scale: .7; } to { opacity: 1; scale: 1; } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }

/* Decorative stars spin slowly */
.star-deco { animation: spin 24s linear infinite; }
.star-deco.s2 { width: 46px; height: 46px; bottom: auto; top: -2%; inset-inline-end: auto; inset-inline-start: 18%; background: var(--teal); opacity: .75; animation-duration: 18s; animation-direction: reverse; }
@keyframes spin { to { rotate: 360deg; } }

/* Zellige background drifts */
.hero-bg::after { animation: drift 60s linear infinite; }
@keyframes drift { to { background-position: 560px 560px; } }

/* Program cover photos under the brand gradient */
.program-photo { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s ease; }
.program-cover::before { content: ""; position: absolute; inset: 0; z-index: 1; }
.program-college .program-cover::before { background: linear-gradient(135deg, rgba(76, 181, 174, .93), rgba(43, 143, 184, .82) 60%, rgba(43, 143, 184, .55)); }
.program-lycee .program-cover::before { background: linear-gradient(135deg, rgba(31, 111, 158, .93), rgba(15, 42, 61, .85) 60%, rgba(15, 42, 61, .6)); }
.program-pattern { z-index: 2; }
.program-tag, .program-cover h3, .program-cover p, .program-big { z-index: 3; }
.program-cover { min-height: 230px; }
.program:hover .program-photo { transform: scale(1.07); }

/* Gallery photos */
.gallery figure { position: relative; }
.gallery figure img { transition: transform .9s ease; }
.gallery figure:hover img { transform: scale(1.06); }
.gallery figure.g-missing { background: linear-gradient(160deg, var(--teal), var(--blue)); }
.gallery figure.g-missing:nth-child(even) { background: linear-gradient(160deg, var(--saffron), var(--terra)); }

/* CTA with photo */
.cta-photo { z-index: 0; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .22; mix-blend-mode: luminosity; }

/* Auth side photo */
.auth-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth-side::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(76, 181, 174, .88), rgba(47, 159, 212, .82) 55%, rgba(15, 42, 61, .92)); }
.auth-side::before { z-index: 1; }
.auth-side-inner { z-index: 2; }

/* Scroll reveal */
.js [data-reveal] { opacity: 0; transform: translateY(34px); transition: opacity .8s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms), transform .8s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms); }
.js [data-reveal].in { opacity: 1; transform: none; }
.step:hover .step-n { animation: spin 1.2s ease; }
.feature { transition: transform .25s, box-shadow .25s; }
.feature:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.feature:hover .feature-ic { animation: wiggle .6s ease; }
@keyframes wiggle { 30% { rotate: -10deg; } 60% { rotate: 8deg; } }
.btn-primary { background-size: 160% 100%; transition: background-position .4s, transform .15s, box-shadow .15s; }
.btn-primary:hover { background-position: 100% 0; }

@media (max-width: 600px) {
  .fc-3 { display: none; }
  .star-deco.s2 { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .hero-anim > *, .js .hero-visual .arch, .js .float-card, .js [data-reveal] { opacity: 1 !important; transform: none !important; translate: none !important; }
}
