/* Percorso degustazione - Tenuta Castello di Morcote
   Colori e carattere presi dal sito castellodimorcote.ch */
/* Il font del sito (Reforma1969) e' servito solo a castellodimorcote.ch: quando il percorso
   sara' su degustazione.castellodimorcote.ch, basta copiare i file .woff2 in /fonts e
   aggiungere qui le tre regole @font-face. Fino ad allora si usa Newsreader, molto simile. */

:root {
  --bg: #f8e3cc;          /* il crema/pesca del sito */
  --paper: #fdf5eb;
  --paper-2: #f3d9bd;
  --ink: #212121;
  --muted: #6a5a49;
  --gold: #d1ae86;        /* il colore del logo */
  --gold-ink: #8a6338;    /* oro leggibile su crema */
  --wine: #6d2830;
  --line: rgba(33, 33, 33, .14);
  --focus: #8a6338;
  --radius: 14px;
  --serif: Reforma1969, Newsreader, Georgia, "Times New Roman", serif;
  --gutter: 20px;
  --bar-h: 56px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 25; background: var(--bg); }
body {
  margin: 0; min-height: 100dvh;
  background: var(--bg); color: var(--ink);
  font: 400 17px/1.5 var(--serif);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

/* ---------- barra in alto ---------- */
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  height: var(--bar-h);
  padding: 0 max(8px, env(safe-area-inset-right, 0px)) 0 max(8px, env(safe-area-inset-left, 0px));
  display: grid; grid-template-columns: 48px 1fr 48px; align-items: center;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.bar-back, .bar-lang {
  width: 44px; height: 44px; border: 0; background: none; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; justify-self: center;
}
.bar-lang { font-size: 14px; letter-spacing: .12em; }
.bar-back:active, .bar-lang:active { background: var(--paper-2); }
.bar-mark { justify-self: center; width: 30px; height: 30px; color: var(--gold-ink); }
.bar-mark svg { width: 100%; height: 100%; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line); }
.progress span { display: block; height: 100%; width: 0; background: var(--ink); transition: width .5s cubic-bezier(.2,.7,.2,1); }

/* ---------- schermate ---------- */
.screen {
  max-width: 540px; margin: 0 auto;
  padding-block: 8px calc(170px + env(safe-area-inset-bottom, 0px));
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  animation: enter .45s cubic-bezier(.2,.7,.2,1) both;
}
.screen.back { animation-name: enter-back; }
@keyframes enter { from { opacity: 0; transform: translateX(18px); } }
@keyframes enter-back { from { opacity: 0; transform: translateX(-18px); } }

.kicker { font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-ink); margin: 18px 0 6px; }
h1, h2 { font-weight: 400; letter-spacing: -.01em; line-height: 1.12; margin: 0 0 10px; }
h1 { font-size: clamp(32px, 9vw, 42px); }
h2 { font-size: 28px; }
h3 { font-size: 15px; font-weight: 400; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 28px 0 10px; }
.lead { color: var(--muted); margin: 0 0 22px; }
.it { font-style: italic; }

/* ---------- azioni in basso ---------- */
.actions {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, color-mix(in srgb, var(--bg) 0%, transparent));
}
.actions-in { max-width: 540px; margin: 0 auto; display: grid; gap: 8px; }
.btn {
  min-height: 54px; width: 100%; padding: 0 22px;
  border: 1px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-size: 18px; letter-spacing: .01em; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .15s ease, background .2s ease, opacity .2s ease;
}
.btn:hover { background: #000; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .35; cursor: default; transform: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: transparent; min-height: 44px; font-size: 16px; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line); }
.btn.ghost:hover { text-decoration-color: var(--ink); background: transparent; }
.btn.line { background: transparent; color: var(--ink); }
.btn.line:hover { background: var(--paper); }

/* ---------- lingua ---------- */
.lang-screen { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding-bottom: 40px; }
.lang-mark { width: 120px; height: 120px; color: var(--gold-ink); margin-bottom: 26px; animation: turn 60s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
.lang-name { font-size: 15px; letter-spacing: .3em; text-transform: uppercase; line-height: 1.6; margin: 0 0 36px; }
.lang-list { display: grid; gap: 10px; width: 100%; max-width: 320px; }
.lang-list .btn { background: transparent; color: var(--ink); }
.lang-list .btn:hover, .lang-list .btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ---------- benvenuto ---------- */
.hero { margin: -8px calc(var(--gutter) * -1) 0; position: relative; height: 46vh; min-height: 280px; overflow: hidden; background: var(--paper-2); }
.hero img { width: 100%; height: 100%; object-fit: cover; animation: settle 1.6s cubic-bezier(.2,.7,.2,1) both; }
@keyframes settle { from { transform: scale(1.08); } }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 55%, rgba(0,0,0,.35)); }
.hero-mark { position: absolute; z-index: 1; left: var(--gutter); bottom: 18px; display: flex; align-items: center; gap: 12px; color: #fff; }
.hero-mark svg { width: 44px; height: 44px; }
.hero-mark span { font-size: 13px; letter-spacing: .26em; text-transform: uppercase; line-height: 1.35; }
.facts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 15px; background: var(--paper); }

/* ---------- sommelier ---------- */
.somm-list { display: grid; gap: 10px; }
.somm {
  display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: center; text-align: left;
  min-height: 80px; padding: 12px 16px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.somm:hover { transform: translateY(-2px); border-color: var(--ink); box-shadow: 0 10px 30px -18px rgba(0,0,0,.4); }
.somm:active { transform: scale(.98); }
.somm[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.somm-i { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); color: var(--gold-ink); font-size: 26px; font-style: italic; }
.somm-n { font-size: 24px; }

/* ---------- stelle ---------- */
.q { padding: 18px 0; border-bottom: 1px solid var(--line); }
.q p { margin: 0 0 10px; }
.stars { display: flex; gap: 4px; }
.star { width: 48px; height: 48px; border: 0; background: none; padding: 6px; cursor: pointer; color: var(--gold); border-radius: 50%; transition: transform .15s ease; }
.star svg { width: 100%; height: 100%; }
.star path { fill: transparent; stroke: var(--gold-ink); stroke-width: 1.2; transition: fill .15s ease; }
.star.on path { fill: var(--gold); stroke: var(--gold-ink); }
.star:active { transform: scale(.88); }
.star.pop { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.25); } }

/* ---------- campi ---------- */
.field { display: block; margin: 14px 0; }
.field > span { display: block; font-size: 14px; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper);
  font-size: 17px; outline: none; transition: border-color .2s ease;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--ink); }
.field.bad input, .field.bad select { border-color: var(--wine); }
.err { color: var(--wine); font-size: 14px; margin-top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.row2b { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.check { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; padding: 10px 0; cursor: pointer; font-size: 16px; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--ink); }
.check a { color: inherit; }

/* ---------- pacchetti ---------- */
.pkg {
  display: block; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  padding: 20px; margin: 0 0 14px; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.pkg:hover { transform: translateY(-2px); border-color: var(--ink); box-shadow: 0 10px 30px -18px rgba(0,0,0,.4); }
.pkg[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pkg-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; }
.pkg-name { font-size: 24px; line-height: 1.15; }
.pkg-price { white-space: nowrap; color: var(--gold-ink); }
.pkg-price small { color: var(--muted); font-size: 13px; }
.pkg p { color: var(--muted); margin: 6px 0 14px; }
.pkg-bottles { display: flex; gap: 2px; align-items: flex-end; height: 92px; margin: 0 0 12px; }
.pkg-bottles img { height: 100%; width: auto; object-fit: contain; flex: 0 1 auto; min-width: 0; }
.pkg ol { margin: 0; padding: 0 0 0 20px; font-size: 15.5px; }
.pkg li { break-inside: avoid; margin: 0 0 4px; }

/* ---------- vino ---------- */
.wine-top { display: grid; grid-template-columns: 1fr 96px; gap: 12px; align-items: end; margin: 10px 0 8px; }
.wine-top .bottle { height: 250px; width: 96px; object-fit: contain; filter: drop-shadow(0 16px 18px rgba(60,30,10,.25)); animation: bottle .6s cubic-bezier(.2,.7,.2,1) both; }
@keyframes bottle { from { opacity: 0; transform: translateY(24px); } }
.wine-meta { font-size: 15px; color: var(--muted); margin: 0 0 4px; }
.wine-short { margin: 0; }
.sheet-btn { margin: 14px 0 0; border: 0; background: none; padding: 8px 0; min-height: 44px; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--gold); color: var(--gold-ink); }
.sheet { background: var(--paper); border-radius: var(--radius); padding: 4px 18px 14px; margin: 8px 0 0; font-size: 15.5px; }
.sheet h4 { font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-ink); font-weight: 400; margin: 16px 0 4px; }
.sheet p { margin: 0; white-space: pre-line; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper); font-size: 16px;
  transition: background .15s ease, color .15s ease, transform .15s ease, border-color .15s ease;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip:active { transform: scale(.96); }
.dots { display: flex; gap: 6px; justify-content: center; margin: 4px 0 0; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--ink); }
.dots i.done { background: var(--gold); }

/* ---------- preferito ---------- */
.fav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fav {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  padding: 14px 12px 12px; cursor: pointer; text-align: center; transition: transform .2s ease, border-color .2s ease;
}
.fav:hover { transform: translateY(-2px); border-color: var(--ink); }
.fav[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.fav img { height: 130px; width: auto; margin: 0 auto 8px; object-fit: contain; }
.fav b { display: block; font-weight: 400; font-size: 16px; line-height: 1.25; }
.fav small { display: block; color: var(--gold-ink); font-size: 14px; margin-top: 4px; letter-spacing: .1em; }
.fav .top { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--wine); color: #fff; font-size: 13px; }

/* ---------- chi sono ---------- */
.who { text-align: center; padding-top: 10px; }
.who h1 { font-style: italic; font-size: clamp(28px, 8vw, 36px); }
.reveal { position: relative; height: 330px; margin: 18px 0 10px; display: grid; place-items: center; }
.reveal .halo { position: absolute; width: 300px; height: 300px; color: var(--gold); opacity: .55; animation: halo 1.4s cubic-bezier(.2,.7,.2,1) both, turn 80s linear 1.4s infinite; }
@keyframes halo { from { transform: scale(.4) rotate(-90deg); opacity: 0; } }
.reveal .bottle { position: relative; height: 310px; width: auto; filter: drop-shadow(0 22px 24px rgba(60,30,10,.3)); animation: rise 1.1s cubic-bezier(.2,.7,.2,1) .35s both; }
@keyframes rise { from { opacity: 0; transform: translateY(40px) scale(.9); } }
.who-name { font-size: 34px; line-height: 1.15; margin: 6px 0 6px; animation: enter .6s ease .9s both; }
.who-app { color: var(--gold-ink); margin: 0 0 18px; animation: enter .6s ease 1s both; }
.idcard { text-align: left; background: var(--paper); border-radius: var(--radius); padding: 6px 18px 18px; animation: enter .6s ease 1.1s both; }
.idcard dl { display: grid; grid-template-columns: 42% 1fr; margin: 0; }
.idcard dt, .idcard dd { padding: 11px 0; border-bottom: 1px solid var(--line); margin: 0; font-size: 15.5px; }
.idcard dt { color: var(--muted); letter-spacing: .04em; }
.idcard h4 { font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-ink); font-weight: 400; margin: 20px 0 6px; }
.idcard p { margin: 0; font-size: 15.5px; white-space: pre-line; }
.mine { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mine span { font-size: 14px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }

/* ---------- acquisto ---------- */
.buy-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.buy-row img { height: 92px; width: 52px; object-fit: contain; }
.buy-row b { display: block; font-weight: 400; line-height: 1.25; }
.buy-row small { display: block; color: var(--muted); font-size: 14px; }
.box-btn { border: 0; background: none; padding: 6px 0; min-height: 44px; color: var(--gold-ink); cursor: pointer; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--gold); }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.stepper button { width: 44px; height: 44px; border: 0; background: none; font-size: 22px; cursor: pointer; border-radius: 50%; }
.stepper button:active { background: var(--paper-2); }
.stepper output { min-width: 24px; text-align: center; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 0 4px; font-size: 20px; }
.total small { color: var(--muted); font-size: 14px; }
.modes { display: grid; gap: 10px; }
.mode { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: 14px 16px; cursor: pointer; }
.mode input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--ink); }
.mode small { display: block; color: var(--muted); font-size: 14px; }
.mode:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

/* ---------- compleanno e fine ---------- */
.gift { width: 84px; height: 84px; color: var(--gold-ink); margin: 18px 0 6px; animation: halo 1.2s cubic-bezier(.2,.7,.2,1) both; }
.rule { font-size: 14px; color: var(--muted); border-left: 2px solid var(--gold); padding: 2px 0 2px 12px; margin: 0 0 8px; }
.notice { background: var(--paper); border-radius: var(--radius); padding: 14px 16px; margin: 16px 0; }
.notice.party { background: var(--ink); color: var(--paper); font-size: 18px; }
.summary { list-style: none; padding: 0; margin: 0; }
.summary li { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.summary .s { color: var(--gold-ink); letter-spacing: .08em; white-space: nowrap; }
.summary .n { grid-column: 1 / -1; color: var(--muted); font-size: 14.5px; }
.summary li.is-fav b::after { content: " ♥"; color: var(--wine); }
.links { display: grid; gap: 10px; margin: 24px 0 0; }
.debug { margin-top: 30px; font: 12px/1.4 ui-monospace, Menlo, monospace; background: #fff8; border: 1px dashed var(--line); border-radius: 10px; padding: 12px; white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; }
.debug-title { font-size: 14px; color: var(--muted); margin-top: 30px; }

.toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; max-width: calc(100% - 32px); width: max-content; background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 14px; font-size: 15.5px; animation: enter .3s ease both; }

@media (min-width: 700px) {
  .hero { margin: 0 0 0; border-radius: var(--radius); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
