/* --------------------------------------------------------------------------
 * Versio – landing mobile-first
 * Palette sobre, sombre, lisible. Aucune dépendance externe.
 * ------------------------------------------------------------------------ */

:root {
  --bg: #0f1220;
  --bg-soft: #171a2b;
  --surface: #1e2238;
  --text: #f4f5fb;
  --text-muted: #a6abc8;
  --accent: #5b7cfa;
  --accent-strong: #6d8bff;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at 50% -10%, #23284a 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Empêche le scroll d'arrière-plan quand la modale est ouverte */
body.iabb-modal-open {
  overflow: hidden;
}

/* ------------------------------ Redirecteur ---------------------------- */

.redirect {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 24px 22px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  text-align: center;
}

.redirect-status {
  margin: 0;
  font-size: 16px;
  color: var(--text-muted);
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-strong);
  animation: iabb-spin 0.8s linear infinite;
}

@keyframes iabb-spin {
  to { transform: rotate(360deg); }
}

.logo {
  width: 74px;
  height: 74px;
  margin: 0 auto 22px;
  border-radius: 20px;
  background: linear-gradient(160deg, var(--accent-strong), #3f5bd8);
  color: #fff;
  font-size: 40px;
  font-weight: 800;
  line-height: 74px;
  box-shadow: var(--shadow);
  letter-spacing: -1px;
}

/* --------------------------------- CTA --------------------------------- */

.cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 15px 26px;
  background: #ffffff;
  color: #06070d;
  text-decoration: none;
  border-radius: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.cta:active {
  transform: translateY(1px) scale(0.99);
}

.cta-apple {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  background: #06070d;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
  /* Logo Apple en SVG inline (mask) — pas de requête réseau */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath d='M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath d='M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z'/%3E%3C/svg%3E");
}

.cta-labels {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.cta-labels small {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.75;
}

.cta-labels strong {
  font-size: 19px;
  font-weight: 700;
}

/* -------------------------- Modale de fallback ------------------------- */

.iabb-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(6, 7, 13, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: iabb-fade 0.18s ease;
}

.iabb-modal {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px 22px 22px;
  box-shadow: var(--shadow);
  animation: iabb-pop 0.2s ease;
}

.iabb-modal-title {
  margin: 0 0 10px;
  font-size: 20px;
  letter-spacing: -0.3px;
}

.iabb-modal-text {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 15px;
}

.iabb-modal-steps {
  margin: 0 0 22px;
  padding-left: 20px;
  color: var(--text);
  font-size: 15px;
}

.iabb-modal-steps li {
  margin-bottom: 6px;
}

.iabb-modal-steps strong {
  color: var(--accent-strong);
}

.iabb-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.iabb-btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.1s ease;
}

.iabb-btn:active {
  transform: translateY(1px);
}

.iabb-btn-primary {
  background: linear-gradient(160deg, var(--accent-strong), #3f5bd8);
  color: #fff;
}

.iabb-btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.iabb-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
}

.iabb-modal-close:active {
  background: rgba(255, 255, 255, 0.06);
}

@keyframes iabb-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes iabb-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Respect des préférences d'accessibilité */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
