/* CC Events — styles publics.
   Volontairement neutres : couleurs et typographie pilotables par variables,
   pour qu'Elementor garde la main sur l'apparence. */

.cce-form,
.cce-ticket,
.cce-lookup {
  /* La couleur d'accent suit le thème du site.
     Ordre : réglage explicite du plugin → couleur « Accent » d'Elementor →
     couleur « Primaire » d'Elementor → gris ardoise neutre. Le repli n'est
     volontairement pas vif : mieux vaut discret que faux. */
  --cce-accent: var(--cce-accent-set,
                    var(--e-global-color-accent,
                        var(--e-global-color-primary, #2f3640)));
  --cce-accent-dark: var(--cce-accent);
  --cce-accent-dark: color-mix(in srgb, var(--cce-accent) 82%, #000);
  --cce-text: #1a1a1a;
  --cce-muted: #6b6b6b;
  --cce-line: #e2e2e2;
  --cce-bg-soft: #fafafa;
  --cce-radius: 10px;
  --cce-error: #c62828;
  --cce-success: #2e7d32;
  color: var(--cce-text);
  max-width: 720px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.5;
}

/* ---------- Bandeau prix ---------- */
.cce-form__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 18px;
  background: var(--cce-bg-soft);
  border-radius: var(--cce-radius);
  margin-bottom: 22px;
}
.cce-form__price-amount { font-size: 26px; font-weight: 700; color: var(--cce-accent); }
.cce-form__price-note { font-size: 14px; color: var(--cce-muted); }
.cce-form__urgency {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: #b35400;
  background: #fff4e5;
  padding: 4px 10px;
  border-radius: 999px;
}

/* ---------- Structure ---------- */
.cce-fieldset { border: 0; padding: 0; margin: 0 0 26px; }
.cce-fieldset legend {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--cce-muted);
  padding: 0 0 10px;
  margin: 0;
  width: 100%;
  border-bottom: 1px solid var(--cce-line);
}
.cce-fieldset legend em { color: var(--cce-accent); font-style: normal; }

.cce-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 16px; }
.cce-field--full { grid-column: 1 / -1; }
@media (max-width: 560px) {
  .cce-grid { grid-template-columns: 1fr; }
}

.cce-field { display: flex; flex-direction: column; gap: 6px; }
.cce-field > span { font-size: 14px; font-weight: 600; }
.cce-field > span em { color: var(--cce-accent); font-style: normal; }
.cce-field input,
.cce-field textarea,
.cce-field select {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid var(--cce-line);
  border-radius: 8px;
  font: inherit;
  font-size: 16px; /* 16px évite le zoom automatique sur iOS */
  background: #fff;
  color: inherit;
}
.cce-field input:focus,
.cce-field textarea:focus {
  outline: 2px solid var(--cce-accent);
  outline-offset: 1px;
  border-color: var(--cce-accent);
}
.cce-field.has-error input,
.cce-field.has-error textarea { border-color: var(--cce-error); }

.cce-hint { font-size: 13px; color: var(--cce-muted); }
.cce-hint--block { margin: 14px 0 12px; }
.cce-hint--center { text-align: center; margin-top: 12px; }
.cce-error { font-size: 13px; color: var(--cce-error); font-weight: 600; }
.cce-error:empty { display: none; }

/* ---------- Tailles ---------- */
.cce-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.cce-chip { position: relative; }
.cce-chip input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.cce-chip span {
  display: block;
  min-width: 54px;
  text-align: center;
  padding: 10px 14px;
  border: 1px solid var(--cce-line);
  border-radius: 8px;
  font-weight: 600;
  transition: all .12s ease;
}
.cce-chip input:checked + span {
  background: var(--cce-accent);
  border-color: var(--cce-accent);
  color: #fff;
}
.cce-chip input:focus-visible + span { outline: 2px solid var(--cce-accent); outline-offset: 2px; }

/* ---------- Groupes de départ ---------- */
.cce-groups { display: flex; flex-direction: column; gap: 8px; }
.cce-group {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--cce-line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.cce-group:hover:not(.is-full) { border-color: var(--cce-accent); }
.cce-group input { margin: 0; accent-color: var(--cce-accent); flex: none; }
.cce-group__dot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.15); flex: none;
}
.cce-group__main { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 0; }
.cce-group__main strong { font-size: 17px; }
.cce-group__color { font-size: 14px; color: var(--cce-muted); }
.cce-group__meta { display: flex; align-items: baseline; gap: 12px; flex: none; }
.cce-group__time { font-weight: 600; font-variant-numeric: tabular-nums; }
.cce-group__slots { font-size: 13px; color: var(--cce-muted); min-width: 74px; text-align: right; }
.cce-group.is-full {
  opacity: .5;
  cursor: not-allowed;
  background: var(--cce-bg-soft);
}
.cce-group.is-full .cce-group__slots { color: var(--cce-error); font-weight: 600; }
@media (max-width: 480px) {
  .cce-group { flex-wrap: wrap; }
  .cce-group__meta {
    box-sizing: border-box; /* sans quoi les 100% + le retrait débordent de l'écran */
    width: 100%;
    justify-content: space-between;
    padding-left: 46px;
  }
  .cce-group__slots { text-align: left; }
}

/* ---------- Options et consentement ---------- */
.cce-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--cce-line);
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
}
.cce-option input { margin: 3px 0 0; accent-color: var(--cce-accent); flex: none; }
.cce-option__label { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.cce-option__label strong { font-weight: 600; font-size: 15px; }
.cce-option__label small { font-size: 13px; color: var(--cce-muted); }
.cce-option__label a { color: var(--cce-accent); }
.cce-option__price { font-weight: 600; font-size: 14px; white-space: nowrap; }

.cce-consent { margin: 26px 0; }
.cce-consent.has-error .cce-option { border-color: var(--cce-error); }

/* Masqué sans décalage négatif : un left:-9999px élargit la zone de défilement
   sur certains navigateurs mobiles. */
.cce-honeypot {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Validation et envoi ---------- */
.cce-submit {
  border-top: 1px solid var(--cce-line);
  padding-top: 20px;
}
.cce-total { font-size: 17px; margin-bottom: 14px; text-align: right; }
.cce-total strong { font-size: 22px; color: var(--cce-accent); }

.cce-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 20px;
  background: var(--cce-accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s ease;
}
.cce-button:hover:not(:disabled) { background: var(--cce-accent-dark); }
.cce-button:disabled { opacity: .6; cursor: progress; }
.cce-button__spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cce-spin .7s linear infinite;
}
@keyframes cce-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .cce-button__spinner { animation-duration: 2s; }
}

/* ---------- Messages ---------- */
.cce-alert, .cce-notice {
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 15px;
  border-left: 4px solid;
}
.cce-alert--error, .cce-notice--error { background: #fdecea; border-color: var(--cce-error); color: #7f1d1d; }
.cce-alert--warning, .cce-notice--warning { background: #fff4e5; border-color: #ed6c02; color: #7a3e00; }
.cce-notice--info { background: #e8f2fb; border-color: #0277bd; color: #01466e; }
.cce-notice--success { background: #edf7ed; border-color: var(--cce-success); color: #1b5e20; }

/* ---------- Compteur ---------- */
.cce-counter { max-width: 420px; }
.cce-counter__bar {
  height: 10px;
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
}
.cce-counter__bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cce-accent), var(--cce-accent-dark));
  border-radius: 999px;
}
.cce-counter__label { font-size: 14px; color: var(--cce-muted); margin-top: 6px; }
.cce-counter-text { font-weight: 600; }

/* ---------- Billet ---------- */
.cce-ticket {
  border: 1px solid var(--cce-line);
  border-radius: 14px;
  padding: 28px;
  background: #fff;
  text-align: center;
}
.cce-ticket__badge {
  display: inline-block;
  background: #edf7ed;
  color: var(--cce-success);
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.cce-ticket__title { margin: 0 0 4px; font-size: 22px; }
.cce-ticket__name { margin: 0 0 22px; font-size: 17px; color: var(--cce-muted); }
.cce-ticket__qr img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated; /* le QR doit rester net à l'agrandissement */
}
.cce-ticket__ref {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 17px;
  letter-spacing: .06em;
  margin-top: 10px;
  font-weight: 600;
}
.cce-ticket__details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin: 26px 0 0;
  text-align: left;
  border-top: 1px solid var(--cce-line);
  padding-top: 20px;
}
.cce-ticket__details dt { font-size: 13px; color: var(--cce-muted); margin-bottom: 3px; }
.cce-ticket__details dd { margin: 0; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.cce-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.cce-ticket__group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 22px;
  padding: 16px;
  border-radius: 10px;
  background: var(--cce-bg-soft);
  border-left: 6px solid var(--cce-group-color, var(--cce-accent));
}
.cce-ticket__group-code { font-size: 34px; font-weight: 800; line-height: 1; }
.cce-ticket__group-info { display: flex; flex-direction: column; text-align: left; font-size: 14px; }
.cce-ticket__note {
  margin-top: 20px;
  padding: 14px;
  background: #fff8e1;
  border-radius: 8px;
  font-size: 14px;
  text-align: left;
}
.cce-ticket__footer { font-size: 13px; color: var(--cce-muted); margin: 20px 0 0; }

.cce-lookup h2 { margin-top: 0; }
.cce-lookup__form { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }

@media print {
  .cce-ticket { border: 0; padding: 0; }
  .cce-ticket__footer, .cce-ticket__note { display: none; }
}

/* ---------- Gestion de son inscription ---------- */
.cce-manage { margin-top: 26px; text-align: left; }
.cce-manage__block {
  border: 1px solid var(--cce-line);
  border-radius: 10px;
  padding: 0;
  margin-bottom: 10px;
  background: #fff;
}
.cce-manage__block > summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cce-manage__block > summary::-webkit-details-marker { display: none; }
.cce-manage__block > summary::after {
  content: '+';
  font-size: 22px;
  line-height: 1;
  color: var(--cce-muted);
  flex: none;
}
.cce-manage__block[open] > summary::after { content: '−'; }
/* Le retrait s'applique au contenu, pas aux boutons : sinon il écrase leur
   propre padding et ils se collent aux bords du bloc. */
.cce-manage__block > *:not(summary):not(.cce-button) { padding-left: 16px; padding-right: 16px; }
.cce-manage__block > *:last-child:not(.cce-button) { padding-bottom: 16px; }
.cce-manage__block > .cce-button {
  width: calc(100% - 32px);
  margin: 4px 16px 16px;
  padding: 14px 20px;
}
.cce-manage__block .cce-groups,
.cce-manage__block .cce-grid { margin-bottom: 14px; }
.cce-manage__block--quiet { background: var(--cce-bg-soft); border-style: dashed; }

.cce-button--danger { background: var(--cce-error); }
.cce-button--danger:hover:not(:disabled) { background: #9a1f1f; }

.cce-history { list-style: none; margin: 0; padding: 0 16px 16px; font-size: 14px; }
.cce-history li {
  padding: 8px 0;
  border-bottom: 1px solid var(--cce-line);
  display: flex;
  gap: 12px;
}
.cce-history li:last-child { border-bottom: 0; }
.cce-history span { color: var(--cce-muted); flex: none; font-variant-numeric: tabular-nums; }

.cce-alert--success { background: #edf7ed; border-color: var(--cce-success); color: #1b5e20; }

.cce-waitlist .cce-ticket__group-info span { font-size: 13px; color: var(--cce-muted); }

.cce-invite { display: flex; gap: 10px; align-items: flex-end; margin-top: 16px; }
.cce-invite .cce-field { flex: 1; }
.cce-invite .cce-button { width: auto; margin: 0; padding: 11px 18px; flex: none; }
.cce-button--ghost { background: transparent; color: var(--cce-accent); border: 1px solid var(--cce-accent); }
.cce-button--ghost:hover:not(:disabled) { background: rgba(194,24,91,.06); }
.cce-invite__ok { display: block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--cce-success); }

/* ---------- Liste de billets ---------- */
.cce-tickets {
  --cce-accent: var(--cce-accent-set,
                    var(--e-global-color-accent,
                        var(--e-global-color-primary, #2f3640)));
  --cce-muted: #6b6b6b;
  --cce-line: #e2e2e2;
  --cce-bg-soft: #fafafa;
  max-width: 720px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.5;
}
.cce-tickets__head { margin-bottom: 22px; }
.cce-tickets__head h2 { margin: 0 0 4px; font-size: 24px; }
.cce-tickets__head p { margin: 0; color: var(--cce-muted); font-size: 14px; }

.cce-tickets__item {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  border: 1px solid var(--cce-line);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
  background: #fff;
}
.cce-tickets__item.is-pending { background: var(--cce-bg-soft); }

.cce-tickets__qr { flex: none; width: 160px; }
.cce-tickets__qr img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}
.cce-tickets__placeholder {
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  box-sizing: border-box;
  border: 2px dashed var(--cce-line);
  border-radius: 8px;
  color: var(--cce-muted);
  font-size: 13px;
  font-weight: 600;
}

.cce-tickets__body { flex: 1; min-width: 0; }
.cce-tickets__body h3 { margin: 0 0 2px; font-size: 19px; }
.cce-tickets__ref {
  margin: 0 0 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  letter-spacing: .04em;
  color: var(--cce-muted);
}
.cce-tickets__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 0 0 12px;
}
.cce-tickets__meta dt { font-size: 12px; color: var(--cce-muted); margin-bottom: 1px; }
.cce-tickets__meta dd { margin: 0; font-weight: 600; display: flex; align-items: center; gap: 6px; font-size: 15px; }
.cce-tickets__meta dd small { font-weight: 400; color: var(--cce-muted); }
.cce-tickets__offer {
  margin: 0 0 12px;
  padding: 8px 12px;
  background: #edf7ed;
  border-radius: 6px;
  font-size: 14px;
  color: #1b5e20;
}
.cce-tickets__link { font-size: 14px; font-weight: 600; color: var(--cce-accent); }

@media (max-width: 560px) {
  .cce-tickets__item { flex-direction: column; align-items: center; text-align: center; }
  .cce-tickets__meta { justify-content: center; }
  .cce-tickets__meta dd { justify-content: center; }
}

/* ---------- Blocs participants ---------- */
.cce-participant {
  border: 1px solid var(--cce-line);
  border-radius: 10px;
  padding: 4px 16px 16px;
  margin-bottom: 14px;
  background: #fff;
}
.cce-participant legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: auto;
  border: 0;
  padding: 0 8px;
  margin-left: -8px;
}
.cce-participant__title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--cce-accent);
}
.cce-participant__remove {
  background: transparent;
  border: 0;
  color: var(--cce-muted);
  font-size: 17px;
  line-height: 1;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
}
.cce-participant__remove:hover { background: #fdecea; color: var(--cce-error); }
.cce-participant__remove[hidden] { display: none; }

.cce-subfield { display: block; margin-top: 18px; }
.cce-subfield__label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cce-subfield__label em { color: var(--cce-accent); font-style: normal; }
.cce-subfield .cce-chips { margin-top: 8px; }
.cce-subfield.has-error .cce-groups,
.cce-subfield.has-error .cce-chips { outline: 2px solid var(--cce-error); outline-offset: 6px; border-radius: 8px; }

.cce-add-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 26px;
}
.cce-add-row .cce-button { width: auto; margin: 0; padding: 11px 18px; flex: none; }
.cce-add-row .cce-button:disabled { opacity: .5; cursor: not-allowed; }

.cce-total__detail { color: var(--cce-muted); font-size: 14px; }

/* Retour vers la liste de tous les billets d'une même adresse. */
.cce-ticket__back { margin: 22px 16px 6px; text-align: center; }
.cce-button--ghost {
  display: inline-block;
  width: auto;
  background: transparent;
  color: #444;
  border: 1px solid #ddd;
  padding: 11px 22px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}
.cce-button--ghost:hover { background: #f6f6f6; color: #111; border-color: #c9c9c9; }
