/* Quiz Mohammed Hindi — v2 UI Liven-style */

.arabe-quiz-shell {
  --aq-ink: #0a0a0b;
  --aq-surface: #141416;
  --aq-surface-2: #1c1c1f;
  --aq-surface-3: #26262a;
  --aq-line: rgba(255, 255, 255, 0.07);
  --aq-line-strong: rgba(255, 255, 255, 0.14);
  --aq-text: #ffffff;
  --aq-text-dim: #b2b2b8;
  --aq-text-faint: #6c6c73;
  --aq-orange: #ee9600;
  --aq-orange-glow: rgba(238, 150, 0, 0.35);
  --aq-orange-soft: rgba(238, 150, 0, 0.11);
  --aq-blue: #0170B9;
  --aq-success: #2bd576;
  --aq-radius: 20px;
  --aq-radius-s: 14px;
  --aq-ease: cubic-bezier(0.22, 1, 0.36, 1);

  background: radial-gradient(ellipse at top, #1a1012 0%, var(--aq-ink) 60%) var(--aq-ink);
  color: var(--aq-text);
  font-family: 'Inter', -apple-system, system-ui, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 20px 40px;
  box-sizing: border-box;
  position: relative;
  overflow-x: hidden;
}
.arabe-quiz-shell *, .arabe-quiz-shell *::before, .arabe-quiz-shell *::after { box-sizing: border-box; }

/* Topbar */
.arabe-quiz-topbar {
  display: flex; align-items: center; gap: 20px;
  padding-bottom: 20px;
}
.arabe-quiz-brand { display: flex; flex-direction: column; gap: 1px; flex: 0 0 auto; text-decoration: none; line-height: 1.2; }
.arabe-quiz-brand-name { font-weight: 700; letter-spacing: 0.2px; color: var(--aq-text); font-size: 14px; }
.arabe-quiz-brand-byline { color: var(--aq-text-faint); font-size: 11px; letter-spacing: 0.3px; }
.arabe-quiz-progress-wrap { flex: 1; display: flex; align-items: center; gap: 10px; }
.arabe-quiz-progress { flex: 1; height: 6px; background: rgba(255,255,255,0.07); border-radius: 999px; overflow: hidden; position: relative; }
.arabe-quiz-progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--aq-orange), #ffb84d);
  border-radius: 999px;
  transition: width 0.6s var(--aq-ease);
  box-shadow: 0 0 10px var(--aq-orange-glow);
  position: relative;
}
.arabe-quiz-progress-bar::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
  animation: aqShimmer 2s ease-in-out infinite;
}
@keyframes aqShimmer { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
.arabe-quiz-progress-count { font-size: 12px; color: var(--aq-text-faint); font-variant-numeric: tabular-nums; font-weight: 600; min-width: 36px; text-align: right; }

/* Stage */
.arabe-quiz-stage { flex: 1; padding-top: 30px; position: relative; min-height: 400px; }

/* Card entry/exit */
.arabe-quiz-card {
  animation: aqCardIn 0.55s var(--aq-ease) both;
}
.arabe-quiz-card.aq-leaving {
  animation: aqCardOut 0.3s var(--aq-ease) both;
}
.arabe-quiz-card.aq-back {
  animation: aqCardInBack 0.55s var(--aq-ease) both;
}
@keyframes aqCardIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes aqCardOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-40px); }
}
@keyframes aqCardInBack {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Question header */
.arabe-quiz-question-icon {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 20px;
  display: inline-block;
  animation: aqIconIn 0.7s var(--aq-ease) 0.1s both;
  filter: drop-shadow(0 0 20px rgba(255,255,255,0.08));
}
@keyframes aqIconIn {
  from { opacity: 0; transform: scale(0.6) rotate(-8deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}
.arabe-quiz-eyebrow {
  display: inline-block; font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--aq-orange); margin-bottom: 10px; font-weight: 700;
  animation: aqFadeUp 0.5s var(--aq-ease) 0.15s both;
}
.arabe-quiz-h1, .arabe-quiz-h2 {
  color: var(--aq-text); margin: 0 0 10px;
  font-weight: 700; line-height: 1.15; letter-spacing: -0.02em;
  font-family: inherit;
  animation: aqFadeUp 0.6s var(--aq-ease) 0.2s both;
}
.arabe-quiz-h1 { font-size: clamp(28px, 5.5vw, 40px); }
.arabe-quiz-h2 { font-size: clamp(24px, 4.5vw, 32px); }
.arabe-quiz-sub {
  color: var(--aq-text-dim); margin: 0 0 24px; font-size: 15px; line-height: 1.55;
  animation: aqFadeUp 0.55s var(--aq-ease) 0.28s both;
}
.arabe-quiz-shell p { line-height: 1.6; color: var(--aq-text); }
@keyframes aqFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Audio block */
.arabe-quiz-audio-block {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--aq-surface-2);
  border: 1px solid var(--aq-line);
  border-radius: var(--aq-radius-s);
  margin: 18px 0 24px;
  animation: aqFadeUp 0.5s var(--aq-ease) 0.35s both;
  transition: border-color 0.3s;
}
.arabe-quiz-audio-block:hover { border-color: var(--aq-line-strong); }
.arabe-quiz-audio-block button {
  background: var(--aq-orange); color: #000; border: none;
  width: 46px; height: 46px; border-radius: 50%; font-size: 18px; cursor: pointer;
  display: grid; place-items: center; flex: 0 0 auto;
  font-family: inherit;
  box-shadow: 0 4px 20px var(--aq-orange-glow);
  transition: transform 0.2s var(--aq-ease), box-shadow 0.3s;
}
.arabe-quiz-audio-block button:hover { transform: scale(1.08); box-shadow: 0 6px 24px var(--aq-orange-glow); }
.arabe-quiz-audio-block button:active { transform: scale(0.95); }
.arabe-quiz-audio-block button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.arabe-quiz-audio-label { font-size: 14px; color: var(--aq-text-dim); line-height: 1.4; }
.arabe-quiz-audio-label strong { color: var(--aq-text); display: block; margin-bottom: 2px; font-weight: 600; }

/* Options */
.arabe-quiz-options { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.arabe-quiz-option {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--aq-surface);
  border: 1px solid var(--aq-line);
  border-radius: var(--aq-radius-s);
  color: var(--aq-text);
  font-size: 15.5px; line-height: 1.35; cursor: pointer;
  text-align: left;
  transition: border-color 0.2s var(--aq-ease), background 0.2s var(--aq-ease), transform 0.15s var(--aq-ease);
  font-family: inherit; width: 100%;
  animation: aqOptionIn 0.4s var(--aq-ease) both;
  position: relative;
  overflow: hidden;
}
.arabe-quiz-option:nth-child(1) { animation-delay: 0.30s; }
.arabe-quiz-option:nth-child(2) { animation-delay: 0.38s; }
.arabe-quiz-option:nth-child(3) { animation-delay: 0.46s; }
.arabe-quiz-option:nth-child(4) { animation-delay: 0.54s; }
.arabe-quiz-option:hover { border-color: var(--aq-line-strong); background: var(--aq-surface-2); transform: translateX(2px); }
.arabe-quiz-option:active { transform: scale(0.985); }
.arabe-quiz-option.arabe-quiz-selected {
  border-color: var(--aq-orange);
  background: var(--aq-orange-soft);
  box-shadow: 0 0 0 1px var(--aq-orange), 0 8px 24px var(--aq-orange-glow);
}
.arabe-quiz-option-icon {
  flex: 0 0 36px; height: 36px;
  display: grid; place-items: center;
  font-size: 20px; line-height: 1;
  background: var(--aq-surface-3);
  border-radius: 10px;
  transition: background 0.2s;
}
.arabe-quiz-option:hover .arabe-quiz-option-icon { background: var(--aq-surface-3); }
.arabe-quiz-option.arabe-quiz-selected .arabe-quiz-option-icon { background: var(--aq-orange); color: #000; }
.arabe-quiz-option-label { display: block; flex: 1; }
.arabe-quiz-option-check {
  flex: 0 0 24px; height: 24px; opacity: 0;
  display: grid; place-items: center;
  color: var(--aq-orange); font-size: 18px;
  transition: opacity 0.2s;
}
.arabe-quiz-option.arabe-quiz-selected .arabe-quiz-option-check { opacity: 1; }
@keyframes aqOptionIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Coach flash */
.arabe-quiz-coach {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--aq-surface-2);
  border: 1px solid var(--aq-line-strong);
  padding: 18px 24px;
  border-radius: 999px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px var(--aq-orange-glow);
  z-index: 1000;
  font-size: 15px; color: var(--aq-text); font-weight: 500;
  animation: aqCoachPop 1.2s var(--aq-ease);
  pointer-events: none;
}
.arabe-quiz-coach-icon {
  flex: 0 0 26px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--aq-success); color: #000;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 700;
  line-height: 1;
}
@keyframes aqCoachPop {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.85); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  85% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -55%) scale(0.95); }
}

/* Actions / buttons */
.arabe-quiz-actions {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-top: 24px;
  animation: aqFadeUp 0.4s var(--aq-ease) 0.6s both;
}
.arabe-quiz-btn {
  padding: 15px 32px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: none; cursor: pointer; font-family: inherit;
  transition: filter 0.2s, transform 0.15s var(--aq-ease), box-shadow 0.3s;
  display: inline-flex; align-items: center; gap: 8px;
}
.arabe-quiz-btn-primary {
  background: var(--aq-orange); color: #000;
  box-shadow: 0 6px 24px var(--aq-orange-glow);
}
.arabe-quiz-btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 8px 28px var(--aq-orange-glow); }
.arabe-quiz-btn-primary:active { transform: translateY(0) scale(0.98); }
.arabe-quiz-btn-primary:disabled { opacity: 0.35; cursor: not-allowed; filter: none; box-shadow: none; transform: none; }
.arabe-quiz-btn-ghost {
  background: transparent; color: var(--aq-text-faint); padding: 10px 14px;
}
.arabe-quiz-btn-ghost:hover { color: var(--aq-text); }

/* Fields */
.arabe-quiz-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; animation: aqFadeUp 0.4s var(--aq-ease) both; }
.arabe-quiz-field:nth-of-type(1) { animation-delay: 0.3s; }
.arabe-quiz-field:nth-of-type(2) { animation-delay: 0.38s; }
.arabe-quiz-field:nth-of-type(3) { animation-delay: 0.46s; }
.arabe-quiz-field label { font-size: 13px; color: var(--aq-text-dim); font-weight: 500; letter-spacing: 0.2px; }
.arabe-quiz-field input {
  padding: 15px 18px;
  background: var(--aq-surface);
  border: 1px solid var(--aq-line);
  border-radius: var(--aq-radius-s);
  color: var(--aq-text); font-size: 16px;
  font-family: inherit; outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.arabe-quiz-field input:hover { border-color: var(--aq-line-strong); }
.arabe-quiz-field input:focus { border-color: var(--aq-orange); background: var(--aq-surface-2); box-shadow: 0 0 0 3px var(--aq-orange-soft); }
.arabe-quiz-hint { font-size: 12px; color: var(--aq-text-faint); margin-top: 2px; }
.arabe-quiz-required label::after { content: ' *'; color: var(--aq-orange); }

.arabe-quiz-consent {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 10px 0 22px;
  font-size: 13px; color: var(--aq-text-dim); line-height: 1.5;
  cursor: pointer;
  animation: aqFadeUp 0.4s var(--aq-ease) 0.55s both;
}
.arabe-quiz-consent input {
  margin-top: 2px;
  accent-color: var(--aq-orange);
  width: 18px; height: 18px;
  flex: 0 0 auto;
}

/* Outcome */
.arabe-quiz-outcome {
  background: linear-gradient(180deg, var(--aq-surface) 0%, var(--aq-surface-2) 100%);
  border: 1px solid var(--aq-line);
  border-radius: var(--aq-radius);
  padding: 40px 32px 36px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.arabe-quiz-outcome .arabe-quiz-emoji {
  font-size: 72px; margin-bottom: 16px; display: block;
  line-height: 1;
  animation: aqEmojiBounce 1s var(--aq-ease);
  filter: drop-shadow(0 0 24px rgba(238,150,0,0.3));
}
@keyframes aqEmojiBounce {
  0% { opacity: 0; transform: scale(0.3) rotate(-20deg); }
  60% { transform: scale(1.1) rotate(5deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
.arabe-quiz-outcome .arabe-quiz-h2 { animation-delay: 0.3s; }
.arabe-quiz-outcome p { color: var(--aq-text-dim); margin: 0 auto 20px; max-width: 440px; animation: aqFadeUp 0.5s var(--aq-ease) 0.45s both; }
.arabe-quiz-cta-group { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; animation: aqFadeUp 0.5s var(--aq-ease) 0.6s both; }
.arabe-quiz-cta-group .arabe-quiz-btn { justify-content: center; }

.arabe-quiz-footer-note {
  margin-top: 40px; padding-top: 20px;
  border-top: 1px solid var(--aq-line);
  text-align: center;
  color: var(--aq-text-faint); font-size: 11px;
  letter-spacing: 0.3px;
}
.arabe-quiz-footer-note a { color: var(--aq-text-faint); text-decoration: underline; }

.arabe-quiz-loader {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(0,0,0,0.3); border-top-color: #000;
  border-radius: 50%; animation: aqSpin 0.6s linear infinite;
  vertical-align: middle; margin-left: 8px;
}
@keyframes aqSpin { to { transform: rotate(360deg); } }

/* Slide (interstitiel éditorial type Liven) */
.arabe-quiz-slide { text-align: left; padding-top: 20px; }
.arabe-quiz-slide-icon { font-size: 72px !important; margin-bottom: 22px; filter: drop-shadow(0 0 30px rgba(255,255,255,0.1)); }
.arabe-quiz-slide-text {
  font-size: 16px !important;
  line-height: 1.65 !important;
  color: var(--aq-text) !important;
  background: var(--aq-surface);
  border: 1px solid var(--aq-line);
  border-left: 3px solid var(--aq-orange);
  padding: 18px 22px;
  border-radius: var(--aq-radius-s);
  margin: 20px 0 0 !important;
  animation: aqFadeUp 0.5s var(--aq-ease) 0.3s both !important;
}
.arabe-quiz-slide-actions { justify-content: space-between !important; }

/* Recognition widget (test lettres interactif) */
.arabe-quiz-letters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
  margin: 10px 0 16px;
  animation: aqFadeUp 0.5s var(--aq-ease) 0.3s both;
}
.arabe-quiz-letter {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 18px 10px 14px;
  background: var(--aq-surface);
  border: 1px solid var(--aq-line);
  border-radius: var(--aq-radius-s);
  color: var(--aq-text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s var(--aq-ease), background 0.2s var(--aq-ease), transform 0.15s var(--aq-ease), box-shadow 0.3s;
  aspect-ratio: 1 / 1.3;
  min-height: 110px;
}
.arabe-quiz-letter:hover { border-color: var(--aq-line-strong); background: var(--aq-surface-2); transform: translateY(-2px); }
.arabe-quiz-letter:active { transform: scale(0.96); }
.arabe-quiz-letter-on {
  border-color: var(--aq-orange);
  background: var(--aq-orange-soft);
  box-shadow: 0 0 0 1px var(--aq-orange), 0 8px 20px var(--aq-orange-glow);
}
.arabe-quiz-letter-on:hover { transform: translateY(-2px); }
.arabe-quiz-letter-ar {
  font-family: 'Amiri', serif;
  font-size: 42px;
  line-height: 1;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--aq-text);
  font-weight: 700;
}
.arabe-quiz-letter-on .arabe-quiz-letter-ar { color: var(--aq-orange); }
.arabe-quiz-letter-name {
  font-size: 11px;
  color: var(--aq-text-faint);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.arabe-quiz-letter-on .arabe-quiz-letter-name { color: var(--aq-orange); }
.arabe-quiz-letters-counter {
  text-align: center;
  color: var(--aq-text-dim);
  font-size: 14px;
  margin: 4px 0 12px;
  animation: aqFadeUp 0.4s var(--aq-ease) 0.55s both;
}
.arabe-quiz-letters-counter strong { color: var(--aq-orange); font-size: 16px; margin-right: 4px; }

/* Mobile */
@media (max-width: 480px) {
  .arabe-quiz-shell { padding: 14px 14px 32px; max-width: 100%; }
  .arabe-quiz-topbar { gap: 12px; }
  .arabe-quiz-brand-name { font-size: 13px; }
  .arabe-quiz-brand-byline { font-size: 10px; }
  .arabe-quiz-question-icon { font-size: 48px; margin-bottom: 16px; }
  .arabe-quiz-option { padding: 14px 16px; font-size: 15px; }
  .arabe-quiz-option-icon { flex: 0 0 32px; height: 32px; font-size: 18px; }
  .arabe-quiz-outcome { padding: 32px 20px 28px; }
  .arabe-quiz-outcome .arabe-quiz-emoji { font-size: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  .arabe-quiz-shell *, .arabe-quiz-shell *::before, .arabe-quiz-shell *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
