@font-face { font-family: "Assafa Romie"; src: url("../assets/fonts/romie-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../assets/fonts/instrument-sans-latin.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }

/* Stessi colori e caratteri del sito assafafood.it */
:root {
  --brand: #a9584a;          /* corallo scurito dei bottoni del sito */
  --brand-ink: #8f4638;
  --brand-soft: #e7ece0;     /* carta un tono più scuro */
  --bg: #f4f6f0;             /* carta con un filo di salvia */
  --sage: #a1b58d;
  --card: #ffffff;
  --ink: #233452;            /* blu notte */
  --muted: #4a5670;
  --line: #d6ddcc;
  --ok: #4f7a3a;
  --err: #8f3328;
  --radius: 8px;
  --serif: "Assafa Romie", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); }
button, input, textarea, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

.page { max-width: 640px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px 32px; }
.top { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 12px 0 22px; }
.logo { width: 170px; height: auto; }
.langs { display: flex; gap: 4px; }
.langs button { border: 0; background: transparent; padding: 6px 9px; border-radius: 99px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; letter-spacing: .04em; }
.langs button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.card { background: var(--card); border-radius: 20px; box-shadow: 0 1px 2px rgba(42,37,34,.04), 0 12px 32px -12px rgba(42,37,34,.12); padding: 28px 22px 26px; min-height: 280px; }
@media (min-width: 560px) { .card { padding: 36px 40px 34px; } }

h1 { font: 600 clamp(26px, 6vw, 32px)/1.15 var(--serif); margin: 0 0 6px; text-align: center; letter-spacing: -.01em; }
.sub { text-align: center; color: var(--muted); margin: 0 0 24px; font-size: 15px; }

.steps { display: flex; gap: 6px; margin: 0 0 26px; }
.steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); transition: background .3s; }
.steps span.on { background: var(--brand); }

.field { margin: 0 0 22px; }
.label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 9px; }
.label .req { color: var(--brand-ink); }

.pax { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; }
.pax button { width: 46px; height: 46px; border-radius: 11px; border: 0; background: var(--bg); font-size: 22px; cursor: pointer; transition: transform .12s, background .15s; }
.pax button:active { transform: scale(.94); }
.pax button:disabled { opacity: .35; cursor: default; }
.pax output { font: 600 22px var(--serif); }
.pax small { display: block; text-align: center; font: 400 12px var(--sans); color: var(--muted); }
.notice { background: var(--brand-soft); color: var(--brand-ink); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-top: 10px; }

/* calendario */
.cal { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 8px; }
.cal-head strong { font: 600 17px var(--serif); text-transform: capitalize; }
.cal-head button { border: 0; background: transparent; width: 40px; height: 40px; border-radius: 10px; font-size: 20px; cursor: pointer; }
.cal-head button:disabled { opacity: .25; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.cal-grid .dow { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 4px 0; }
.cal-grid button { aspect-ratio: 1; border: 0; border-radius: 10px; background: transparent; font-weight: 500; cursor: pointer; font-size: 15px; transition: background .15s, color .15s; }
.cal-grid button:not(:disabled):hover { background: var(--brand-soft); }
.cal-grid button:disabled { color: #c9c0b9; cursor: default; text-decoration: line-through; text-decoration-color: rgba(0,0,0,.12); }
.cal-grid button.today { box-shadow: inset 0 0 0 1px var(--line); }
.cal-grid button[aria-pressed="true"] { background: var(--brand); color: #fff; }

/* orari */
.shift { margin: 0 0 14px; }
.shift h3 { font: 600 13px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.slots button { height: 46px; border-radius: 11px; border: 1px solid var(--line); background: #fff; font-weight: 600; cursor: pointer; transition: all .15s; font-variant-numeric: tabular-nums; }
.slots button:hover:not(:disabled) { border-color: var(--brand); }
.slots button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.slots button:disabled { opacity: .4; cursor: default; }
.empty { color: var(--muted); font-size: 15px; padding: 14px; text-align: center; background: var(--bg); border-radius: 12px; }

/* form */
.grid2 { display: grid; gap: 0 14px; }
@media (min-width: 520px) { .grid2 { grid-template-columns: 1fr 1fr; } }
input[type=text], input[type=email], input[type=tel], textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; background: #fff; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[aria-invalid="true"] { border-color: var(--err); }
textarea { min-height: 92px; resize: vertical; }
.phone { display: flex; gap: 8px; }
.phone select { width: 112px; flex: none; padding-right: 6px; }
.choices { display: grid; gap: 8px; }
.choice { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice input { accent-color: var(--brand); width: 18px; height: 18px; margin: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); margin: 0 0 12px; cursor: pointer; }
.check input { accent-color: var(--brand); width: 18px; height: 18px; margin: 2px 0 0; flex: none; }
.check a { color: var(--ink); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* riepilogo */
.summary { background: var(--bg); border-radius: var(--radius); padding: 18px; margin: 0 0 20px; display: grid; gap: 10px; }
.summary div { display: flex; justify-content: space-between; gap: 16px; font-size: 15px; }
.summary div span:first-child { color: var(--muted); }
.summary div span:last-child { font-weight: 600; text-align: right; }
.conditions { font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin: 0 0 18px; }
.conditions ul { padding-left: 18px; margin: 0 0 8px; }
.conditions li { margin: 0 0 4px; }

/* pulsanti */
.actions { display: flex; gap: 10px; margin-top: 8px; }
.btn { flex: 1; height: 54px; border-radius: 14px; border: 0; background: var(--ink); color: #fff; font-weight: 600; font-size: 16px; cursor: pointer; transition: transform .12s, opacity .15s, background .15s; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .35; cursor: default; }
.btn.brand { background: var(--brand); }
.btn.ghost { flex: 0 0 auto; padding: 0 18px; background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--err); border: 1px solid #ecc9c2; }
.error { color: var(--err); background: #fbecea; border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 0 0 14px; }

/* esito */
.done { text-align: center; padding: 10px 0; }
.done .icon { width: 64px; height: 64px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; margin: 0 auto 16px; font-size: 30px; }
.done p { color: var(--muted); }
.badge { display: inline-block; padding: 4px 11px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--bg); }
.badge.pending { background: #fdf3df; color: #8a5a00; }
.badge.confirmed { background: #e3f1e8; color: var(--ok); }
.badge.cancelled, .badge.rejected, .badge.cancelled_customer { background: #fbecea; color: var(--err); }

.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 22px 8px 0; line-height: 1.7; }
.foot a { color: inherit; }

.loading { display: grid; place-items: center; min-height: 240px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fade { animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade, .spinner { animation: none; } }

/* incorporato in iframe */
body.embed { background: transparent; }
body.embed .top { padding-top: 0; }

/* ---------- Tema del sito ---------- */
body { font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
.logo { width: 150px; }
.card { border-radius: var(--radius); box-shadow: none; padding-top: 40px; }
@media (min-width: 560px) { .card { padding: 52px 48px 44px; } }
h1 { font: 700 clamp(30px, 7vw, 40px)/1.02 var(--serif); letter-spacing: -.02em; text-wrap: balance; }
.pax output, .cal-head strong { font-family: var(--serif); font-weight: 700; }
.steps span { height: 3px; border-radius: 2px; }
.pax, .cal, .summary, .empty, .notice, .error, .choice, .done .icon { border-radius: var(--radius); }
.pax button, .slots button, .cal-grid button, .cal-head button { border-radius: 6px; }
input[type=text], input[type=email], input[type=tel], textarea, select { border-radius: var(--radius); }
.btn { border-radius: var(--radius); height: 52px; }
.btn.brand { background: var(--brand); }
@media (hover: hover) and (pointer: fine) { .btn.brand:hover:not(:disabled) { background: var(--brand-ink); } }
.notice { color: var(--ink); }
.cal-grid button:disabled { color: #b3bba9; }
.done .icon { background: transparent; width: 72px; height: 72px; }
.done .icon img { width: 64px; height: auto; }
.badge { border-radius: 6px; }
.langs button { border-radius: 6px; }

/* ---------- Primo passo: data a finestra, persone, orari ---------- */
.datefield { position: relative; }
.datebtn { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); font-size: 17px; font-weight: 600; cursor: pointer; text-align: left; transition: border-color .15s; }
.datebtn span { flex: 1; text-transform: capitalize; }
.datebtn span.ph { color: var(--muted); font-weight: 500; text-transform: none; }
.datebtn svg { flex: none; color: var(--muted); }
.datebtn[aria-expanded="true"] { border-color: var(--ink); }
.datebtn[aria-expanded="true"] svg:last-child { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) { .datebtn:hover { border-color: var(--ink); } }
.calpop { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(360px, 100%); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 40px -18px rgba(35,52,82,.35); padding: 6px; animation: pop .16s ease-out; transform-origin: top left; }
.calpop .cal { border: 0; padding: 6px; }
.calclose { display: none; }
.calback { display: none; }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(-4px); } to { opacity: 1; transform: none; } }
@media (max-width: 559px) {
  .calback { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(35,52,82,.28); }
  .calpop { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: 100%; border-radius: 14px 14px 0 0; padding: 10px 12px max(14px, env(safe-area-inset-bottom)); animation: sheet .22s cubic-bezier(.23,1,.32,1); }
  .calclose { display: block; width: 100%; height: 48px; margin-top: 6px; border: 0; background: var(--brand-soft); color: var(--ink); border-radius: var(--radius); font-weight: 600; cursor: pointer; }
}
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }
.shift h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.shift-note { font: 500 12.5px var(--sans); letter-spacing: 0; text-transform: none; color: var(--brand-ink); }
.notice.big { padding: 16px; }
.notice.big p { margin: 0 0 12px; }
.notice-actions { display: flex; gap: 8px; }
.notice-actions .btn { display: grid; place-items: center; text-decoration: none; height: 46px; }
.modalback { position: fixed; inset: 0; z-index: 30; background: rgba(35,52,82,.35); animation: fadein .15s; }
.modal { position: fixed; z-index: 31; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100% - 32px)); background: #fff; border-radius: var(--radius); padding: 26px 24px 22px; box-shadow: 0 30px 60px -20px rgba(35,52,82,.45); animation: fadein .18s ease-out; }
.modal h2 { font: 700 26px/1.1 var(--serif); letter-spacing: -.01em; margin: 0 0 10px; }
.modal p { margin: 0 0 20px; color: var(--ink); }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.modal-actions .btn { flex: 1 1 160px; }
@keyframes fadein { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .calpop, .modal, .modalback { animation: none; } }
@media (min-width: 720px) { .page { max-width: 680px; } .slots { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); } }

/* prefisso internazionale ricercabile */
.phone { position: relative; }
.pfx { flex: none; display: inline-flex; align-items: center; gap: 6px; max-width: 48%; min-height: 50px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); font-size: 16px; cursor: pointer; }
.pfx b { font-weight: 600; font-variant-numeric: tabular-nums; }
.pfx span { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pfx svg { flex: none; color: var(--muted); }
.pfx[aria-expanded="true"] { border-color: var(--ink); }
.pfxpop { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(360px, 100%); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 40px -18px rgba(35,52,82,.35); padding: 8px; }
.pfxpop input[type=search] { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px; font-size: 16px; margin-bottom: 6px; outline: none; }
.pfxpop input[type=search]:focus { border-color: var(--ink); }
.pfxpop ul { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; overscroll-behavior: contain; }
.pfxpop li { display: flex; gap: 12px; align-items: center; padding: 11px 10px; border-radius: 6px; cursor: pointer; }
.pfxpop li b { width: 56px; flex: none; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.pfxpop li[aria-selected="true"] { background: var(--brand-soft); }
@media (hover: hover) { .pfxpop li:hover { background: var(--brand-soft); } }
.pfxpop li.none { color: var(--muted); cursor: default; }
@media (max-width: 459px) { .pfx span { display: none; } .pfxpop { width: 100%; } }
