/*
  La base della pagina di prenotazione (GET /prenota/{codice}, Analisi/PAGE_BUILDER.md).

  Sta sotto il layout composto nel builder: il CSS della pagina arriva DOPO e vince. Le variabili
  qui sotto sono il modo pulito di cambiare colori e caratteri anche al modulo di prenotazione, che
  e' nostro e non si smonta: basta ridefinirle nel layout (per esempio su body).

  Tutte le classi sono prefissate c3k-: il layout puo' usare "card" o "grid" senza toccare il modulo.
*/

/* Caratteri serviti da noi, come nel backend: si scaricano solo se il layout li usa. */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("/fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("/fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("/fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("/fonts/barlow-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --c3k-accent: #F99A1C;       /* arancio del marchio: fondo dei pulsanti */
  --c3k-accent-hover: #f08a05;
  --c3k-on-accent: #1F1405;    /* testo SUL pulsante arancio: 8,3:1 (il bianco farebbe 2,2:1) */
  --c3k-accent-ink: #8F4E04;   /* testo arancio su bianco: 5,7:1 */
  --c3k-control: #C46A00;      /* caselle spuntate, anello di focus: 3,9:1 su bianco */
  --c3k-ink: #1c2330;
  --c3k-muted: #56637a;
  --c3k-line: #d6dde6;
  --c3k-field-line: #9aa6b6;   /* bordo dei campi: 3:1 contro il bianco */
  --c3k-bg: #ffffff;
  --c3k-soft: #f5f7fa;
  --c3k-ok: #17744a;
  --c3k-ok-soft: #e2f3e9;
  --c3k-err: #b0342a;
  --c3k-err-soft: #fbe7e4;
  --c3k-warn-soft: #fff3d1;
  --c3k-radius: 12px;
  --c3k-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--c3k-bg); color: var(--c3k-ink); font: 16px/1.45 var(--c3k-font); }
img, video, iframe { max-width: 100%; }
img { height: auto; }
h1 { font-size: 28px; line-height: 1.15; }
a { color: var(--c3k-accent-ink); }
:focus-visible { outline: 2px solid var(--c3k-control); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ blocchi collegati all'evento */
[data-c3k="summary"], [data-c3k="description"], [data-c3k="directions"] { white-space: pre-line; }
.c3k-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.c3k-pill.ok { background: var(--c3k-ok-soft); color: var(--c3k-ok); }
.c3k-pill.warn { background: var(--c3k-warn-soft); color: #6f4800; }
.c3k-pill.no { background: var(--c3k-err-soft); color: var(--c3k-err); }
[data-c3k="book-button"] {
  display: inline-block; padding: 14px 22px; border-radius: var(--c3k-radius); background: var(--c3k-accent);
  color: var(--c3k-on-accent); font-weight: 800; text-decoration: none;
}
[data-c3k="book-button"]:hover { background: var(--c3k-accent-hover); }
[data-c3k="image"] { display: block; width: 100%; object-fit: cover; border-radius: var(--c3k-radius); }

/* Domande frequenti: <details> funziona anche senza script. */
.c3k-faq details { border-bottom: 1px solid var(--c3k-line); padding: 12px 0; }
.c3k-faq summary { cursor: pointer; font-weight: 700; }

/* ------------------------------------------------------------ il modulo di prenotazione */
[data-c3k="booking"] { font-family: var(--c3k-font); }
:is([data-c3k="booking"], [data-c3k="quick-booking"], [data-c3k="cart"], [data-c3k="checkout"], [data-c3k="form"]) h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--c3k-muted); margin: 26px 0 10px; }
.c3k-card { border: 1px solid var(--c3k-line); border-radius: var(--c3k-radius); padding: 16px; background: var(--c3k-bg); }
.c3k-stepper { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.c3k-stepper button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--c3k-field-line); background: var(--c3k-bg);
  font-size: 22px; cursor: pointer; color: var(--c3k-ink); }
.c3k-stepper button:disabled { opacity: .35; cursor: default; }
.c3k-stepper output { font-size: 26px; font-weight: 700; min-width: 40px; text-align: center; }
.c3k-price { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--c3k-line); }
.c3k-price .c3k-total { font-size: 28px; font-weight: 800; }
.c3k-price .c3k-why { color: var(--c3k-muted); font-size: 14px; }
.c3k-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.c3k-grid .c3k-full { grid-column: 1 / -1; }
@media (max-width: 460px) { .c3k-grid { grid-template-columns: 1fr; } }
:is([data-c3k="booking"], [data-c3k="quick-booking"], [data-c3k="cart"], [data-c3k="checkout"], [data-c3k="form"]) label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
:is([data-c3k="booking"], [data-c3k="quick-booking"], [data-c3k="cart"], [data-c3k="checkout"], [data-c3k="form"]) input[type=text], :is([data-c3k="booking"], [data-c3k="quick-booking"], [data-c3k="cart"], [data-c3k="checkout"], [data-c3k="form"]) input[type=email], :is([data-c3k="booking"], [data-c3k="quick-booking"], [data-c3k="cart"], [data-c3k="checkout"], [data-c3k="form"]) input[type=tel],
:is([data-c3k="booking"], [data-c3k="quick-booking"], [data-c3k="cart"], [data-c3k="checkout"], [data-c3k="form"]) input[type=number], :is([data-c3k="booking"], [data-c3k="quick-booking"], [data-c3k="cart"], [data-c3k="checkout"], [data-c3k="form"]) input[type=date], :is([data-c3k="booking"], [data-c3k="quick-booking"], [data-c3k="cart"], [data-c3k="checkout"], [data-c3k="form"]) textarea, :is([data-c3k="booking"], [data-c3k="quick-booking"], [data-c3k="cart"], [data-c3k="checkout"], [data-c3k="form"]) select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--c3k-field-line); border-radius: var(--c3k-field-radius, 10px); font: inherit; background: var(--c3k-bg); color: var(--c3k-ink); }
:is([data-c3k="booking"], [data-c3k="quick-booking"], [data-c3k="cart"], [data-c3k="checkout"], [data-c3k="form"]) input:focus, :is([data-c3k="booking"], [data-c3k="quick-booking"], [data-c3k="cart"], [data-c3k="checkout"], [data-c3k="form"]) textarea:focus, :is([data-c3k="booking"], [data-c3k="quick-booking"], [data-c3k="cart"], [data-c3k="checkout"], [data-c3k="form"]) select:focus {
  outline: 2px solid var(--c3k-control); outline-offset: 1px; border-color: var(--c3k-control); }
.c3k-choice { display: flex; gap: 8px; flex-wrap: wrap; }
:is([data-c3k="booking"], [data-c3k="quick-booking"], [data-c3k="cart"], [data-c3k="checkout"], [data-c3k="form"]) .c3k-choice label { font-weight: 500; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px;
  border: 1px solid var(--c3k-field-line); border-radius: var(--c3k-field-radius, 10px); cursor: pointer; margin: 0; }
.c3k-choice input, .c3k-consent input { accent-color: var(--c3k-control); }
.c3k-participant { display: grid; grid-template-columns: 28px 1fr 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.c3k-participant .c3k-n { color: var(--c3k-muted); font-weight: 700; text-align: center; }
@media (max-width: 460px) { .c3k-participant { grid-template-columns: 22px 1fr; } .c3k-participant .c3k-pfield:last-child { grid-column: 2; } }
/* Le etichette dei nomi dei partecipanti: per i lettori di schermo; un layout le puo' mostrare. */
[data-c3k] .c3k-plabel { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.c3k-pfield input { width: 100%; }
.c3k-field { margin-bottom: 14px; }
.c3k-hint { color: var(--c3k-muted); font-size: 13px; margin-top: 3px; }
.c3k-error-text { color: var(--c3k-err); font-size: 13px; margin-top: 4px; }
.c3k-invalid { border-color: var(--c3k-err) !important; }
:is([data-c3k="booking"], [data-c3k="quick-booking"], [data-c3k="cart"], [data-c3k="checkout"], [data-c3k="form"]) .c3k-consent { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: 15px; font-weight: 400; }
.c3k-consent input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.c3k-pay { width: 100%; margin-top: 18px; padding: 16px; border: 0; border-radius: var(--c3k-radius); background: var(--c3k-accent);
  color: var(--c3k-on-accent); font: inherit; font-size: 18px; font-weight: 800; cursor: pointer; }
.c3k-pay:hover { background: var(--c3k-accent-hover); }
.c3k-pay:disabled { opacity: .6; cursor: progress; }
.c3k-notice { border-radius: var(--c3k-radius); padding: 12px 14px; margin-top: 14px; font-size: 15px; }
.c3k-notice.err { background: var(--c3k-err-soft); color: #7b241c; }
.c3k-notice.info { background: var(--c3k-soft); color: var(--c3k-ink); }
.c3k-go { display: block; text-align: center; margin-top: 12px; padding: 14px; border-radius: var(--c3k-radius);
  background: var(--c3k-ink); color: #fff; font-weight: 700; text-decoration: none; }
/* Codice sconto: campo e pulsante sulla stessa riga, il pulsante non si restringe. */
.c3k-coupon { display: flex; gap: 8px; }
.c3k-coupon input { flex: 1 1 auto; min-width: 0; text-transform: uppercase; }
.c3k-btn2 { flex: none; padding: 0 18px; min-height: 44px; border: 1px solid var(--c3k-ink); border-radius: 10px; background: var(--c3k-bg);
  color: var(--c3k-ink); font: inherit; font-weight: 700; cursor: pointer; }
.c3k-btn2:hover { background: var(--c3k-soft); }
.c3k-skeleton { color: var(--c3k-muted); padding: 40px 0; text-align: center; }
.c3k-preview-banner { position: sticky; top: 0; z-index: 10; background: var(--c3k-warn-soft); color: #6f4800; border-bottom: 1px solid var(--c3k-accent);
  padding: 8px 14px; font-size: 14px; font-weight: 600; text-align: center; }
/* Domande per partecipante: sotto il nome di ciascuno, rientrate e separate da una riga. */
.c3k-participant-block { padding-bottom: 6px; margin-bottom: 10px; border-bottom: 1px solid var(--c3k-line); }
.c3k-participant-block:last-child { border-bottom: 0; }
.c3k-pfields { padding-left: 36px; }
@media (max-width: 460px) { .c3k-pfields { padding-left: 30px; } }

/* ------------------------------------------------------------ modulo composto nel builder */
/* Il blocco del modulo prende carattere e colori dalle sue variabili (pannello "Stile del modulo"). */
[data-c3k="booking"] { font-family: var(--c3k-font); color: var(--c3k-ink); }
[data-c3k="booking"].c3k-loading [data-c3k-part] { visibility: hidden; }
.c3k-consents { margin-top: 18px; }
.c3k-pay-note { text-align: center; }
.c3k-auto { margin-top: 14px; }

/* ------------------------------------------------------------ carrello (c3k-shop.js, Analisi/CARRELLO.md) */
:is([data-c3k="quick-booking"], [data-c3k="cart"], [data-c3k="checkout"]) { font-family: var(--c3k-font); color: var(--c3k-ink); }
.c3k-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.c3k-stepper-sm { gap: 8px; flex-wrap: nowrap; }
.c3k-stepper-sm output { font-size: 20px; min-width: 32px; }
.c3k-pay-sm { width: auto; margin-top: 0; padding: 12px 20px; font-size: 16px; }
.c3k-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 14px; }
.c3k-actions .c3k-btn2 { border-radius: var(--c3k-radius); }
.c3k-quick { display: grid; gap: 14px; }
.c3k-quick-title { font-size: 20px; line-height: 1.2; margin: 0 0 4px; text-transform: none; letter-spacing: 0; color: var(--c3k-ink); }
:is([data-c3k="quick-booking"], [data-c3k="checkout"]) h2.c3k-quick-title { font-size: 20px; text-transform: none; letter-spacing: 0; color: var(--c3k-ink); margin: 0 0 4px; }
.c3k-quick-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-weight: 600; }
.c3k-quick-buy { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--c3k-line); }
.c3k-quick-price { font-size: 24px; font-weight: 800; margin-left: auto; align-self: center; }
.c3k-mini { margin-top: 18px; border: 1px solid var(--c3k-line); border-radius: var(--c3k-radius); padding: 16px; background: var(--c3k-soft); }
.c3k-mini h2 { margin-top: 0 !important; }
.c3k-mini ul, .c3k-cart-list { list-style: none; margin: 0; padding: 0; }
.c3k-mini li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--c3k-line); }
.c3k-mini-total, .c3k-sum-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 12px; font-size: 18px; }
.c3k-mini-total strong, .c3k-sum-total strong { font-size: 24px; }
.c3k-cart h2 { margin-top: 4px; }
.c3k-cart-row { display: grid; grid-template-columns: 1fr auto auto 44px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--c3k-line); }
.c3k-cart-price { font-weight: 700; min-width: 80px; text-align: right; }
.c3k-remove { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--c3k-field-line); background: var(--c3k-bg); color: var(--c3k-ink);
  font-size: 22px; line-height: 1; cursor: pointer; }
.c3k-remove:hover { background: var(--c3k-err-soft); color: var(--c3k-err); border-color: var(--c3k-err); }
@media (max-width: 520px) {
  .c3k-cart-row { grid-template-columns: 1fr 44px; }
  .c3k-cart-row .c3k-cart-what { grid-column: 1 / -1; }
  .c3k-cart-row .c3k-cart-price { text-align: left; }
  .c3k-actions > * { flex: 1 1 100%; }
  .c3k-quick-price { margin-left: 0; }
}
.c3k-co-event { margin-top: 16px; }
.c3k-co-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.c3k-co-sub { font-size: 14px; font-weight: 600; margin: 14px 0 8px; }
.c3k-co-fields { margin-top: 12px; }
.c3k-co-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--c3k-line); }
.c3k-co-line strong { font-size: 18px; }
.c3k-sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.c3k-sum-disc { color: var(--c3k-ok); }
.c3k-sum-total { border-top: 1px solid var(--c3k-line); padding-top: 10px; }
.c3k-consent-tight { margin: 0 !important; }

/* Checkout del carrello nell'ordine di EventBooking: tabella, dati per evento, contatti, pagamento. */
.c3k-co-intro p { margin: 0 0 12px; }
.c3k-co-table { width: 100%; border-collapse: collapse; margin: 0 0 16px; }
.c3k-co-table th { padding: 6px 8px; text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--c3k-muted); }
.c3k-co-table td { padding: 10px 8px; border-top: 1px solid var(--c3k-line); vertical-align: middle; }
.c3k-co-table .c3k-co-col-qty { text-align: right; }
.c3k-co-table .c3k-co-col-qty .c3k-stepper { justify-content: flex-end; }
.c3k-co-edit td { text-align: right; }
.c3k-co-coupon { margin: 0 0 12px; }
.c3k-co-actions { justify-content: space-between; align-items: flex-start; }
.c3k-co-actions .c3k-pay { width: auto; flex: 1 1 auto; }

/* ---------- moduli del sito (c3k-form.js, Analisi/FORMS.md) ----------
   Le classi di BreezingForms (bfElemWrap, ff_elem, control-group) restano sui campi per i fogli del sito:
   qui solo la griglia, i casi che il blocco della prenotazione non ha e i campi civetta. */
.c3k-form-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 14px; }
.c3k-form-grid > .c3k-field { grid-column: span 6; }
.c3k-form-grid > .c3k-w-half { grid-column: span 3; }
.c3k-form-grid > .c3k-w-third { grid-column: span 2; }
@media (max-width: 560px) { .c3k-form-grid > .c3k-w-half, .c3k-form-grid > .c3k-w-third { grid-column: span 6; } }
.c3k-form-grid > [hidden] { display: none; }
.c3k-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.c3k-fieldset legend { padding: 0; }
.c3k-req { color: var(--c3k-err); font-style: normal; }
.c3k-req:empty::before { content: "*"; }
.c3k-form-h { margin: 10px 0 6px; font-size: 1.25em; }
[data-c3k="form"] .c3k-consent { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
[data-c3k="form"] input[type=file] { width: 100%; padding: 8px 0; font: inherit; }
.c3k-form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 8px; }
.c3k-form-actions .c3k-pay { width: auto; min-width: 180px; margin-top: 0; margin-left: auto; }
/* Un pulsante o un campo nascosto resta nascosto anche con i fogli del sito (.btn di Bootstrap ha display:inline-block). */
.c3k-form [hidden], .c3k-form-actions [hidden] { display: none !important; }
.c3k-form-step { margin: 0 0 8px; }
.c3k-captcha { margin: 8px 0; }
/* I campi civetta: fuori dallo schermo, non display:none (alcuni robot saltano i campi nascosti). */
.c3k-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* L'avanzamento tra le pagine del modulo (08/10/2026): passi con i nomi, barra, "Passo 1 di 5". */
.c3k-form-progress { margin: 0 0 16px; }
.c3k-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; counter-reset: none; }
.c3k-steps li { display: flex; align-items: center; gap: 8px; color: var(--c3k-muted); font-size: 14px; }
.c3k-steps .c3k-step-n { width: 26px; height: 26px; border-radius: 50%; border: 2px solid currentColor; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.c3k-steps li.done { color: var(--c3k-ink); }
.c3k-steps li.on { color: var(--c3k-ink); font-weight: 700; }
.c3k-steps li.on .c3k-step-n { background: var(--c3k-accent); border-color: var(--c3k-accent); color: var(--c3k-on-accent); }
@media (max-width: 560px) { .c3k-steps li:not(.on) .c3k-step-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
.c3k-bar-title { font-weight: 700; margin-bottom: 6px; }
.c3k-bar { height: 8px; border-radius: 6px; background: var(--c3k-soft); border: 1px solid var(--c3k-line); overflow: hidden; }
.c3k-bar i { display: block; height: 100%; background: var(--c3k-accent); }
.c3k-form-page-intro { margin: 0 0 12px; }
/* I testi introduttivi possono avere dei link (HTML scritto dallo staff): sottolineati, nel colore del testo. */
.c3k-form-page-intro a, [data-c3k="form-intro"] a { color: inherit; text-decoration: underline; }
