/* YAP-038 : « Utiliser un code », « Offrir un pack », retour de paiement.
   Classes .yg-* seulement ; reprend les jetons de drop.css (valeurs de repli si absents). */
.yg-redeem, .yg-gift-entry, .yg-banner, .yg-sheet {
  --yg-ink: var(--ink, #121216);
  --yg-ink-2: var(--ink-2, #171318);
  --yg-surface: var(--surface, #211f24);
  --yg-surface-2: var(--surface-2, #2d292f);
  --yg-line: var(--line, #4b4548);
  --yg-text: var(--text, #f8f6f4);
  --yg-muted: var(--muted, #b3abae);
  --yg-coral: var(--coral, #ff6b5e);
  --yg-coral-soft: var(--coral-soft, #ff8b80);
  --yg-on-coral: var(--on-coral, #171318);
  --yg-focus: var(--focus, #ffaaa2);
  --yg-ok: var(--ok, #7be0a6);
  --yg-danger: #ff9b92;
  --yg-display: var(--font-display, "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", Impact, sans-serif);
  --yg-body: var(--font-body, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  --yg-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;
  --yg-ease: var(--ease, cubic-bezier(.2, .8, .2, 1));
  --yg-squad: linear-gradient(135deg, #ff9a8f, #ff6b5e 48%, #e5503f);
  --yg-saison: linear-gradient(135deg, #fff1b8, #f0c95e 40%, #e8b847 62%, #c99122);
  --yg-legendaire: linear-gradient(120deg, #7ef0ff, #b48cff 36%, #ff8bd1 70%, #ffe48a);
  font-family: var(--yg-body);
  color: var(--yg-text);
}
.yg-redeem *, .yg-gift-entry *, .yg-banner *, .yg-sheet * { box-sizing: border-box; }
.yg-redeem :focus-visible, .yg-gift-entry :focus-visible, .yg-sheet :focus-visible { outline: 3px solid var(--yg-focus); outline-offset: 3px; }
.yg-redeem p, .yg-sheet p, .yg-sheet h2, .yg-banner p { margin: 0; }
.yg-redeem button, .yg-sheet button, .yg-sheet input, .yg-sheet select, .yg-sheet textarea, .yg-redeem input, .yg-gift-entry button { font: inherit; color: inherit; }
.yg-sheet [hidden], .yg-redeem [hidden], .yg-gift-entry[hidden] { display: none !important; }

/* Pictos dessinés en CSS (pas d'image, pas d'emoji) */
.yg-ticket-icon {
  position: relative; display: inline-block; flex: none; width: 20px; height: 14px; border-radius: 3px;
  background: currentColor; -webkit-mask: radial-gradient(circle at 0 50%, transparent 3px, #000 3.5px) left / 51% 100% no-repeat, radial-gradient(circle at 100% 50%, transparent 3px, #000 3.5px) right / 51% 100% no-repeat;
  mask: radial-gradient(circle at 0 50%, transparent 3px, #000 3.5px) left / 51% 100% no-repeat, radial-gradient(circle at 100% 50%, transparent 3px, #000 3.5px) right / 51% 100% no-repeat;
}
.yg-gift-icon {
  position: relative; display: inline-block; flex: none; width: 22px; height: 20px;
  background:
    linear-gradient(currentColor, currentColor) 50% 0 / 4px 100% no-repeat,
    linear-gradient(currentColor, currentColor) 0 6px / 100% 3px no-repeat;
  border: 2.5px solid currentColor; border-radius: 4px;
}

/* — Utiliser un code — */
.yg-redeem { display: grid; gap: 10px; }
.yg-redeem-toggle {
  justify-self: center; display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 14px;
  border: 0; border-radius: 999px; background: transparent; color: var(--yg-coral-soft); font-size: 14.5px; font-weight: 800;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; cursor: pointer;
}
.yg-redeem.is-open .yg-redeem-toggle { text-decoration: none; }
.yg-redeem-form {
  display: grid; gap: 8px; padding: 14px; border: 1px solid var(--yg-line); border-radius: 18px;
  background: var(--yg-surface); animation: yg-fade .22s var(--yg-ease);
}
.yg-redeem-row { display: flex; gap: 8px; }
.yg-label { color: var(--yg-muted); font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.yg-code-input {
  flex: 1; min-width: 0; min-height: 50px; padding: 0 14px; border: 1.5px solid var(--yg-line); border-radius: 14px;
  background: var(--yg-ink); color: var(--yg-text); font-family: var(--yg-mono); font-size: 19px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase;
}
.yg-code-input::placeholder { color: color-mix(in srgb, var(--yg-muted) 55%, transparent); letter-spacing: .08em; }
.yg-code-input[aria-invalid="true"] { border-color: var(--yg-danger); }
.yg-code-input:read-only { border-color: var(--yg-ok); color: var(--yg-ok); }
.yg-btn {
  display: inline-grid; place-items: center; min-height: 50px; padding: 0 18px; border-radius: 14px; border: 0;
  font-size: 15.5px; font-weight: 800; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.yg-btn:disabled { cursor: default; opacity: .55; }
.yg-btn-primary { background: var(--yg-coral); color: var(--yg-on-coral); }
.yg-btn-ghost { border: 1.5px solid var(--yg-line); background: transparent; color: var(--yg-text); }
.yg-hint { color: var(--yg-muted); font-size: 12.5px; font-weight: 600; }
.yg-msg { min-height: 0; font-size: 13.5px; font-weight: 700; }
.yg-msg:empty { display: none; }
.yg-msg.is-error { color: var(--yg-danger); }
.yg-msg.is-ok { color: var(--yg-ok); }
.yg-redeem.is-done .yg-hint { display: none; }

/* — Bandeau « Un cadeau t'attend » — */
.yg-banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px;
  background: linear-gradient(120deg, color-mix(in srgb, #b48cff 22%, var(--yg-surface)), var(--yg-surface) 60%);
  border: 1px solid color-mix(in srgb, #b48cff 40%, var(--yg-line));
}
.yg-banner .yg-gift-icon { color: #ffe48a; }
.yg-banner-title { font-weight: 800; font-size: 14.5px; }
.yg-banner-text { color: var(--yg-muted); font-size: 13px; font-weight: 600; }
.yg-banner .yg-nowrap { white-space: nowrap; }

/* — Bouton « Offrir un pack » — */
.yg-gift-cta {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 10px 16px;
  border: 1.5px solid color-mix(in srgb, var(--yg-coral) 55%, var(--yg-line)); border-radius: 18px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--yg-coral) 18%, var(--yg-surface)), var(--yg-surface) 70%);
  color: var(--yg-text); text-align: left; cursor: pointer;
}
.yg-gift-cta .yg-gift-icon { color: var(--yg-coral); }
.yg-cta-text { display: grid; gap: 1px; }
.yg-cta-main { font-family: var(--yg-display); font-size: 22px; font-weight: 900; line-height: 1; text-transform: uppercase; letter-spacing: .01em; }
.yg-cta-sub { color: var(--yg-muted); font-size: 12.5px; font-weight: 700; }

/* — Feuille (dialog) : en bas sur téléphone, centrée au-delà de 700 px — */
.yg-sheet {
  width: 100%; max-width: 520px; max-height: min(94dvh, 940px); margin: auto auto 0; padding: 0; border: 0;
  border-radius: 26px 26px 0 0; background: radial-gradient(circle at 92% 0, #33242b 0, var(--yg-ink-2) 360px) var(--yg-ink-2); color: var(--yg-text);
  box-shadow: 0 -18px 60px -20px rgb(0 0 0 / .8), 0 0 0 1px color-mix(in srgb, var(--yg-line) 70%, transparent);
  overflow: hidden; overscroll-behavior: contain;
}
.yg-sheet[open] { display: flex; flex-direction: column; animation: yg-up .32s var(--yg-ease); }
.yg-sheet::backdrop { background: rgb(8 6 10 / .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@media (min-width: 700px) {
  .yg-sheet { margin: auto; border-radius: 26px; max-height: min(90dvh, 940px); }
  .yg-sheet[open] { animation-name: yg-pop; }
}
.yg-sheet-inner { flex: 1 1 auto; display: flex; flex-direction: column; width: 100%; min-height: 0; }
.yg-sheet-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 10px;
}
.yg-eyebrow { color: var(--yg-coral-soft); font-size: 11.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.yg-sheet-title { margin-top: 4px; font-family: var(--yg-display); font-size: clamp(30px, 8vw, 40px); font-weight: 900; line-height: .92; text-transform: uppercase; text-wrap: balance; overflow-wrap: break-word; hyphens: auto; }
.yg-sheet-title:focus { outline: none; }
.yg-close {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--yg-line); border-radius: 50%;
  background: var(--yg-surface); color: var(--yg-text); font-size: 24px; line-height: 1; cursor: pointer;
}
.yg-sheet-body {
  flex: 1 1 auto; display: grid; align-content: start; gap: 16px; padding: 4px 20px max(20px, env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior: contain; min-height: 0;
}
.yg-lead { color: var(--yg-muted); font-size: 14.5px; font-weight: 600; line-height: 1.45; }

/* Paliers : trois cartes radio + ce que contient le palier choisi */
.yg-tiers { margin: 0; padding: 0; border: 0; display: grid; gap: 10px; min-width: 0; }
.yg-tiers legend { padding: 0; margin-bottom: 10px; }
.yg-tier-grid { position: relative; display: grid; grid-template-columns: 1fr; gap: 8px; }
.yg-radio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
/* Téléphone : une ligne par palier (nom long en néerlandais ou en allemand compris). */
.yg-tier {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "swatch name price" "swatch tag price";
  align-items: center; column-gap: 12px; row-gap: 2px; min-height: 62px; padding: 10px 46px 10px 14px;
  border: 1.5px solid var(--yg-line); border-radius: 16px; background: var(--yg-surface); cursor: pointer;
  transition: border-color .15s, transform .15s var(--yg-ease), background-color .15s;
}
.yg-tier-swatch { grid-area: swatch; display: block; width: 10px; height: 36px; border-radius: 5px; }
.yg-tier.is-squad .yg-tier-swatch { background: var(--yg-squad); }
.yg-tier.is-saison .yg-tier-swatch { background: var(--yg-saison); }
.yg-tier.is-legendaire .yg-tier-swatch { background: var(--yg-legendaire); }
.yg-tier-name { grid-area: name; font-family: var(--yg-display); font-size: 22px; font-weight: 900; line-height: 1; text-transform: uppercase; overflow-wrap: anywhere; }
.yg-tier-price { grid-area: price; font-size: 16px; font-weight: 800; }
.yg-tier-tag { grid-area: tag; color: var(--yg-muted); font-size: 12px; font-weight: 700; line-height: 1.25; }
@media (min-width: 560px) {
  .yg-tier-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .yg-tier { grid-template-columns: 1fr; grid-template-areas: "swatch" "name" "price" "tag"; align-content: start; align-items: start; row-gap: 3px; min-height: 104px; padding: 12px 12px 11px; }
  .yg-tier-swatch { width: 26px; height: 6px; border-radius: 3px; margin-bottom: 6px; }
}
.yg-radio:checked + .yg-tier { border-color: var(--yg-coral); background: color-mix(in srgb, var(--yg-coral) 10%, var(--yg-surface)); transform: translateY(-2px); }
.yg-radio:checked + .yg-tier::after {
  content: ""; position: absolute; top: 50%; right: 14px; margin-top: -9px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--yg-coral) radial-gradient(circle, var(--yg-on-coral) 0 3px, transparent 3.5px);
}
.yg-radio:focus-visible + .yg-tier { outline: 3px solid var(--yg-focus); outline-offset: 3px; }
@media (min-width: 560px) { .yg-radio:checked + .yg-tier::after { top: 9px; right: 9px; margin-top: 0; } }
.yg-includes { padding: 12px 14px; border-radius: 14px; background: var(--yg-surface); display: grid; gap: 6px; }
.yg-includes-title { font-size: 13px; font-weight: 800; }
.yg-includes-plus { color: var(--yg-muted); font-size: 12.5px; font-weight: 700; }
.yg-includes-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.yg-includes-list li { position: relative; padding-left: 18px; font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.yg-includes-list li::before { content: "✦"; position: absolute; left: 0; top: 0; color: var(--yg-coral); font-size: 12px; }

/* Champs */
.yg-field { display: grid; gap: 7px; min-width: 0; }
.yg-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.yg-optional { color: var(--yg-muted); font-size: 12px; font-weight: 600; }
.yg-input {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 1.5px solid var(--yg-line); border-radius: 14px;
  background: var(--yg-ink); color: var(--yg-text); font-size: 16px; font-weight: 600;
}
.yg-input::placeholder { color: color-mix(in srgb, var(--yg-muted) 60%, transparent); }
.yg-input[aria-invalid="true"] { border-color: var(--yg-danger); }
.yg-select {
  appearance: none; -webkit-appearance: none; padding-right: 42px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--yg-muted) 50%), linear-gradient(-45deg, transparent 50%, var(--yg-muted) 50%);
  background-position: calc(100% - 23px) 52%, calc(100% - 17px) 52%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.yg-textarea { min-height: 92px; resize: vertical; line-height: 1.4; }
.yg-counter { justify-self: end; color: var(--yg-muted); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.yg-counter.is-over { color: var(--yg-danger); }
.yg-field-err { color: var(--yg-danger); font-size: 13px; font-weight: 700; }

/* Aperçu : un morceau de l'e-mail */
.yg-preview { display: grid; gap: 10px; }
.yg-preview-card {
  display: grid; gap: 12px; padding: 16px; border-radius: 20px; border: 1px solid var(--yg-line);
  background: radial-gradient(circle at 85% 0, #33242b 0, var(--yg-ink) 75%);
}
.yg-preview-from { font-family: var(--yg-display); font-size: 24px; font-weight: 900; line-height: .95; text-transform: uppercase; overflow-wrap: break-word; hyphens: auto; }
.yg-preview-note {
  padding: 10px 12px; border-radius: 12px; background: var(--paper, #f6efe6); color: var(--paper-ink, #2b2226);
  font-size: 14px; font-weight: 600; line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere;
}
.yg-preview-cta { justify-self: stretch; display: grid; place-items: center; min-height: 42px; border-radius: 12px; background: var(--yg-coral); color: var(--yg-on-coral); font-size: 14px; font-weight: 800; }

/* Ticket miniature (aperçu et retour) */
.yg-mini-ticket { position: relative; display: grid; border-radius: 16px; color: #171318; background: var(--yg-saison); overflow: hidden; }
.yg-mini-ticket.is-squad { background: var(--yg-squad); }
.yg-mini-ticket.is-legendaire { background: var(--yg-legendaire); }
.yg-mt-top, .yg-mt-bottom { display: grid; gap: 4px; padding: 14px 18px; }
.yg-mt-top { padding-bottom: 10px; }
.yg-mt-bottom { padding-top: 10px; }
.yg-mt-label { font-size: 10.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; opacity: .78; }
.yg-mt-code { font-family: var(--yg-mono); font-size: clamp(20px, 6.4vw, 27px); font-weight: 800; letter-spacing: .06em; white-space: nowrap; user-select: all; -webkit-user-select: all; }
.yg-mt-tier { font-family: var(--yg-display); font-size: 20px; font-weight: 900; line-height: 1; text-transform: uppercase; overflow-wrap: anywhere; }
.yg-mt-once { font-size: 12px; font-weight: 700; opacity: .8; }
.yg-mt-perf { position: relative; height: 20px; }
.yg-mt-perf::before { content: ""; position: absolute; left: 14px; right: 14px; top: 50%; border-top: 2px dashed rgb(23 19 24 / .35); }
.yg-mt-perf::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 0 50%, var(--yg-ink) 0 9px, transparent 9.5px), radial-gradient(circle at 100% 50%, var(--yg-ink) 0 9px, transparent 9.5px);
}
.yg-return .yg-mt-perf::after { background: radial-gradient(circle at 0 50%, var(--yg-ink-2) 0 9px, transparent 9.5px), radial-gradient(circle at 100% 50%, var(--yg-ink-2) 0 9px, transparent 9.5px); }

.yg-note { color: var(--yg-muted); font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.yg-note.is-test { padding: 8px 10px; border-radius: 10px; background: var(--yg-surface); }
.yg-pay { width: 100%; min-height: 56px; font-size: 17px; border-radius: 16px; box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--yg-coral) 80%, transparent); }

/* Retour de paiement */
.yg-return-badge {
  display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 10px; border-radius: 14px;
  background: var(--yg-legendaire);
}
.yg-return-badge::before {
  content: ""; width: 22px; height: 20px; border: 2.5px solid #171318; border-radius: 4px;
  background: linear-gradient(#171318, #171318) 50% 0 / 4px 100% no-repeat, linear-gradient(#171318, #171318) 0 6px / 100% 3px no-repeat;
}
.yg-status-row { display: flex; align-items: center; gap: 12px; }
.yg-spinner { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--yg-surface-2); border-top-color: var(--yg-coral); animation: yg-spin .9s linear infinite; }
.yg-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.yg-done { width: 100%; }

@keyframes yg-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes yg-pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes yg-fade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes yg-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .yg-sheet[open], .yg-redeem-form { animation: none; }
  .yg-spinner { animation-duration: 3s; }
  .yg-tier, .yg-radio:checked + .yg-tier { transition: none; transform: none; }
}
@media (max-width: 360px) {
  .yg-actions { grid-template-columns: 1fr; }
}


/* YAP-042 : grand écran (≥ 1024 px). La feuille cadeau passe en deux colonnes : formulaire à
   gauche, aperçu du cadeau à droite (collant pendant le défilement). Téléphone inchangé. */
@media (min-width: 1024px) {
  .yg-sheet:not(.yg-return) { max-width: min(1040px, calc(100vw - 96px)); }
  .yg-sheet:not(.yg-return) .yg-sheet-head { padding: 28px 32px 12px; }
  .yg-sheet:not(.yg-return) .yg-sheet-title { font-size: 52px; }
  .yg-sheet:not(.yg-return) .yg-sheet-body {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); column-gap: 36px; row-gap: 18px;
    padding: 4px 32px 32px;
  }
  .yg-sheet:not(.yg-return) .yg-sheet-body > * { grid-column: 1; }
  .yg-sheet:not(.yg-return) .yg-sheet-body > .yg-preview { grid-column: 2; grid-row: 1 / span 6; align-self: start; position: sticky; top: 0; }
  .yg-sheet .yg-lead { font-size: 15.5px; }
  .yg-sheet .yg-preview-from { font-size: 30px; }
  .yg-banner { padding: 14px 18px; }
  .yg-banner-title { font-size: 16px; }
  .yg-banner-text { font-size: 14px; }
}

/* YAP-039 : renonciation au droit de rétractation avant le paiement du cadeau. */
.yg-waiver { display: grid; gap: 6px; }
.yg-waiver-label { display: flex; align-items: flex-start; gap: 12px; color: var(--yg-text); font-size: 13.5px; font-weight: 600; line-height: 1.45; cursor: pointer; }
.yg-waiver-box { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--yg-coral); cursor: pointer; }
.yg-waiver-box:focus-visible { outline: 3px solid var(--yg-focus); outline-offset: 2px; }
.yg-waiver-box[aria-invalid="true"] { outline: 2px solid var(--yg-danger); outline-offset: 2px; }
.yg-waiver-terms { color: var(--yg-coral); font-weight: 750; }
