/* I luoghi nascosti di San Bernardino — form prenotazioni (mobile-first) */

:root {
  --brand: #9b0909;
  --brand-hover: #680000;
  --bg: #cccccc;
  --bg-form: #f0f0f0;
  --surface: #e1e1e1;
  --line: #acacac;
  --ink: #232323;
  --muted: #5e432b;
  --focus: #677daf;
  --danger: #9b0909;
  --ok: #9e0e0e;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  --radius: 14px;
  --font: "Montserrat", "Segoe UI", sans-serif;
  --fw-light: 300;
  --fw-regular: 400;
  --fw-semibold: 600;
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("../fonts/Montserrat-Light.ttf") format("truetype");
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Montserrat-Regular.ttf") format("truetype");
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/Montserrat-SemiBold.ttf") format("truetype");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-weight: var(--fw-regular);
  color: var(--ink);
  background-color: var(--bg);
  line-height: 1.45;
  position: relative;
}

html.is-embed {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background-color: var(--bg);
}

body.is-embed {
  width: 100%;
  max-width: 100%;
  min-height: 0;
  margin: 0;
  background-color: var(--bg);
  position: relative;
  overflow-x: hidden;
}

.is-embed .shell {
  width: min(100% - 1.5rem, 40rem);
  max-width: 40rem;
  min-height: 0;
  margin: 0 auto;
  padding: clamp(0.75rem, 2.5vw, 1.25rem);
  box-sizing: border-box;
}

.shell {
  width: min(100% - 1.5rem, 40rem);
  margin: 0 auto;
  padding: 1.25rem 0 2.5rem;
}

.brand {
  text-align: center;
  margin-bottom: 1.35rem;
}

.brand__logo {
  display: block;
  width: min(100%, 22rem);
  height: auto;
  margin: 0 auto 1.1rem;
  border-radius: 10px;
}

.brand__title {
  margin: 0;
  font-size: clamp(1.75rem, 5.5vw, 2.35rem);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--brand);
  text-wrap: balance;
}

.brand__title::after {
  content: "";
  display: block;
  width: 3rem;
  height: 3px;
  margin: 0.75rem auto 0;
  background: var(--brand);
  border-radius: 2px;
}

.brand__lede {
  margin: 0.85rem 0 0;
  color: var(--ink);
  font-size: clamp(1.05rem, 2.8vw, 1.2rem);
  font-weight: var(--fw-semibold);
  line-height: 1.35;
}

.form {
  background: var(--bg-form);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem;
}

.grid {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .form {
    padding: 1.35rem;
  }

  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  margin-bottom: 0.95rem;
}

.field--people {
  text-align: center;
}

.field--people .stepper {
  margin-inline: auto;
}

.field--people .posti-info,
.field--people .field__hint,
.field--people .field__error {
  text-align: center;
}

.stepper {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  max-width: 16rem;
  height: 3.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-sizing: border-box;
}

.stepper__btn {
  box-sizing: border-box;
  flex: 0 0 3.5rem;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--brand);
  color: #fff;
  font-family: var(--font);
  font-size: 1.85rem;
  font-weight: var(--fw-semibold);
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stepper__btn:hover:not(:disabled) {
  background: var(--brand-hover);
}

.stepper__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.stepper__btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
  z-index: 1;
}

.field .stepper__value,
.stepper__value {
  box-sizing: border-box;
  flex: 1 1 auto;
  width: auto;
  min-width: 4.5rem;
  max-width: none;
  height: 3.5rem;
  margin: 0;
  padding: 0 0.5rem;
  border: 0 !important;
  border-left: 1px solid var(--line) !important;
  border-right: 1px solid var(--line) !important;
  border-radius: 0 !important;
  text-align: center;
  font-family: var(--font);
  font-size: 1.5rem;
  font-weight: var(--fw-semibold);
  color: var(--ink);
  background: #fff !important;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  pointer-events: none;
}

.field .stepper__value:focus,
.stepper__value:focus {
  outline: none;
}

.posti-info {
  margin: 0.55rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: var(--fw-semibold);
}

.posti-info.is-ready {
  border-color: var(--brand);
  color: var(--brand);
}

.posti-info.is-full {
  border-color: var(--danger);
  color: var(--danger);
}

.field label {
  display: block;
  font-weight: var(--fw-semibold);
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
}

.field input:not(.stepper__value):not([type="checkbox"]),
.field select {
  width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font-family: var(--font);
  font-weight: var(--fw-regular);
  font-size: 1rem;
}

.field input:not(.stepper__value):not([type="checkbox"]):focus,
.field select:focus,
.btn:focus-visible,
.check input:focus-visible,
.field a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.field select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.field__hint {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: var(--fw-light);
}

.field__error {
  margin: 0.35rem 0 0;
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: var(--fw-semibold);
}

.field--invalid input:not(.stepper__value),
.field--invalid select {
  border-color: var(--danger);
}

.field--invalid .stepper {
  border-color: var(--danger);
}

.field--check {
  margin-top: 0.4rem;
}

.check {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.92rem;
  font-weight: var(--fw-regular);
  cursor: pointer;
  width: 100%;
}

.check input[type="checkbox"] {
  box-sizing: border-box;
  flex: 0 0 1.25rem;
  width: 1.25rem;
  min-width: 1.25rem;
  max-width: 1.25rem;
  height: 1.25rem;
  margin: 0.15rem 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  appearance: auto;
  -webkit-appearance: checkbox;
  background: #fff;
  accent-color: var(--brand);
  cursor: pointer;
}

.check span {
  flex: 1 1 auto;
  line-height: 1.4;
}

.check a {
  color: var(--brand);
  font-weight: var(--fw-semibold);
}

.form__status {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: #f8e8e8;
  color: var(--danger);
  font-weight: var(--fw-semibold);
  font-size: 0.92rem;
}

.btn {
  width: 100%;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-family: var(--font);
  font-weight: var(--fw-semibold);
  font-size: 1.05rem;
  padding: 0.9rem 1.2rem;
  cursor: pointer;
}

.btn:hover {
  background: var(--brand-hover);
}

.btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  width: min(100% - 1.5rem, 28rem);
  background: var(--ok);
  color: #fff;
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
  box-shadow: var(--shadow);
  z-index: 40;
}

.toast[hidden] {
  display: none;
}

.toast strong {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: var(--fw-semibold);
}

.toast__body {
  margin-bottom: 0.75rem;
}

.toast__close {
  display: block;
  width: 100%;
  margin-top: 0.15rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.04em;
  cursor: pointer;
}

.toast__close:hover,
.toast__close:focus-visible {
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}