/* Zycash Checkout — maquette « Demande de paiement » (jaune / noir), mobile uniquement */
:root {
  --yellow: #face0a;
  --ink: #111111;
  --card: #1f1f1f;
  --white: #ffffff;
  --muted: #5d5a45;
  --line: rgba(17, 17, 17, 0.18);
  --danger: #b42318;
  --ok: #1c7c47;
  --shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
  --radius: 12px;
  /* Titres : Montserrat Black (même police que l'app), repli système en gras */
  --display: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
/* Fond jaune jusque sous la barre d'adresse (Safari teinte la barre avec ce fond) */
html { -webkit-text-size-adjust: 100%; height: 100%; background: var(--yellow); color-scheme: light; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* ── Écran ────────────────────────────────────────────────────────────── */
.screen {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.view { flex: 1; }
/* Écran de paiement : le formulaire occupe la hauteur, le bouton reste en bas
   quand le contenu est court et suit le contenu quand il est long (pas de barre
   fixe : elle masquait les champs et passait sous le clavier des webviews). */
.view--pay:not([hidden]) { display: flex; flex-direction: column; }
.view--pay .pay { flex: 1; display: flex; flex-direction: column; }
body { overflow-x: hidden; }

.page-title {
  margin: 4px 0 14px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 19px;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-align: center;
}

/* ── Encadré noir (expéditeur / montant / motif) ──────────────────────── */
.summary {
  background: var(--card);
  color: var(--white);
  border-radius: 14px;
  padding: 14px 16px 12px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
}
.summary-grid { display: flex; justify-content: space-between; gap: 12px; }
.summary-col { min-width: 0; }
.summary-col--right { text-align: right; flex: none; }
.summary-label {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: 19px;
  line-height: 1.2;
}
.summary-strong {
  margin: 2px 0 0;
  font-weight: 700;
  font-style: italic;
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.summary-small {
  margin: 2px 0 0;
  font-style: italic;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.85);
}
.summary-reason {
  margin: 12px 0 0;
  font-style: italic;
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  overflow-wrap: anywhere;
}
.summary-expiry {
  margin: 6px 0 0;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--yellow);
}
.summary--ghost { min-height: 104px; }
.ghost-line { height: 14px; border-radius: 7px; margin: 10px 0; background: rgba(255, 255, 255, 0.14); }
.w40 { width: 40%; } .w60 { width: 60%; } .w90 { width: 90%; }

/* ── Blocs du formulaire ─────────────────────────────────────────────── */
.pay { margin-top: 6px; }
.block { margin-top: 18px; }
.block-title {
  margin: 0 0 8px 2px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.block-title label { cursor: pointer; }
.optional { font-family: var(--text); font-size: 12px; font-weight: 600; color: var(--muted); }
.hint { margin: 6px 4px 0; font-size: 13px; font-weight: 500; color: var(--muted); }

/* Champ blanc à ombre portée (pays, mode, numéro, nom…) */
.field-box {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
  font: 600 16px/1.2 var(--text);
}
.input::placeholder, .phone-input::placeholder { color: #8f8f8f; font-weight: 500; }
.input:focus, .phone:focus-within, .select-button[aria-expanded="true"] { outline: none; border-color: var(--ink); }
.input[aria-invalid="true"], .phone-input[aria-invalid="true"] { border-color: var(--danger); }
.phone:has(.phone-input[aria-invalid="true"]) { border-color: var(--danger); }

/* Listes déroulantes */
.select { position: relative; }
.select-button { gap: 12px; text-align: left; cursor: pointer; }
.select-value { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.select-value.is-placeholder { color: #6f6f6f; font-weight: 500; }
.caret { width: 22px; height: 22px; fill: var(--ink); flex: none; }
.flag { width: 40px; height: 28px; border-radius: 4px; object-fit: cover; flex: none; background: #eee; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }

.mode-button { min-height: 60px; }
.mode-icon { width: 30px; height: 30px; fill: var(--ink); flex: none; }
.mode-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mode-caption { font-size: 13px; font-weight: 500; color: #6f6f6f; }
.mode-name { font-size: 16px; font-weight: 700; }

.select-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.select-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid #e6e6e6; }
.select-search svg { width: 20px; height: 20px; fill: #6f6f6f; flex: none; }
.select-input { flex: 1; min-width: 0; height: 48px; border: 0; background: transparent; color: var(--ink); font: 600 16px/1 var(--text); }
.select-input:focus { outline: none; }
.select-list { list-style: none; margin: 0; padding: 6px; max-height: 280px; overflow-y: auto; overscroll-behavior: contain; }
.select-panel.select-list { padding: 6px; }
.select-option { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 10px; border-radius: 10px; font-weight: 600; cursor: pointer; }
.select-option .dial { margin-left: auto; color: #6f6f6f; font-weight: 500; font-size: 14px; }
.select-option.is-active { background: #f4f1dc; }
.select-option[aria-selected="true"] { font-weight: 800; }
.select-option[aria-selected="true"]::after {
  content: ""; width: 10px; height: 10px; margin-left: 10px; flex: none;
  border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 2px var(--ink);
}
.select-empty { margin: 0; padding: 14px 16px; color: #6f6f6f; font-size: 14px; }

/* Numéro : drapeau + (+229) - + saisie */
.phone { gap: 10px; }
.phone-flag { width: 40px; height: 28px; border-radius: 4px; object-fit: cover; flex: none; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.phone-dial { flex: none; color: #555; font-weight: 600; white-space: nowrap; }
.phone-input {
  flex: 1; min-width: 0; height: 50px; border: 0; background: transparent;
  color: var(--ink); font: 700 18px/1 var(--text); letter-spacing: 0.02em;
}
.phone-input:focus { outline: none; }

/* Réseau : logos carrés */
.operators { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.operator {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 3px solid transparent;
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  cursor: pointer;
}
.operator-logo { display: block; width: 100%; height: 100%; object-fit: cover; }
.logo-fallback {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 100%; height: 100%; font-weight: 800; font-size: 13px; text-align: center; padding: 6px; line-height: 1.15;
}
.logo-fallback b { font-size: 28px; }
/* Pastille : cercle vide, ou coche noire quand le réseau est choisi */
.operator::after {
  content: "";
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 0 0 2px var(--ink);
}
.operator[aria-checked="true"] { border-color: var(--ink); }
.operator[aria-checked="true"]::after {
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='m9.5 16.2-4.2-4.2-1.4 1.4 5.6 5.6 11-11-1.4-1.4z'/%3E%3C/svg%3E") center / 15px no-repeat;
  box-shadow: 0 0 0 2px var(--white);
}

.error {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #fff1ef;
  color: var(--danger);
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

/* ── Bas d'écran fixe : rappel + bouton ──────────────────────────────── */
.cta {
  margin-top: auto;
  padding-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* Rappel : encart discret, bouclier au-dessus, texte centré sur lignes équilibrées */
.cta-note {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 380px;
  margin: 0 auto 14px;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(17, 17, 17, 0.07);
  border: 1px solid rgba(17, 17, 17, 0.1);
  font-style: italic;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}
.cta-note span { text-wrap: balance; }
.cta-icon { width: 20px; height: 20px; flex: none; fill: var(--ink); opacity: 0.85; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font: 700 18px/1.2 var(--text);
  text-decoration: none;
  cursor: pointer;
}
.btn--dark { background: var(--card); color: var(--white); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3); }
.btn--dark:disabled { background: #6b6438; color: rgba(255, 255, 255, 0.75); box-shadow: none; cursor: not-allowed; }
.btn--yellow { background: var(--yellow); color: var(--ink); margin-bottom: 8px; }
.btn--outline { background: transparent; color: var(--white); border: 2px solid var(--white); min-height: 48px; margin-top: 14px; font-size: 16px; }
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"]::before {
  content: ""; width: 18px; height: 18px; margin-right: 10px;
  border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Écrans d'état (attente, succès, messages) ───────────────────────── */
.state-card {
  background: var(--card);
  color: var(--white);
  border-radius: 16px;
  padding: 28px 20px 22px;
  text-align: center;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}
.state-title { margin: 16px 0 8px; font-family: var(--display); font-weight: 900; font-size: 20px; line-height: 1.25; }
.state-text { margin: 0 auto 16px; max-width: 34ch; color: rgba(255, 255, 255, 0.85); font-weight: 500; }
.state-hint { margin: 4px 0 0; font-size: 13px; color: rgba(255, 255, 255, 0.7); }
.state-icon, .check, .pulse {
  width: 64px; height: 64px; margin: 0 auto;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.state-icon { background: var(--yellow); color: var(--ink); font-size: 28px; font-weight: 800; }
.check { background: var(--ok); }
.check svg { width: 34px; height: 34px; fill: var(--white); }
.pulse { background: var(--yellow); position: relative; }
.pulse svg { width: 32px; height: 32px; fill: var(--ink); }
.pulse::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 2px solid var(--yellow); animation: ring 1.8s ease-out infinite;
}

.receipt { margin: 4px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); text-align: left; font-size: 14px; }
.receipt div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.receipt dt { color: rgba(255, 255, 255, 0.7); font-weight: 500; }
.receipt dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }

.brand-foot {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  margin-top: 22px; font-size: 11px; font-weight: 600; color: var(--muted); text-align: center;
}
.brand-foot img { height: 21px; width: auto; }
body.on-pay .brand-foot { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ring { from { transform: scale(0.9); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .pulse::after { animation: none; }
  .btn[aria-busy="true"]::before { animation-duration: 2.4s; }
}
.nowrap { white-space: nowrap; }

/* ── Petits téléphones (≤ 360 px) ─────────────────────────────────────── */
@media (max-width: 360px) {
  .screen { padding-left: 12px; padding-right: 12px; }
  .summary { padding: 12px 12px 10px; }
  .summary-label { font-size: 16px; }
  .summary-strong { font-size: 15px; }
  .summary-small { font-size: 12px; }
  .field-box { padding: 0 12px; }
  .phone { gap: 8px; }
  .flag, .phone-flag { width: 30px; height: 22px; }
  .phone-dial { font-size: 14px; }
  .phone-input { font-size: 16px; letter-spacing: 0; }
  .operators { gap: 10px; }
  .operator::after { width: 18px; height: 18px; top: 5px; right: 5px; }
  .btn { min-height: 52px; font-size: 17px; }
}
@media (max-width: 300px) {
  .operators { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
