/* ============================================================
   LANGO Online — style.css
   Indigo #4338FF primary · Navy #0F1033 · Coral #FF5A5F (join)
   Sunny #FFC72C · Turquoise #18D6C1 · BG #F7F6FF · white cards
   Alexandria (headings) · Cairo (body) · Tajawal (buttons/small)
   Thin navy borders + solid offset shadows (no blur) on key UI.
   ============================================================ */
:root {
  --indigo: #4338FF;
  --navy: #0F1033;
  --coral: #FF5A5F;
  --yellow: #FFC72C;
  --turquoise: #18D6C1;
  --bg: #F7F6FF;
  --card: #FFFFFF;
  --text: #1c1c2e;
  --muted: #6b6b85;
  --border: #0F1033;
  --green: #00B87C;
  --sky: #22B8F0;
  --radius: 16px;
  --shadow: 4px 4px 0 var(--navy);
  --shadow-sm: 3px 3px 0 var(--navy);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Cairo', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}
h1, h2, h3, .logo, .year-name, .section-title { font-family: 'Alexandria', 'Cairo', sans-serif; }
button, .btn, input, select, textarea, small, .muted { font-family: 'Tajawal', 'Cairo', sans-serif; }
a { color: var(--indigo); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 620px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

/* ---------- Header ---------- */
.site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 18px; padding: 12px 16px; flex-wrap: wrap; }
.logo { font-size: 1.5rem; font-weight: 800; color: #fff; text-decoration: none; letter-spacing: .5px; }
.logo span { color: var(--yellow); }
.main-nav { display: flex; align-items: center; gap: 14px; margin-inline-start: auto; flex-wrap: wrap; }
.main-nav a { color: #fff; text-decoration: none; font-weight: 600; }
.main-nav a.active { color: var(--yellow); text-decoration: underline; }
.hello { color: var(--turquoise); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 10px 22px; border-radius: 12px;
  border: 2px solid var(--navy); background: #fff; color: var(--navy);
  font-weight: 800; font-size: 1rem; text-decoration: none; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--navy); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--navy); }
.btn-coral { background: var(--coral); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-red { background: var(--coral); color: #fff; }
.btn-outline { background: #fff; }
.btn-small { padding: 6px 14px; font-size: .9rem; }
.btn-block { width: 100%; text-align: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Cards / sections ---------- */
.card {
  background: var(--card); border: 2px solid var(--navy); border-radius: var(--radius);
  padding: 24px; margin: 20px 0; box-shadow: var(--shadow);
}
.card.soft { box-shadow: none; background: #fffbe6; }
.section { padding: 28px 0 8px; }
.section-title { font-size: 1.5rem; margin: 0 0 16px; }
.hero { background: linear-gradient(135deg, var(--indigo), #6d5bff 55%, var(--turquoise)); color: #fff; padding: 56px 0 48px; border-bottom: 3px solid var(--navy); }
.hero h1 { font-size: 3rem; margin: 0; line-height: 1.2; }
.hero-kicker { font-weight: 700; color: var(--yellow); margin: 0; }
.hero-tag { font-size: 1.4rem; font-weight: 800; margin: 6px 0; }
.hero-sub { max-width: 640px; opacity: .95; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* ---------- Year cards ---------- */
.year-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.year-card {
  display: block; text-decoration: none; color: var(--navy);
  background: #fff; border: 2px solid var(--navy); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); border-top: 10px solid var(--year-color);
}
.year-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--navy); }
.year-num { font-family: 'Alexandria', sans-serif; font-size: 2.6rem; font-weight: 800; color: var(--year-color); line-height: 1; }
.year-name { display: block; font-size: 1.3rem; font-weight: 800; margin-top: 6px; }
.year-sub { display: block; color: var(--muted); font-size: .9rem; }
.year-cta { display: inline-block; margin-top: 12px; font-weight: 800; color: var(--indigo); }

/* ---------- Lessons ---------- */
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.lesson-card {
  background: #fff; border: 2px solid var(--navy); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm); border-top: 8px solid var(--year-color);
  display: flex; flex-direction: column; gap: 8px;
}
.lesson-card.locked { opacity: .85; background: #f2f1fa; }
.lesson-card h3 { margin: 0; }
.lesson-card p { margin: 0; color: var(--muted); font-size: .95rem; flex: 1; }
.lesson-year, .lesson-chapter { font-weight: 700; font-size: .85rem; color: var(--indigo); }
.badge-free { display: inline-block; background: var(--yellow); border: 2px solid var(--navy); border-radius: 999px; padding: 2px 12px; font-weight: 800; font-size: .8rem; width: fit-content; }
.badge-lock { display: inline-block; background: #eee; border: 2px solid var(--navy); border-radius: 999px; padding: 2px 12px; font-weight: 700; font-size: .8rem; width: fit-content; }
.badge-watched { display: inline-block; background: var(--turquoise); color: #fff; border: 2px solid var(--navy); border-radius: 999px; padding: 2px 12px; font-weight: 800; font-size: .8rem; width: fit-content; }
.video-wrap { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border: 2px solid var(--navy); border-radius: 12px; margin: 16px 0; background: #000; }
.video-wrap iframe { position: absolute; top: 0; right: 0; width: 100%; height: 100%; border: 0; }
.lesson-summary { font-size: 1.05rem; }
.big-lock { font-size: 3rem; }
.locked-page { text-align: center; }

/* ---------- Steps ---------- */
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.steps li { background: #fff; border: 2px solid var(--navy); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }

/* ---------- Forms ---------- */
label { display: block; font-weight: 700; margin: 14px 0 4px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
input[type=text], input[type=tel], input[type=url], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 11px 12px; border: 2px solid var(--navy); border-radius: 10px;
  font-size: 1rem; background: #fff; color: var(--text); margin-top: 4px;
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--turquoise); outline-offset: 1px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--indigo); }
label small { display: block; font-weight: 400; color: var(--muted); margin-top: 4px; }
.resend-form { margin-top: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Flash / demo banner ---------- */
.flash { border: 2px solid var(--navy); border-radius: 12px; padding: 12px 16px; margin: 16px 0; font-weight: 700; box-shadow: var(--shadow-sm); }
.flash-success { background: #d9f7ec; }
.flash-error { background: #ffe1e2; }
.demo-banner { background: var(--yellow); border: 2px dashed var(--navy); border-radius: 12px; padding: 16px; margin: 16px 0; text-align: center; }
.demo-code { font-size: 2rem; font-weight: 800; letter-spacing: 6px; direction: ltr; display: inline-block; background: #fff; border: 2px solid var(--navy); border-radius: 10px; padding: 4px 18px; margin: 6px 0; }

/* ---------- Status card ---------- */
.status-card { border-top: 10px solid var(--yellow); }
.status-ok { border-top-color: var(--green); }
.status-bad { border-top-color: var(--coral); }
.status-wait { border-top-color: var(--yellow); }
.status-line { font-size: 1.15rem; font-weight: 800; }

/* ---------- Quiz ---------- */
.quiz-cta { background: linear-gradient(135deg, #fff, #fff7d6); }
.options { display: grid; gap: 8px; margin-top: 10px; }
.option { display: flex; align-items: center; gap: 10px; border: 2px solid var(--navy); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-weight: 600; margin: 0; background: #fff; }
.option input { width: auto; }
.option.correct { background: #d9f7ec; border-color: var(--green); }
.option.wrong { background: #ffe1e2; border-color: var(--coral); }
.opt-letter { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border: 2px solid var(--navy); border-radius: 50%; font-weight: 800; background: var(--yellow); flex-shrink: 0; }
.quiz-num { color: var(--indigo); font-weight: 800; margin: 0; }
.explanation { background: #eef2ff; border-radius: 10px; padding: 10px 12px; }
.result-card { text-align: center; border-top: 10px solid var(--turquoise); }

/* ---------- Lesson view / quiz ---------- */
.lesson-view { border-top: 10px solid var(--year-color, var(--indigo)); }
.lesson-view h1 { margin: 8px 0; }
.quiz-form { display: grid; gap: 16px; }
.quiz-form .card { margin: 0; }
.quiz-q { display: grid; gap: 8px; }
.quiz-q h3 { margin: 0; }

/* ---------- How-it-works (home) ---------- */
.how { background: #fff; border: 2px solid var(--navy); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin: 28px auto; }
.how .section-title { margin-top: 0; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 48px; padding: 24px 0; background: var(--navy); color: #fff; text-align: center; }

/* ---------- Splash ---------- */
.splash {
  position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(160deg, var(--indigo), #7c5cff 45%, var(--turquoise));
  color: #fff; overflow: hidden;
  transition: opacity .4s ease, visibility .4s ease;
}
.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-logo { font-family: 'Alexandria', sans-serif; font-size: clamp(2.4rem, 8vw, 4rem); font-weight: 800; animation: bounce 1.1s ease infinite; z-index: 2; }
.splash-logo span { color: var(--yellow); }
.splash-tag { font-size: 1.2rem; font-weight: 700; z-index: 2; margin: 0; }
@keyframes bounce { 0%, 100% { transform: translateY(0) scale(1); } 30% { transform: translateY(-14px) scale(1.03); } 55% { transform: translateY(0) scale(.98); } }
.bubble { position: absolute; bottom: -60px; border-radius: 50%; opacity: .55; animation: rise 3s ease-in infinite; }
.bubble.b1 { width: 46px; height: 46px; background: var(--yellow); right: 12%; animation-delay: 0s; }
.bubble.b2 { width: 26px; height: 26px; background: var(--coral); right: 28%; animation-delay: .5s; }
.bubble.b3 { width: 60px; height: 60px; background: var(--turquoise); right: 55%; animation-delay: .2s; }
.bubble.b4 { width: 20px; height: 20px; background: #fff; right: 70%; animation-delay: .8s; }
.bubble.b5 { width: 36px; height: 36px; background: var(--yellow); right: 85%; animation-delay: .35s; }
.bubble.b6 { width: 52px; height: 52px; background: var(--coral); right: 42%; animation-delay: 1s; }
@keyframes rise { from { transform: translateY(0); } to { transform: translateY(-110vh); } }
.confetti { position: absolute; font-size: 1.4rem; animation: fall 2.4s linear infinite; }
.confetti.c1 { right: 18%; top: -30px; color: var(--yellow); }
.confetti.c2 { right: 38%; top: -30px; color: #fff; animation-delay: .6s; }
.confetti.c3 { right: 58%; top: -30px; color: var(--yellow); animation-delay: 1.1s; }
.confetti.c4 { right: 76%; top: -30px; color: #fff; animation-delay: .3s; }
.confetti.c5 { right: 90%; top: -30px; color: var(--yellow); animation-delay: .9s; }
@keyframes fall { from { transform: translateY(0) rotate(0deg); } to { transform: translateY(105vh) rotate(340deg); } }

/* ---------- Admin (calmer) ---------- */
body.admin { background: #f4f4f8; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-side { width: 250px; flex-shrink: 0; background: var(--navy); color: #fff; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .logo { font-size: 1.3rem; }
.admin-sub { color: var(--turquoise); margin: 4px 0 18px; font-weight: 700; }
.admin-nav { display: flex; flex-direction: column; gap: 8px; }
.admin-nav-btn { display: block; padding: 12px 14px; border-radius: 10px; color: #fff; text-decoration: none; font-weight: 700; background: rgba(255,255,255,.08); border: 2px solid transparent; }
.admin-nav-btn:hover { background: rgba(255,255,255,.18); border-color: var(--yellow); }
.admin-nav-btn.danger { background: rgba(255,90,95,.2); }
.admin-main { flex: 1; padding: 24px 0 48px; min-width: 0; }
.admin-title { font-size: 1.7rem; margin: 0 0 16px; }
.admin-login { max-width: 460px; margin: 60px auto; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 18px 0; }
.stat { background: #fff; border: 2px solid var(--navy); border-radius: var(--radius); padding: 16px; text-align: center; box-shadow: var(--shadow-sm); }
.stat-num { display: block; font-family: 'Alexandria', sans-serif; font-size: 2rem; font-weight: 800; color: var(--indigo); }
.stat-label { font-weight: 700; color: var(--muted); }
.admin-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 8px; }
.section-big { display: block; background: #fff; border: 2px solid var(--navy); border-radius: var(--radius); padding: 22px; text-decoration: none; color: var(--navy); font-size: 1.25rem; font-weight: 800; box-shadow: var(--shadow-sm); }
.section-big small { display: block; font-size: .9rem; font-weight: 400; color: var(--muted); margin-top: 6px; }
.section-big:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--navy); }
.pill { background: var(--coral); color: #fff; border-radius: 999px; padding: 1px 10px; font-size: .85rem; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0; }
.filter-bar select, .filter-bar input { width: auto; flex: 1; min-width: 160px; }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 2px solid var(--navy); border-radius: 12px; overflow: hidden; margin: 12px 0; font-size: .95rem; }
.table th, .table td { border-bottom: 1px solid #ddd; padding: 10px 12px; text-align: right; vertical-align: middle; }
.table th { background: var(--navy); color: #fff; }
.table tr:hover td { background: #f7f6ff; }
.inline-form { display: inline; }
.actions-cell { white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .hero h1 { font-size: 2.1rem; }
  .admin-shell { flex-direction: column; }
  .admin-side { width: 100%; height: auto; position: static; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-nav-btn { flex: 1 1 45%; }
  .table { display: block; overflow-x: auto; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .splash { display: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
