/* ═══════════════════════════════════════════════════════════════════════════
   styles.css — CityLink Yaoundé · Portail Captif Wi-Fi
   Mobile-First · Design Système · Animations CSS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
  --brand-primary:   #0F4C81;
  --brand-accent:    #1A7FD4;
  --brand-green:     #007A5E;
  --brand-yellow:    #FCD116;
  --brand-red:       #CE1126;

  --success:   #10B981;
  --warning:   #F59E0B;
  --error:     #EF4444;
  --info:      #3B82F6;

  --bg-app:    #F0F4F8;
  --surface:   #FFFFFF;
  --border:    #E2E8F0;
  --text-hd:   #0F172A;
  --text-body: #334155;
  --text-muted:#64748B;
  --text-xs:   #94A3B8;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.13);
  --shadow-xl:  0 24px 64px rgba(0,0,0,.16);

  --r-xs: 6px;  --r-sm: 10px; --r-md: 16px;
  --r-lg: 24px; --r-xl: 32px; --r-full: 9999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:  cubic-bezier(0.7, 0, 0.84, 0);
  --t-fast:   150ms;  --t-normal: 250ms; --t-slow: 400ms;

  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text-body);
  background: var(--bg-app);
  min-height: 100dvh;
  line-height: 1.5;
  overflow-x: hidden;

  /* Centre le card sur desktop */
  display: flex;
  flex-direction: column;
  align-items: center;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font); border: none; background: none; }
input, button { -webkit-appearance: none; appearance: none; }
h1, h2, h3 { color: var(--text-hd); line-height: 1.2; }
.hidden { display: none !important; }

/* ── App Shell ────────────────────────────────────────────────────────────── */
#app {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-app);
  position: relative;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  width: 100%;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.logo-icon { flex-shrink: 0; }

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  min-width: 0;
}

.logo-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-primary);
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.logo-city {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-body);
  transition: background var(--t-fast), transform var(--t-fast);
  flex-shrink: 0;
}
.lang-btn:hover  { background: var(--border); }
.lang-btn:active { transform: scale(0.95); }

/* ── Screen System ────────────────────────────────────────────────────────── */
.screen {
  display: none;
  flex: 1;
  animation: screenIn var(--t-slow) var(--ease-out) both;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

.screen.leaving {
  animation: screenOut var(--t-normal) var(--ease-in) both;
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes screenOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}

.screen-body {
  padding: 16px 16px 40px;
  flex: 1;
  width: 100%;
}

/* ── Back Button ──────────────────────────────────────────────────────────── */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-accent);
  margin-bottom: 16px;
  transition: gap var(--t-fast);
}
.btn-back:hover { gap: 10px; }

/* ═══════════════════════════════════════════════════════════════════════════
   ÉCRAN 1 — OFFRES
   ═══════════════════════════════════════════════════════════════════════════ */
.hero {
  text-align: center;
  padding: 20px 0 16px;
}

.hero-wifi-anim {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wifi-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--brand-accent);
  animation: wifiPulse 2.4s ease-out infinite;
}

.r1 { width: 32px;  height: 32px;  animation-delay: 0s;   opacity: .7; }
.r2 { width: 54px;  height: 54px;  animation-delay: .5s;  opacity: .4; }
.r3 { width: 78px;  height: 78px;  animation-delay: 1s;   opacity: .2; }

.wifi-center {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--brand-primary);
  z-index: 1;
  box-shadow: 0 0 0 4px rgba(26,127,212,.25);
}

@keyframes wifiPulse {
  0%   { transform: scale(0.8); opacity: .7; }
  70%  { transform: scale(1);   opacity: 0; }
  100% { transform: scale(0.8); opacity: 0; }
}

.hero-title {
  font-size: clamp(20px, 6vw, 28px);
  font-weight: 800;
  color: var(--text-hd);
  letter-spacing: -0.6px;
}

.hero-subtitle {
  font-size: clamp(12px, 3.5vw, 15px);
  color: var(--text-muted);
  margin-top: 4px;
}

.section-title { margin-bottom: 12px; }
.section-title h2 {
  font-size: clamp(16px, 4.5vw, 20px);
  font-weight: 700;
}
.section-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Grille offres — toujours 1 colonne pour garantir la lisibilité */
.offers-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

/* Carte offre */
.offer-card {
  background: var(--surface);
  border-radius: var(--r-md);
  border: 2px solid var(--border);
  padding: 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color var(--t-normal), transform var(--t-normal), box-shadow var(--t-normal);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: cardAppear var(--t-slow) var(--ease-out) both;
  /* empêche le débordement horizontal */
  min-width: 0;
}

.offer-card:nth-child(2) { animation-delay: 80ms; }
.offer-card:nth-child(3) { animation-delay: 160ms; }
.offer-card:nth-child(4) { animation-delay: 240ms; }

@keyframes cardAppear {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.offer-card:hover  { border-color: var(--brand-accent); box-shadow: var(--shadow-md); }
.offer-card:active { transform: scale(0.98); }
.offer-card.popular { border-color: var(--brand-primary); box-shadow: var(--shadow-md); }

.offer-card.popular::before {
  content: '⭐ Populaire';
  position: absolute;
  top: 0; right: 0;
  background: var(--brand-primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-bottom-left-radius: var(--r-sm);
}

.offer-card::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand-accent), var(--brand-primary));
  border-radius: var(--r-full) 0 0 var(--r-full);
  opacity: 0;
  transition: opacity var(--t-normal);
}
.offer-card:hover::after  { opacity: 1; }
.offer-card.popular::after { opacity: 1; }

.offer-price-badge {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
}

.offer-price-amount {
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.offer-price-currency {
  font-size: 9px;
  font-weight: 600;
  opacity: .85;
  margin-top: 2px;
}

.offer-info { flex: 1; min-width: 0; overflow: hidden; }

.offer-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-hd);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.offer-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 600;
  background: var(--bg-app);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.offer-arrow {
  flex-shrink: 0;
  color: var(--text-xs);
  transition: transform var(--t-normal), color var(--t-normal);
}
.offer-card:hover .offer-arrow { transform: translateX(4px); color: var(--brand-accent); }

.offer-skeleton {
  height: 92px;
  background: linear-gradient(90deg, #E2E8F0 25%, #EEF2F7 50%, #E2E8F0 75%);
  background-size: 200% 100%;
  border-radius: var(--r-md);
  animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.offers-error { text-align: center; padding: 24px 16px; color: var(--text-muted); }
.offers-error svg { margin: 0 auto 10px; color: var(--text-xs); }
.offers-error p { margin-bottom: 14px; font-size: 14px; }

.btn-retry {
  padding: 10px 24px;
  background: var(--brand-primary);
  color: white;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--t-fast);
}
.btn-retry:hover { background: var(--brand-accent); }

.already-have-ticket { text-align: center; margin-top: 6px; }
.link-muted {
  font-size: 13px;
  color: var(--text-muted);
  transition: color var(--t-fast);
}
.link-muted:hover { color: var(--brand-accent); }

/* ═══════════════════════════════════════════════════════════════════════════
   ÉCRAN 2 — PAIEMENT
   ═══════════════════════════════════════════════════════════════════════════ */
.offer-summary-card {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
  border-radius: var(--r-lg);
  padding: 16px;
  color: white;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.offer-summary-card::before {
  content: '';
  position: absolute;
  top: -24px; right: -24px;
  width: 96px; height: 96px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}

.offer-summary-card::after {
  content: '';
  position: absolute;
  bottom: -32px; left: -16px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
}

.summary-badge {
  display: inline-block;
  background: rgba(255,255,255,.2);
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  margin-bottom: 6px;
}

.summary-name {
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: 8px;
}

.summary-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.summary-chip {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--r-full);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
}

.summary-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,.2);
  padding-top: 10px;
}

.summary-price-label { font-size: 12px; opacity: .8; }
.summary-price {
  font-size: clamp(22px, 6vw, 28px);
  font-weight: 800;
  letter-spacing: -1px;
}

/* Champ téléphone */
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-hd);
  margin-bottom: 8px;
}

.phone-field {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
  transition: border-color var(--t-normal), box-shadow var(--t-normal);
}

.phone-field:focus-within {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(26,127,212,.15);
}

.phone-prefix {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  background: var(--bg-app);
  border-right: 2px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-body);
  white-space: nowrap;
  flex-shrink: 0;
}

.phone-input {
  flex: 1;
  padding: 13px 12px;
  font-size: 16px; /* 16px évite le zoom auto sur iOS */
  font-weight: 500;
  color: var(--text-hd);
  background: transparent;
  border: none;
  outline: none;
  min-width: 0;
  letter-spacing: 1px;
}

.phone-input::placeholder { color: var(--text-xs); letter-spacing: 0; }

.field-hint { font-size: 11px; color: var(--text-muted); margin-top: 5px; }

.field-error {
  font-size: 11px;
  color: var(--error);
  font-weight: 500;
  margin-top: 5px;
  animation: slideDown var(--t-fast) var(--ease-out);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === Sélecteur opérateur === */
.operator-selector {
  margin: 16px 0 20px;
}

.operator-selector .form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-hd);
  margin-bottom: 8px;
}

.operator-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.operator-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--t-normal), background var(--t-normal);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-body);
}

.operator-btn:hover {
  border-color: var(--brand-accent);
}

.operator-btn.selected {
  border-color: var(--brand-primary);
  background: rgba(15, 76, 129, 0.05);
}

.operator-icon {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 20px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: white;
  border-radius: var(--r-md);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  transition: opacity var(--t-fast), transform var(--t-fast), box-shadow var(--t-normal);
  box-shadow: 0 4px 16px rgba(15,76,129,.35);
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--t-fast);
}
.btn-primary:hover::after  { background: rgba(255,255,255,.08); }
.btn-primary:active { transform: scale(0.98); opacity: .95; }
.btn-primary:disabled { opacity: .55; pointer-events: none; }

.btn-primary.loading .btn-icon { display: none; }
.btn-primary.loading::before {
  content: '';
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  background: var(--surface);
  color: var(--brand-primary);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 600;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.btn-secondary:hover  { border-color: var(--brand-accent); background: rgba(26,127,212,.04); }
.btn-secondary:active { transform: scale(0.98); }

/* ═══════════════════════════════════════════════════════════════════════════
   ÉCRAN 3 — ATTENTE
   ═══════════════════════════════════════════════════════════════════════════ */
.waiting-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 32px;
}

.pulse-loader {
  position: relative;
  width: 100px; height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.pulse-ring {
  position: absolute;
  border-radius: 50%;
  animation: pulseBeat 1.8s ease-in-out infinite;
}

.pr1 { width: 54px;  height: 54px;  background: rgba(26,127,212,.20); animation-delay: 0s; }
.pr2 { width: 76px;  height: 76px;  background: rgba(26,127,212,.12); animation-delay: .25s; }
.pr3 { width: 100px; height: 100px; background: rgba(26,127,212,.06); animation-delay: .5s; }

.pulse-core {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  box-shadow: var(--shadow-md);
}

@keyframes pulseBeat {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%       { transform: scale(1.1); opacity: .7; }
}

.waiting-title {
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 800;
  margin-bottom: 16px;
}

.waiting-instruction-card {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  width: 100%;
  margin-bottom: 24px;
  text-align: left;
}

.waiting-instruction-icon { font-size: 28px; margin-bottom: 8px; text-align: center; }

.waiting-instruction {
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
  text-align: center;
  word-break: break-word;
}

.ussd-codes {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.ussd-chip {
  padding: 5px 12px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.ussd-chip.orange { background: #FFF3E0; color: #FF6B00; border: 1px solid #FFCC80; }
.ussd-chip.mtn    { background: #FFFDE7; color: #F9A825; border: 1px solid #FFF176; }

.poll-progress-wrap { width: 100%; margin-bottom: 10px; }

.poll-progress-track {
  height: 4px;
  background: var(--border);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: 6px;
}

.poll-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
  border-radius: var(--r-full);
  animation: pollSweep 3s linear infinite;
}

@keyframes pollSweep {
  0%   { width: 0%; opacity: 1; }
  80%  { width: 100%; opacity: 1; }
  100% { width: 100%; opacity: 0; }
}

.poll-progress-label { font-size: 11px; color: var(--text-muted); text-align: center; }

.poll-timeout-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.poll-timeout-hint strong { color: var(--warning); font-weight: 700; }

.btn-cancel {
  padding: 10px 28px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--t-fast), border-color var(--t-fast);
}
.btn-cancel:hover { color: var(--error); border-color: var(--error); }

/* ═══════════════════════════════════════════════════════════════════════════
   ÉCRAN 4 — SUCCÈS
   ═══════════════════════════════════════════════════════════════════════════ */
.success-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 24px;
}

.success-check { width: 72px; height: 72px; margin-bottom: 16px; }

.checkmark { width: 72px; height: 72px; }

.checkmark-circle {
  stroke: var(--success);
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-linecap: round;
  animation: drawCircle .6s var(--ease-out) forwards;
}

.checkmark-check {
  stroke: var(--success);
  stroke-width: 3;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke-linecap: round;
  animation: drawCheck .35s var(--ease-out) .6s forwards;
}

@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawCheck  { to { stroke-dashoffset: 0; } }

.success-title {
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 800;
  margin-bottom: 4px;
}
.success-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.ticket-card {
  background: var(--surface);
  border-radius: var(--r-md);
  border: 2px dashed var(--brand-accent);
  width: 100%;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  animation: ticketAppear .5s .9s var(--ease-out) both;
}

@keyframes ticketAppear {
  from { opacity: 0; transform: scale(.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.ticket-header {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: white;
  padding: 8px 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.ticket-code {
  font-size: clamp(22px, 7vw, 32px);
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--text-hd);
  padding: 20px 14px 16px;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
  text-align: center;
}

.ticket-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 14px 16px;
}

.ticket-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.ticket-meta-item strong { color: var(--text-body); font-weight: 600; }

.ticket-perforations {
  height: 16px;
  border-top: 2px dashed var(--border);
  background: repeating-linear-gradient(
    90deg,
    transparent, transparent 10px,
    var(--bg-app) 10px, var(--bg-app) 20px
  );
}

.success-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

/* === Ticket hint === */
.ticket-hint {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 14px 12px;
}

/* === Compte à rebours === */
.countdown-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
  width: 100%;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.countdown-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.countdown-display {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.countdown-value {
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--brand-primary);
  min-width: 2.5ch;
}

.countdown-sep {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-xs);
}

.countdown-warning .countdown-value {
  color: var(--error);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOASTS
   ═══════════════════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(calc(100vw - 24px), 440px);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--text-hd);
  color: white;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s var(--ease-out) both;
  pointer-events: auto;
  word-break: break-word;
}

.toast.success { background: var(--success); }
.toast.error   { background: var(--error); }
.toast.warning { background: var(--warning); color: var(--text-hd); }
.toast.info    { background: var(--brand-accent); }

.toast.removing { animation: toastOut .25s var(--ease-in) both; }

@keyframes toastIn  { from { opacity: 0; transform: translateY(-10px) scale(.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { to   { opacity: 0; transform: translateY(-6px) scale(.95); } }

.toast-icon { font-size: 15px; flex-shrink: 0; }
.toast-msg  { flex: 1; line-height: 1.4; }

/* ═══════════════════════════════════════════════════════════════════════════
   MODALE — Bottom Sheet
   ═══════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.hidden { display: none; }

.modal-box {
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 28px 20px 36px;
  width: 100%;
  max-width: 480px;
  position: relative;
  animation: sheetUp var(--t-slow) var(--ease-out) both;
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-app);
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast);
}
.modal-close:hover { background: var(--border); color: var(--text-hd); }

.modal-box h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.modal-box p  { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

.modal-input-wrap { margin-bottom: 14px; }

.modal-code-input {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  outline: none;
  transition: border-color var(--t-normal), box-shadow var(--t-normal);
}
.modal-code-input:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(26,127,212,.15);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Desktop (≥ 540px)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 540px) {
  body {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
    padding: 32px 16px;
    justify-content: flex-start;
  }

  #app {
    min-height: auto;
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
  }

  .screen-body { padding: 20px 24px 40px; }
  .header-inner { padding: 14px 24px; }
}

/* Très petits écrans (< 360px) */
@media (max-width: 360px) {
  .offer-price-badge { width: 56px; height: 56px; }
  .offer-price-amount { font-size: 14px; }
  .phone-prefix { padding: 0 8px; font-size: 12px; }
  .phone-input { padding: 12px 10px; }
  .operator-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
