/* KS DEV — دورة الفايب كودينج — Tunnel de vente
   Palette alignée sur https://ksdevtech.com/p/ : fond sombre, accent violet/cyan */

/* Tajawal, self-hosted.
   This file used to open with @import url(fonts.googleapis.com/...), which the
   browser could not discover until style.css itself had downloaded and parsed —
   a serialised three-hop chain (HTML -> style.css -> Google CSS -> woff2) with
   every hop paying a full mobile round trip before the next could start, and no
   preconnect for fonts.gstatic.com where the files actually live. Self-hosting
   removes two of the three hops: the fonts are now same-origin, already
   connected, and discovered as soon as this file is parsed.

   unicode-range is kept from Google's own CSS so the browser still downloads
   only the subsets a page actually renders — an all-Arabic screen never fetches
   the latin files. Weight 600 appears twice in this stylesheet (.price-old,
   .trust-item); Tajawal ships no 600, so it resolves to 700 exactly as it did
   before. */

@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/tajawal-400-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/tajawal-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/tajawal-500-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/tajawal-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/tajawal-700-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/tajawal-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/tajawal-800-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/tajawal-800-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #080812;
  --bg2: #0d0d1e;
  --card: #10101f;
  --card2: #14142a;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(124,58,237,0.35);
  --accent: #7c3aed;
  --accent-dark: #6d28d9;
  --accent2: #a855f7;
  --accent3: #06b6d4;
  --text: #f1f5f9;
  --text2: #94a3b8;
  --text3: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-card: 0 4px 18px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 8px 28px rgba(124, 58, 237, 0.28);
  --transition-fast: 200ms ease;
  --transition-slide: 380ms cubic-bezier(.22, .68, 0, 1.01);
}

/* Admin dashboard only — a neutral, lower-glare dark palette for eye comfort
   during long sessions: a warm-neutral slate instead of the public funnel's
   saturated violet-black, and softened (not pure-white) text to cut contrast
   harshness. The public funnel (plain <body>, no .admin-body class) keeps the
   :root values untouched, since it must match the live ad creative exactly.
   Everything below reads these same var() names, so re-declaring them here
   is enough — no rule duplication needed. */
body.admin-body {
  --bg: #15171c;
  --bg2: #1b1e24;
  --card: #1f2229;
  --card2: #262a33;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(124,58,237,0.28);
  --text: #e6e8eb;
  --text2: #9aa1ab;
  --text3: #6c7280;
}

* { box-sizing: border-box; }

html {
  height: 100%;
  /* On mobile, overflow-x:hidden on body alone doesn't stop the layout
     viewport from expanding when something overflows horizontally — the
     guard must be on html too, or the browser zooms the page out. */
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  color: var(--text);
  /* direction is inherited from the <html dir> attribute so the admin
     dashboard can switch to LTR; the public tunnel always sets dir="rtl". */
  overflow-x: hidden;
  position: relative;
}

img { max-width: 100%; display: block; }

button { font-family: inherit; }

/* ---------- Floating bubbles background ---------- */
.bubbles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bubbles span {
  position: absolute;
  bottom: -60px;
  display: block;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(168,85,247,0.35), rgba(124,58,237,0.05));
  opacity: 0.6;
  animation: rise linear infinite;
}

@keyframes rise {
  from { transform: translateY(0) translateX(0); opacity: 0.6; }
  to   { transform: translateY(-115vh) translateX(20px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bubbles { display: none; }
}

/* ---------- Progress bar ---------- */
.progress-wrap {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(8, 8, 18, 0.85);
  backdrop-filter: blur(6px);
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.online-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 auto;
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  color: #062a30;
  background: linear-gradient(90deg, var(--accent3), #22d3ee);
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.4);
  /* Was white-space: nowrap, which suited the old short label. The current
     copy is a full sentence and simply ran off the right edge of a phone —
     invisible on desktop, clipped for the 96% of visitors on mobile. Wrap and
     centre instead, bounded so it never touches the screen edge. */
  max-width: 100%;
  text-align: center;
  line-height: 1.35;
}

.badges-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.badges-row .online-badge { margin: 0; }

.telegram-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(90deg, #229ED9, #2AABEE);
  box-shadow: 0 2px 10px rgba(34, 158, 217, 0.45);
  white-space: nowrap;
  animation: telegram-pulse 2.4s ease-in-out infinite;
  transition: transform var(--transition-fast);
}
.telegram-badge:active { transform: scale(0.96); }
@keyframes telegram-pulse {
  0%, 100% { box-shadow: 0 2px 10px rgba(34, 158, 217, 0.45); }
  50% { box-shadow: 0 2px 20px rgba(34, 158, 217, 0.85); }
}
@media (prefers-reduced-motion: reduce) {
  .telegram-badge { animation: none; }
}

.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1.5px solid var(--border);
  background: var(--card2);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 999px;
  flex-shrink: 0;
  /* Fixed, and matched to .progress-pct's width below — when hidden (welcome
     screen) this still reserves its footprint via visibility:hidden, not
     display:none, so the bottle-progress bar in between stays visually
     centered on every screen instead of drifting toward whichever side has
     less content. */
  width: 80px;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.back-btn .arrow { font-size: 17px; }
.back-btn:hover { border-color: var(--accent2); background: var(--card); }
.back-btn[hidden] { visibility: hidden; }

.bottle-progress {
  flex: 1;
  height: 14px;
  border-radius: 999px;
  background: var(--card);
  border: 2px solid var(--accent);
  overflow: hidden;
  position: relative;
}

.bottle-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent), var(--accent3));
  transition: width var(--transition-slide);
  position: relative;
}

.bottle-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.9) 1.5px, transparent 1.6px);
  background-size: 10px 10px;
  animation: bubble-scroll 1.2s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .bottle-progress-fill::after { animation: none; }
}

@keyframes bubble-scroll {
  from { background-position: 0 0; }
  to { background-position: -20px 0; }
}

.progress-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent2);
  width: 80px;
  text-align: center;
}

/* ---------- Screens ---------- */
.tunnel {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  /* flex-start, not center: when a screen's content is taller than the
     viewport (long question + textarea + two buttons on small phones),
     centering pushes an empty gap above the content instead of starting
     at the top — making the screen look blank until the user scrolls. */
  justify-content: flex-start;
  align-items: stretch;
  padding: 114px 20px 20px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.screen.active {
  display: flex;
  animation: slide-in var(--transition-slide);
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .screen.active { animation: none; }
}

.eyebrow {
  color: var(--accent3);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
}

.question-title {
  font-weight: 800;
  font-size: clamp(20px, 5.5vw, 32px);
  line-height: 1.3;
  color: var(--text);
  margin: 0 0 12px;
}

.question-sub {
  font-size: 14px;
  color: var(--text2);
  margin: -6px 0 14px;
}

/* ---------- Radio cards ---------- */
.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 14px 18px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 120ms ease, box-shadow var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
  text-align: right;
  width: 100%;
}

.option-card:hover {
  border-color: var(--accent2);
  box-shadow: var(--shadow-card-hover);
}

.option-card:active,
.option-card.selecting {
  transform: scale(0.97);
  border-color: var(--accent);
  background: var(--card2);
}

.option-card .check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  position: relative;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.option-card.selecting .check,
.option-card.selected .check {
  border-color: var(--accent);
  background: var(--accent);
}

.option-card.selecting .check::after,
.option-card.selected .check::after {
  content: '';
  position: absolute;
  right: 7px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.option-card .badge-bonus {
  font-size: 11px;
  color: var(--accent3);
  font-weight: 700;
}

/* ---------- Value / curriculum list ---------- */
.value-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.value-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.5;
  box-shadow: var(--shadow-card);
}

.value-list li::before {
  content: '✔';
  color: var(--accent3);
  font-weight: 800;
  flex-shrink: 0;
}

.positioning-line {
  font-weight: 700;
  color: var(--text);
  background: var(--card2);
  border: 1px dashed var(--accent2);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 16px;
}

/* ---------- Price box ---------- */
.price-box {
  background: var(--card);
  border: 2px solid var(--accent2);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}

.price-old {
  font-size: 19px;
  font-weight: 600;
  color: var(--text2);
  text-decoration: line-through;
  text-decoration-color: var(--danger);
  text-decoration-thickness: 2.5px;
  display: inline-block;
  margin-bottom: 2px;
}

.price-new {
  font-size: clamp(28px, 8vw, 40px);
  font-weight: 800;
  color: var(--text);
}

.price-new .cur {
  font-size: 16px;
  font-weight: 700;
  margin-inline-start: 4px;
}

.price-save-badge {
  display: inline-block;
  margin-top: 6px;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 12px;
}

.usdt-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text2);
  font-weight: 700;
  font-size: 14px;
}
.usdt-badge .usdt-icon { font-size: 16px; }

.course-name-glow {
  font-size: clamp(22px, 7vw, 30px);
  font-weight: 800;
  color: #fff;
  margin: 6px 0 18px;
  text-shadow: 0 0 14px rgba(168, 85, 247, 0.75), 0 0 32px rgba(6, 182, 212, 0.5);
}

/* ---------- Payment method selector ---------- */
.trust-box {
  display: flex;
  gap: 10px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  margin: 16px 0;
}
.trust-item {
  flex: 1;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text2);
  line-height: 1.6;
}
.trust-item .trust-icon {
  font-size: 22px;
  display: block;
  margin-bottom: 4px;
}

/* Per-method reassurance text inside a .pm-panel — separate from the trust
   badges above the method list, which are generic; this is specific to the
   method the visitor just selected (why THIS one is safe), shown right where
   the doubt would actually surface. */
.pm-trust-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--text2);
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-top: 10px;
}
.pm-trust-note .trust-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.pm-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 4px;
}
.pm-item {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}
.pm-item:has(.pm-selected) {
  border-color: var(--accent2);
}

.pm-item.pm-featured {
  border: 2.5px solid var(--accent2);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.32), rgba(6, 182, 212, 0.18));
  animation: pm-featured-glow 1.8s ease-in-out infinite;
}
.pm-item.pm-featured .pm-option { background: transparent; }

@keyframes pm-featured-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(168, 85, 247, 0.35); border-color: var(--accent2); transform: scale(1); }
  50% { box-shadow: 0 0 30px rgba(168, 85, 247, 0.95), 0 0 55px rgba(6, 182, 212, 0.45); border-color: var(--accent3); transform: scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .pm-item.pm-featured { animation: none; box-shadow: 0 0 18px rgba(168, 85, 247, 0.55); }
}
.pm-option {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card2);
  padding: 13px 14px;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.pm-option.pm-selected {
  background: var(--card);
}
.pm-option input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent2);
  flex-shrink: 0;
}
.pm-option .pm-icon {
  font-size: 20px;
  width: 26px;
  text-align: center;
  flex-shrink: 0;
}
.pm-option .pm-icon img { width: 22px; height: 22px; margin: 0 auto; border-radius: 6px; }
.pm-option .pm-label {
  flex: 1;
  font-weight: 700;
  font-size: 14.5px;
}
.pm-option .pm-badge {
  background: var(--success);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.pm-panel {
  display: none;
  padding: 4px 14px 16px;
  background: var(--card);
}
.pm-panel.pm-panel-active { display: block; }

.info-box {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text2);
  margin-bottom: 16px;
}

.payment-details {
  background: var(--card2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 12px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.9;
  color: var(--text);
  text-align: center;
  letter-spacing: 0.3px;
  direction: ltr;
}

/* ---------- Text inputs ---------- */
.field {
  margin-bottom: 12px;
}

.text-input,
.select-input,
textarea.text-input {
  width: 100%;
  font-family: inherit;
  font-size: 18px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition-fast);
}

.text-input:focus,
.select-input:focus,
textarea.text-input:focus {
  border-color: var(--accent);
}

textarea.text-input {
  min-height: 88px;
  resize: vertical;
}

.error-text {
  color: var(--danger);
  font-size: 13px;
  min-height: 0;
}

.error-text:not(:empty) {
  margin-top: 8px;
}

.hint-text {
  color: var(--text3);
  font-size: 12px;
  margin-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 28px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  /* Several .btn elements are anchors (the payment and WhatsApp actions on the
     thanks screen), which the browser underlines by default — they read as
     links rather than buttons. The <button> ones were never affected, which is
     why this went unnoticed. */
  text-decoration: none;
  transition: transform 120ms ease, box-shadow var(--transition-fast), background var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  color: #fff;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
  width: 100%;
}

.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-gold {
  background: linear-gradient(90deg, var(--accent3), #22d3ee);
  color: #062a30;
}

.btn-whatsapp {
  background: #25D366;
  color: #fff;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
  width: 100%;
}
.btn-whatsapp:hover { transform: translateY(-1px); }

/* ---------- Searchable select (wilaya) ---------- */
.wilaya-search {
  position: relative;
}
.wilaya-list {
  margin-top: 10px;
  max-height: 46vh;
  overflow-y: auto;
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-card);
  border: 2px solid var(--border);
}
.wilaya-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  gap: 10px;
}
.wilaya-item:last-child { border-bottom: none; }
.wilaya-item:hover { background: var(--card2); }
.wilaya-item .code { color: var(--accent3); font-weight: 700; min-width: 24px; }

/* ---------- Welcome screen ---------- */
.welcome-screen {
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: 64px;
}
.brand-header {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-header img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.brand-header-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}
.brand-header-text small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--text2);
}

.welcome-logo-wrap {
  position: relative;
  width: 132px;
  height: 132px;
  margin-bottom: 22px;
}
.welcome-logo-wrap::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #7c3aed, #06b6d4, #a855f7, #22d3ee, #7c3aed);
  filter: blur(14px);
  opacity: 0.75;
  animation: aurora-spin 6s linear infinite;
}
.welcome-logo-wrap::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #7c3aed, #06b6d4, #a855f7, #22d3ee, #7c3aed);
  animation: aurora-spin 6s linear infinite;
}
@keyframes aurora-spin {
  to { transform: rotate(360deg); }
}
.welcome-logo {
  position: relative;
  z-index: 1;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 10px 30px rgba(124,58,237,0.35);
  background: #fff;
  object-fit: cover;
  display: block;
}
.welcome-title {
  font-weight: 800;
  font-size: clamp(24px, 7vw, 34px);
  color: var(--text);
  margin: 0 0 10px;
}
.welcome-badge {
  display: inline-block;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.welcome-sub {
  font-size: 17px;
  color: var(--text2);
  max-width: 440px;
  margin: 0 auto 34px;
  line-height: 1.6;
}

/* ---------- Result screens (thanks) ---------- */
.result-screen {
  justify-content: center;
  align-items: center;
  text-align: center;
}
.result-icon {
  font-size: 52px;
  margin-bottom: 14px;
}
.result-title {
  font-weight: 800;
  font-size: clamp(22px, 6vw, 28px);
  color: var(--text);
  margin: 0 0 14px;
}
.result-text {
  font-size: 16px;
  color: var(--text2);
  line-height: 1.7;
  max-width: 460px;
  margin: 0 0 26px;
}

.result-video {
  position: relative;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 16 / 9;
  margin: 0 auto 22px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.result-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
  padding: 9px 20px;
  background: var(--card2);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  color: var(--text2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}
.link-btn:hover, .link-btn:active {
  border-color: var(--accent3);
  color: var(--accent3);
  background: var(--card);
}

.faq-videos {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 20px;
}
.faq-video-item { text-align: center; }
.faq-video-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  margin: 0 0 12px;
}
.faq-video-frame {
  position: relative;
  width: 100%;
  max-width: 260px;
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.faq-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Testimonial clips (self-hosted <video>, injected by tunnel.js on click):
   some are landscape rather than portrait. object-fit: contain letterboxes
   those inside the same 9/16 box instead of cropping the sides off (cover)
   or stretching them to fill it. */
.faq-video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  border: 0;
}

/* Click-to-play poster. The frame keeps its 9/16 box whether it holds a
   poster or a player, so swapping one for the other shifts nothing. */
.faq-video-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  display: block;
}

.faq-video-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 50%;
  background: rgba(10, 12, 30, 0.62);
  color: #fff;
  font-size: 20px;
  line-height: 54px;
  padding: 0;
  cursor: pointer;
  backdrop-filter: blur(2px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, background 0.15s ease;
}

.faq-video-play:hover,
.faq-video-play:focus-visible {
  background: rgba(10, 12, 30, 0.82);
  transform: scale(1.08);
}

@media (prefers-reduced-motion: reduce) {
  .faq-video-play { transition: none; }
  .faq-video-play:hover, .faq-video-play:focus-visible { transform: none; }
}

/* ---------- Testimonials (self-hosted clips, no YouTube poster available) --
   Same 9/16 .faq-video-frame box and .faq-video-play button as the FAQ videos
   above, so the two sections read as one family. There is no thumbnail image
   to show (no server-side ffmpeg to grab one), so the "poster" is a gradient
   card carrying the caption text itself instead of a picture. */
.testimonial-poster {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  text-align: center;
  background: linear-gradient(145deg, var(--accent-dark), var(--accent2));
  color: #fff;
}
.testimonial-poster-emoji { font-size: 34px; }
.testimonial-poster video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  background: #000;
}

.testimonial-audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 16px;
  border: 1px solid var(--accent2);
  border-radius: 999px;
  background: transparent;
  color: var(--accent2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.testimonial-audio-btn:hover,
.testimonial-audio-btn:focus-visible {
  background: var(--accent2);
  color: #fff;
}
.testimonial-audio-btn.is-playing {
  background: var(--accent2);
  color: #fff;
}

/* ---------- Confetti (thanks screen) ---------- */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  overflow: hidden;
}
.confetti span {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 14px;
  opacity: 0.9;
  animation: confetti-fall 2.6s ease-in forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(105vh) rotate(360deg); opacity: 0.2; }
}
@media (prefers-reduced-motion: reduce) {
  .confetti { display: none; }
}

/* ---------- Footer note ---------- */
.footer-note {
  text-align: center;
  font-size: 12px;
  color: var(--text3);
  padding: 16px;
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }

@media (min-width: 720px) {
  .option-card { font-size: 18px; }
}

/* Extra compaction on short viewports (small phones, or keyboard open) so
   the longest screens (comment, with textarea + two buttons) still fit
   without scrolling. */
@media (max-height: 700px) {
  .screen { padding-top: 96px; padding-bottom: 14px; }
  textarea.text-input { min-height: 64px; }
  .question-title { margin-bottom: 8px; }
}

/* =====================================================
   ADMIN DASHBOARD — mobile-first (staff are often on the road)
   ===================================================== */
.admin-body {
  background: var(--bg);
  padding-bottom: 40px;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  padding: 12px 16px;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.admin-header .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; }
.admin-header .brand img { width: 30px; height: 30px; border-radius: 50%; background: #fff; }
.lang-flags { display: flex; gap: 8px; align-items: center; }
.lang-flag { display: block; line-height: 0; opacity: 0.45; filter: grayscale(70%); transition: opacity 0.15s; border-radius: 3px; }
.lang-flag img { width: 28px; height: auto; border-radius: 3px; display: block; }
.lang-flag:hover { opacity: 0.85; }
.lang-flag.active { opacity: 1; filter: none; box-shadow: 0 0 0 2px #fff; }
.admin-header a.logout { color: #fff; opacity: 0.85; font-size: 13px; text-decoration: none; }

.admin-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}
.admin-container-wide {
  max-width: 1600px;
}

.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card-hover);
  padding: 32px 26px;
  max-width: 360px;
  width: 100%;
  text-align: center;
}
.login-card img { width: 70px; height: 70px; border-radius: 50%; margin: 0 auto 14px; background: #fff; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
@media (min-width: 640px) {
  .stat-row { grid-template-columns: repeat(5, 1fr); }
}
/* Variable-width variant. .stat-row above is a fixed 5-column grid, which only
   works for a row of exactly five tiles. The FAQ engagement row holds two
   totals plus one tile per video that has actually been played, so it renders
   anywhere from two to six — two tiles stretched across five columns is what
   broke this row. Flex with a capped basis keeps the tiles the same width as
   the fixed row above (≈240px at container width), so the two rows still line
   up, and any count wraps cleanly instead of leaving holes. */
.stat-row-auto {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.stat-row-auto .stat-tile {
  flex: 1 1 150px;
  max-width: 240px;
}

.stat-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  text-align: center;
}
.stat-tile .num { font-size: 24px; font-weight: 800; color: var(--accent2); }
.stat-tile .label { font-size: 12px; color: var(--text2); margin-top: 4px; }

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tab-link {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--card);
  color: var(--text2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid var(--border);
}
.tab-link.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}
.filters-bar select,
.filters-bar input {
  font-family: inherit;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--card2);
  color: var(--text);
  font-size: 13px;
  flex: 1 1 130px;
}
.filters-bar .btn { padding: 9px 16px; font-size: 13px; flex: 0 0 auto; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.badge-green { background: var(--success); }
.badge-orange { background: var(--warning); }
.badge-red { background: var(--danger); }
.badge-gray { background: var(--text3); }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.admin-table tbody tr { scroll-margin-top: 64px; }
.admin-table tbody tr.row-focus { animation: row-focus-flash 2.5s ease-out; }
@keyframes row-focus-flash {
  0% { background: rgba(212,175,55,0.35); }
  100% { background: transparent; }
}
.admin-table th {
  background: var(--card2);
  color: var(--text2);
  text-align: right;
  padding: 10px 12px;
  font-size: 12px;
}
.admin-table td {
  padding: 12px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
  color: var(--text);
}
.admin-table a.row-link { color: var(--accent2); font-weight: 700; text-decoration: none; }

.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.btn-wa { background: #25d366; color: #fff; }
.btn-call { background: var(--accent3); color: #062a30; }
.btn-sms { background: #6c7bff; color: #fff; }

/* Notification bell for the installable admin app. Injected into
   .admin-header by admin/pwa_head.php rather than written into each page's
   markup, so it appears only where the browser can actually do push. */
.pwa-bell {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 15px;
  line-height: 1.4;
  cursor: pointer;
}
.pwa-bell.is-on { border-color: rgba(124, 58, 237, 0.5); }
.pwa-bell:disabled { opacity: 0.5; cursor: wait; }
/* Desktop has no sms: handler — see the script at the foot of admin/order.php. */
.btn-sm.is-disabled { opacity: 0.45; cursor: not-allowed; }
.btn-outline { background: var(--card2); border: 1.5px solid var(--border); color: var(--text); }

@media (max-width: 720px) {
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr {
    margin-bottom: 12px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
  }
  .admin-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    text-align: left;
  }
  .admin-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text3);
    font-size: 11px;
    flex-shrink: 0;
  }
}

.detail-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}
.detail-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--text);
}
.answers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.answer-item { font-size: 13px; min-width: 0; }
.answer-item .k { color: var(--text3); display: block; font-size: 11px; }
.answer-item .v { font-weight: 700; color: var(--text); word-break: break-all; overflow-wrap: anywhere; }
.answer-item.full-width { grid-column: 1 / -1; }

.comment-box {
  background: var(--card2);
  border-right: 4px solid var(--accent2);
  padding: 14px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.status-form select,
.status-form input[type="datetime-local"] {
  font-family: inherit;
  padding: 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--card2);
  color: var(--text);
  font-size: 14px;
}

.notes-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.note-item { background: var(--card2); padding: 10px 12px; border-radius: 8px; font-size: 13px; color: var(--text); }
.note-item time { color: var(--text3); font-size: 11px; display: block; margin-top: 4px; }

.user-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
}
.user-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.user-card-head .name { font-weight: 800; font-size: 15px; color: var(--text); }
.user-card-head .username { color: var(--text3); font-size: 12px; margin-inline-start: 6px; }
.user-card-head .badges { display: flex; gap: 6px; flex-wrap: wrap; }

.user-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
@media (max-width: 640px) {
  .user-card-grid { grid-template-columns: 1fr; }
}

.mini-form-label {
  display: block;
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 6px;
  font-weight: 700;
}
.mini-form-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.mini-form-row .text-input {
  padding: 9px 10px;
  font-size: 13px;
  flex: 1 1 130px;
}
.check-inline {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text2);
  white-space: nowrap;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 640px) {
  .form-grid-2 { grid-template-columns: 1fr; }
}

.flash {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}
