@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/outfit.woff2") format("woff2");
}

:root {
  --ink: #14130f;
  --ink-2: #3b3a35;
  --muted: #6b6a64;
  --line: #e7e5df;
  --line-2: #d9d6ce;
  --paper: #f4f3ef;
  --card: #ffffff;
  --blue: #1e73be;
  --blue-soft: #e8f1fa;
  --blue-ink: #155a96;
  --rose: #f4989c;
  --ok: #1f7a4d;
  --ok-soft: #e7f4ec;
  --err: #b42318;
  --err-soft: #fdecea;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 19, 15, 0.04), 0 8px 30px rgba(20, 19, 15, 0.06);
  --font: "Outfit", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 16px/1.5 var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.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; }
[hidden] { display: none !important; }

/* ── Cornice ─────────────────────────────────────── */

.topbar {
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar img { height: 34px; width: auto; display: block; }
.topbar .tz { font-size: 13px; color: var(--muted); }

.shell {
  max-width: 1080px;
  margin: 18px auto 40px;
  padding: 0 20px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: clip;
}
.booking {
  display: grid;
  grid-template-columns: 330px 1fr;
  min-height: 600px;
}

/* ── Pannello host ───────────────────────────────── */

.host {
  padding: 30px 28px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.who { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%;
  object-fit: cover; background: var(--paper);
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--line);
}
.who .name { font-weight: 600; line-height: 1.2; }
.who .role { font-size: 14px; color: var(--muted); }
.host h1 {
  margin: 4px 0 0;
  font-size: 27px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.host .lead { margin: 0; color: var(--ink-2); }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.facts li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); font-size: 15px; }
.facts svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--muted); }
.agenda {
  margin-top: auto;
  padding: 16px;
  background: var(--paper);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--ink-2);
}
.agenda strong { display: block; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 8px; }
.agenda ol { margin: 0; padding-left: 18px; display: grid; gap: 4px; }

/* ── Area dei passi ──────────────────────────────── */

.stage { padding: 30px 32px; position: relative; min-width: 0; }
.step-title { margin: 0 0 4px; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.step-sub { margin: 0 0 22px; color: var(--muted); font-size: 15px; }
.step { animation: enter 0.35s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .step, .check-anim * { animation: none !important; } }

.picker { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 28px; }

/* Calendario del mese */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head .month { font-weight: 600; font-size: 16px; text-transform: capitalize; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  display: grid; place-items: center; transition: background 0.15s, border-color 0.15s;
}
.icon-btn:hover:not(:disabled) { background: var(--paper); border-color: var(--line-2); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; }
.cal-nav { display: flex; gap: 6px; }
.dow, .grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dow span { text-align: center; font-size: 12px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; padding: 6px 0; }
.day {
  aspect-ratio: 1; max-height: 52px; width: 100%;
  border: 0; border-radius: 50%; background: transparent;
  font-weight: 500; font-size: 15px; color: #b9b6ad; cursor: default;
  position: relative; display: grid; place-items: center;
  font-variant-numeric: tabular-nums;
}
.day.available { background: var(--blue-soft); color: var(--blue-ink); cursor: pointer; font-weight: 600; transition: background 0.15s, transform 0.15s; }
.day.available:hover { background: #d5e6f6; }
.day.selected { background: var(--ink); color: #fff; }
.day.today::after { content: ""; position: absolute; bottom: 6px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.day.empty { visibility: hidden; }

/* Orari */
.times-head { font-weight: 600; margin: 0 0 12px; font-size: 15px; min-height: 38px; display: flex; align-items: center; }
.times { display: grid; gap: 8px; max-height: 430px; overflow-y: auto; padding: 2px 4px 2px 2px; scrollbar-width: thin; }
.time {
  width: 100%; padding: 12px 10px;
  border: 1px solid #b9d3ec; border-radius: var(--radius-sm);
  background: #fff; color: var(--blue-ink); font-weight: 600; font-size: 15px;
  cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  font-variant-numeric: tabular-nums;
}
.time small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.time:hover { border-color: var(--blue); background: var(--blue-soft); }
.time:active { transform: scale(0.98); }
.daypart { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 6px 0 0; }
.daypart:first-child { margin-top: 0; }

/* Scheletro di caricamento */
.skeleton { background: linear-gradient(90deg, #f0eee9 25%, #f7f6f2 50%, #f0eee9 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Modulo ──────────────────────────────────────── */

.chosen {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); margin-bottom: 22px;
}
.chosen .when { font-weight: 600; }
.chosen .when span { display: block; font-weight: 400; color: var(--muted); font-size: 14px; }
.link-btn { border: 0; background: none; color: var(--blue); font-weight: 500; cursor: pointer; padding: 6px 4px; }
.link-btn:hover { text-decoration: underline; }

form { display: grid; gap: 16px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; }
.field label .opt { color: var(--muted); font-weight: 400; }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: #fff; transition: border-color 0.15s, box-shadow 0.15s; font-size: 16px;
}
.field textarea { resize: vertical; min-height: 92px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30, 115, 190, 0.15); }
.field.invalid input, .field.invalid textarea { border-color: var(--err); }
.field .err { color: var(--err); font-size: 13px; min-height: 0; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.consent input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.consent.invalid { color: var(--err); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 22px; border-radius: 12px; border: 1px solid var(--ink);
  background: var(--ink); color: #fff; font-weight: 600; font-size: 16px; cursor: pointer;
  transition: transform 0.1s, background 0.15s, opacity 0.15s; text-decoration: none;
}
.btn:hover { background: #2b2a25; text-decoration: none; }
.btn:active { transform: scale(0.99); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--paper); }
.btn.danger { background: #fff; color: var(--err); border-color: #f3c3bd; }
.btn.danger:hover { background: var(--err-soft); }
.btn.block { width: 100%; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fine { font-size: 13px; color: var(--muted); margin: 0; }

/* ── Avvisi ──────────────────────────────────────── */

.notice { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.notice.err { background: var(--err-soft); color: var(--err); }
.notice.info { background: var(--blue-soft); color: var(--blue-ink); }

/* ── Conferma ────────────────────────────────────── */

.done { text-align: center; max-width: 520px; margin: 10px auto 0; }
.check-anim { width: 72px; height: 72px; margin: 0 auto 16px; }
.check-anim circle { stroke: var(--ok); stroke-width: 3; fill: var(--ok-soft); stroke-dasharray: 220; stroke-dashoffset: 220; animation: draw 0.6s var(--ease) forwards; }
.check-anim path { stroke: var(--ok); stroke-width: 4; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 50; stroke-dashoffset: 50; animation: draw 0.4s 0.45s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: -0.015em; }
.done .sub { margin: 0 0 22px; color: var(--ink-2); }
.when-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0 0 22px; text-align: left; }
.when-box .label { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.when-box .d { font-size: 19px; font-weight: 600; margin-top: 4px; }
.when-box .t { color: var(--ink-2); }
.mini-label { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.cal-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 22px; }
.cal-links a {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 8px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  color: var(--ink); font-size: 14px; font-weight: 500; background: #fff;
}
.cal-links a:hover { background: var(--paper); text-decoration: none; }
.cal-links svg { width: 16px; height: 16px; flex: none; }
.actions { display: grid; gap: 10px; }

/* ── Footer ──────────────────────────────────────── */

.foot { max-width: 1080px; margin: 0 auto; padding: 0 20px 30px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; }
details.privacy summary { cursor: pointer; }
details.privacy p { max-width: 640px; margin: 8px 0 0; line-height: 1.6; }

/* ── Pagine singole (gestisci) ───────────────────── */

.narrow { max-width: 560px; }
.panel { padding: 30px 28px; }
.panel h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -0.015em; }
.panel .sub { margin: 0 0 22px; color: var(--ink-2); }
.confirm-box { border: 1px solid #f3c3bd; background: var(--err-soft); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; }
.confirm-box p { margin: 0; color: var(--err); }
.confirm-box .btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Stanza della call ───────────────────────────── */

body.room { background: #0f0f0d; color: #fff; display: flex; flex-direction: column; }
.room-bar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); }
.room-bar img.logo { height: 26px; }
.room-bar .info { font-size: 14px; color: var(--muted); margin-left: auto; text-align: right; line-height: 1.3; }
.room-bar .info strong { color: var(--ink); font-weight: 600; display: block; }
.lobby { flex: 1; display: grid; place-items: center; padding: 24px 16px; background: var(--paper); color: var(--ink); }
.lobby .card { max-width: 480px; width: 100%; padding: 30px 28px; text-align: center; }
.lobby h1 { margin: 12px 0 6px; font-size: 25px; letter-spacing: -0.015em; }
.lobby .avatar { width: 72px; height: 72px; }
.countdown { font-variant-numeric: tabular-nums; font-size: 15px; color: var(--ink-2); margin: 0 0 20px; }
.tips { text-align: left; font-size: 14px; color: var(--ink-2); margin: 20px 0 0; padding: 14px 16px; background: var(--paper); border-radius: var(--radius-sm); }
.tips ul { margin: 6px 0 0; padding-left: 18px; }
.frame-wrap { flex: 1; display: flex; }
.frame-wrap iframe { flex: 1; border: 0; width: 100%; min-height: calc(100dvh - 48px); }
.host-hint { background: var(--blue-soft); color: var(--blue-ink); font-size: 14px; padding: 10px 12px; border-radius: var(--radius-sm); margin: 0 0 18px; }

/* ── Mobile ──────────────────────────────────────── */

@media (max-width: 920px) {
  .booking { grid-template-columns: 1fr; }
  .host { border-right: 0; border-bottom: 1px solid var(--line); padding: 22px 20px; gap: 12px; }
  .host h1 { font-size: 23px; }
  .agenda { display: none; }
  .facts { grid-template-columns: repeat(2, auto); justify-content: start; gap: 8px 18px; }
  .facts li { font-size: 14px; }
  .stage { padding: 22px 20px 26px; }
  .picker { grid-template-columns: 1fr; gap: 22px; }
  .times { grid-template-columns: repeat(3, 1fr); max-height: none; overflow: visible; }
  .daypart { grid-column: 1 / -1; }
  .times-head { min-height: 0; }
}
@media (max-width: 520px) {
  .topbar { padding: 16px 16px 0; }
  .topbar img { height: 28px; }
  .shell { padding: 0 10px; margin-top: 12px; }
  .card { border-radius: 16px; }
  .host .lead { display: none; }
  .facts { grid-template-columns: 1fr 1fr; gap: 6px 12px; }
  .facts li { font-size: 13px; gap: 6px; }
  .host h1 { font-size: 21px; }
  .row2 { grid-template-columns: 1fr; }
  .times { grid-template-columns: repeat(2, 1fr); }
  .cal-links { grid-template-columns: 1fr; }
  .day { font-size: 14px; }
  .panel { padding: 24px 20px; }
  .room-bar .info { font-size: 12px; }
}

.sk-block { height: 140px; }
.who.mb { margin-bottom: 16px; }

.lobby .fine { margin-top: 14px; }

.consent .err { display: block; color: var(--err); font-size: 13px; margin-top: 4px; }
.consent .err:empty { display: none; }
