/* pay.marymount.it — grafica di marymount.it.
   Font ospitati sul sito (licenza SIL Open Font License), solo set latino. */
@font-face { font-family: 'Crimson Text'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/crimson-text-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Crimson Text'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/crimson-text-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Crimson Text'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/crimson-text-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Work Sans'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/fonts/work-sans.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --navy: #204660;
  --navy-2: #17354a;
  --navy-soft: #e8eef2;
  --coral: #f36a55;
  --gold: #c99f22;
  --gold-soft: #f4eada;
  --olive: #737665;
  --olive-soft: #ecece6;
  --cream: #f7f7f7;
  --paper: #ffffff;
  --ink: #333333;
  --muted: #666666;
  --line: #dddddd;
  --line-soft: #ececec;
  --ok: #2e7d4f;
  --ok-soft: #e7f3ec;
  --warn: #a35c00;
  --warn-soft: #fbf0df;
  --err: #b3261e;
  --err-soft: #fbeceb;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .07);
  --serif: "Crimson Text", Georgia, serif;
  --sans: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); color: var(--ink); background: var(--cream);
  line-height: 1.55; font-size: 16px; min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); }
[hidden] { display: none !important; }
img { max-width: 100%; }
h1, h2 { font-family: var(--serif); font-weight: 700; color: var(--ink); line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(2rem, 5vw, 2.75rem); }
h2 { font-size: clamp(1.45rem, 3vw, 1.75rem); }
h3 { font-family: var(--sans); font-weight: 600; color: var(--navy); font-size: 1.05rem; margin: 0 0 .4em; }
.bar::before { content: ""; display: block; width: 100px; height: 4px; background: var(--coral); margin-bottom: 14px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- testata e piede ---------- */
.topbar { background: var(--navy); color: #fff; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.brand img { height: 52px; width: auto; display: block; }
.brand .sub {
  font-size: .72rem; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,.8);
  border-left: 1px solid var(--gold); padding-left: 14px; line-height: 1.3;
}
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 780px; }
main { flex: 1; }

footer.site { background: var(--navy); color: rgba(255,255,255,.85); padding: 26px 0; font-size: .85rem; margin-top: 48px; }
footer.site .wrap { display: flex; gap: 12px 32px; flex-wrap: wrap; justify-content: space-between; }
footer.site a { color: #fff; }

.prova-banner {
  background: #e8710a; color: #fff; text-align: center; font-size: .82rem; font-weight: 600;
  padding: 6px 12px; letter-spacing: .3px;
}

/* ---------- bottoni e campi ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--radius); padding: 11px 22px;
  font: inherit; font-weight: 600; font-size: .875rem; text-transform: uppercase; letter-spacing: .3px;
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s, opacity .15s;
  background: var(--navy); color: #fff; border-color: var(--navy); min-height: 44px;
}
.btn:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn.light { background: var(--paper); color: var(--navy); border-color: var(--line); }
.btn.light:hover { border-color: var(--navy); background: var(--paper); }
.btn.ghost { background: transparent; color: var(--navy); border-color: transparent; }
.btn.ghost:hover { background: var(--navy-soft); }
.btn.danger { background: var(--paper); color: var(--err); border-color: #e7b7b3; }
.btn.danger:hover { background: var(--err-soft); }
.btn.big { padding: 14px 28px; font-size: .95rem; }
.btn.sm { padding: 6px 14px; font-size: .78rem; min-height: 34px; }
.btn.block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field > label, .label { font-size: .85rem; font-weight: 600; color: var(--navy); }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: -2px; }
.req { color: var(--coral); }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=number], input[type=date],
input[type=datetime-local], input[type=search], select, textarea {
  font: inherit; font-size: 1rem; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); width: 100%; min-width: 0; min-height: 44px;
}
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy); outline-offset: 0; border-color: var(--navy); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--err); outline-color: var(--err); }
.errore-campo { color: var(--err); font-size: .85rem; font-weight: 600; margin-top: 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; cursor: pointer; }
.check input { margin-top: 3px; width: 20px; height: 20px; accent-color: var(--navy); flex: none; }
.choices { display: grid; gap: 8px; }
.choice {
  display: flex; gap: 10px; align-items: center; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer; background: #fff; min-height: 44px;
}
.choice:has(input:checked) { border-color: var(--navy); background: var(--navy-soft); }
.choice input { width: 18px; height: 18px; accent-color: var(--navy); flex: none; margin: 0; }
.choice .sub { display: block; font-size: .82rem; color: var(--muted); }
.choices.inline { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }

/* ---------- schede ---------- */
.card {
  background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px; margin-bottom: 18px;
}
@media (max-width: 640px) { .card { padding: 20px 16px; } }
.card > h2:first-child { margin-top: 0; }
.alert { padding: 12px 14px; border-radius: 8px; font-size: .93rem; margin: 0 0 16px; }
.alert.err { background: var(--err-soft); color: var(--err); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--navy-soft); color: var(--navy); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600;
  background: var(--navy-soft); color: var(--navy); padding: 5px 12px; border-radius: 999px;
}
.chip.gold { background: var(--gold-soft); color: #7a5f12; }
.chip.olive { background: var(--olive-soft); color: var(--olive); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.err { background: var(--err-soft); color: var(--err); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- pagina di una richiesta ---------- */
.evento { padding: 0; overflow: hidden; }
.evento .cover { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; display: block; background: var(--navy-soft); }
.evento .corpo { padding: 28px 28px 24px; }
@media (max-width: 640px) { .evento .corpo { padding: 22px 16px 20px; } }
.evento .descr { margin-top: 16px; white-space: pre-line; }
.evento .chips { margin-top: 6px; }
.pagina { padding-top: 26px; }

.saluto { display: flex; gap: 14px; align-items: center; }
.saluto .ini {
  width: 48px; height: 48px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center;
  font-family: var(--serif); font-size: 1.35rem; font-weight: 700; flex: none;
}

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
/* Un <legend> sta di natura sul bordo del riquadro: così torna dentro. */
fieldset.card { padding: 26px; border: 1px solid var(--line-soft); }
fieldset.card > legend { float: left; width: 100%; }
fieldset.card > legend + * { clear: both; }
@media (max-width: 640px) { fieldset.card { padding: 20px 16px; } }
.sezione > h2, .sezione > legend {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 700; color: var(--ink); margin: 0 0 16px;
}

.articolo { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line-soft); }
.articolo:first-of-type { border-top: 0; padding-top: 4px; }
.articolo.senza-foto { grid-template-columns: 1fr; }
.articolo .foto {
  width: 120px; height: 120px; object-fit: cover; border-radius: 8px; background: var(--cream); cursor: zoom-in;
  border: 1px solid var(--line-soft); padding: 0;
}
.articolo .foto img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }
@media (max-width: 520px) {
  .articolo { grid-template-columns: 84px 1fr; gap: 12px; }
  .articolo .foto { width: 84px; height: 84px; }
}
.articolo .testa { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.articolo .nome { font-weight: 600; color: var(--ink); font-size: 1.02rem; }
.articolo .prezzo { font-weight: 600; color: var(--navy); white-space: nowrap; }
.articolo .descr { font-size: .9rem; color: var(--muted); margin: 4px 0 10px; white-space: pre-line; }
.articolo .controlli { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.articolo .riga-var { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.articolo .riga-var select { width: auto; min-width: 120px; }
.articolo .nomi { display: grid; gap: 8px; margin-top: 10px; }
.articolo .nomi label { font-size: .8rem; color: var(--muted); }
.articolo .esaurito { color: var(--err); font-weight: 600; font-size: .9rem; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.stepper button {
  width: 42px; height: 42px; border: 0; background: var(--cream); color: var(--navy); font-size: 1.25rem; cursor: pointer;
  font-family: var(--sans);
}
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper button:focus-visible { outline: 2px solid var(--navy); outline-offset: -2px; }
.stepper output { min-width: 40px; text-align: center; font-weight: 600; }
.delega-dati { margin-top: 12px; padding: 16px 16px 0; background: var(--cream); border-radius: 8px; border-left: 3px solid var(--navy); }
.delega-dich { margin-top: 14px; padding: 12px 14px; background: var(--gold-soft); border-radius: 8px; font-size: .9rem; }
.euro-input { position: relative; max-width: 180px; }
.euro-input span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.euro-input input { padding-left: 28px; }

.riepilogo { width: 100%; border-collapse: collapse; font-size: .95rem; }
.riepilogo td { padding: 9px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.riepilogo td:last-child { text-align: right; white-space: nowrap; padding-left: 16px; }
.riepilogo tr.tot td { border-bottom: 0; font-weight: 700; font-size: 1.05rem; padding-top: 12px; }
.riepilogo .sotto { display: block; font-size: .82rem; color: var(--muted); }

.barra-totale {
  position: sticky; bottom: 0; z-index: 5; background: rgba(255,255,255,.97); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 18px rgba(0,0,0,.06); padding: 12px 0; margin-top: 8px;
  backdrop-filter: saturate(1.2) blur(6px);
}
.barra-totale .wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.barra-totale .tot { font-size: .82rem; color: var(--muted); line-height: 1.2; }
.barra-totale .tot strong { display: block; font-size: 1.45rem; color: var(--ink); font-family: var(--serif); }

.esito { text-align: center; padding: 40px 26px; }
.esito .icona {
  width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px;
  background: var(--ok-soft); color: var(--ok);
}
.esito .icona svg { width: 34px; height: 34px; }
.esito.warn .icona { background: var(--warn-soft); color: var(--warn); }
.esito.err .icona { background: var(--err-soft); color: var(--err); }
.esito.info .icona { background: var(--navy-soft); color: var(--navy); }
.esito h1 { font-size: clamp(1.7rem, 4vw, 2.2rem); }
.esito .azioni { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.esito .riepilogo { text-align: left; margin-top: 18px; }

.simulato { border: 3px dashed #e8710a; background: #fff8f0; }
.simulato h1 { color: #b35500; }

.caricamento { display: grid; place-items: center; padding: 80px 0; color: var(--muted); }
.spinner {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--navy-soft); border-top-color: var(--navy);
  animation: gira 0.9s linear infinite; margin: 0 auto 12px;
}
@keyframes gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.5s; } }

.lightbox {
  position: fixed; inset: 0; background: rgba(15, 30, 42, .88); display: grid; place-items: center; z-index: 50; padding: 20px;
  cursor: zoom-out;
}
.lightbox img { max-height: 90vh; max-width: 100%; border-radius: 8px; }

/* ---------- home ---------- */
.hero { background: var(--navy); color: #fff; padding: 46px 0 52px; }
.hero h1 { color: #fff; }
.hero p { color: rgba(255,255,255,.88); max-width: 640px; font-size: 1.05rem; margin: 0; }
.vetrina { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; margin-top: 30px; }
.vcard {
  display: flex; flex-direction: column; background: var(--paper); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line-soft); box-shadow: var(--shadow); text-decoration: none; color: inherit;
  transition: box-shadow .15s, transform .15s;
}
.vcard:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); transform: translateY(-2px); }
.vcard:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.vcard .cover { aspect-ratio: 16 / 8; background: var(--navy-soft) center / cover no-repeat; }
.vcard .cover.vuota { display: grid; place-items: center; background: var(--navy); }
.vcard .cover.vuota img { width: 64px; opacity: .9; }
.vcard .corpo { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.vcard h2 { font-size: 1.4rem; margin: 0; }
.vcard .meta { font-size: .85rem; color: var(--muted); }
.vcard .piede { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding-top: 8px; }
.vcard .da { font-weight: 600; color: var(--navy); }
.vuoto { text-align: center; color: var(--muted); padding: 40px 16px; }
