/* Layout mobile-first: il form si apre dal telefono del cliente */

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1f2328;
  background: #f6f7f9;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 12px;
}

a {
  color: #0b5cad;
}

/* Form di registrazione */

.subtitle {
  margin: -8px 0 20px;
  color: #57606a;
}

/* intestazione del form di registrazione: nome del locale e "Registrazione ..." centrati */
.form-header {
  text-align: center;
}

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

.notice {
  padding: 12px;
  margin: 0 0 16px;
  border-radius: 8px;
  background: #e6f4ea;
  color: #1a5c2e;
}

/* stesso box in rosso, per gli errori (es. BE o Cloudflare non raggiungibili) */
.notice-error {
  background: #fdecea;
  color: #b42318;
}

.field {
  margin-bottom: 16px;
}

.field > label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid #c9ced6;
  border-radius: 8px;
}

/* campi non modificabili (es. l'email nelle pagine dei consensi e del cliente nuovo dal BE): in
   grigio, perché si capisca che non si cambiano */
input:disabled,
select:disabled {
  background: #eef0f3;
  color: #57606a;
  cursor: not-allowed;
}

input:focus,
select:focus {
  outline: 2px solid #0b5cad;
  outline-offset: 1px;
}

.input-validation-error {
  border-color: #c62828;
}

.phone {
  display: flex;
  gap: 8px;
}

.phone select {
  width: 45%;
  flex: 0 0 auto;
}

.phone input {
  flex: 1 1 auto;
  min-width: 0;
}

.field > label.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: normal;
}

.check input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex: 0 0 auto;
}

.field-error {
  display: block;
  margin-top: 4px;
  font-size: 0.875rem;
  color: #c62828;
}

.field-error:empty {
  display: none;
}

.hint {
  font-size: 0.875rem;
  color: #57606a;
}

/* "Reinvia il mio codice" in fondo al form, sotto il separatore "oppure" */

.resend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.button-secondary {
  display: block;
  width: 100%;
  padding: 12px;
  text-align: center;
  font-weight: 600;
  text-decoration: none;
  color: #0b5cad;
  background: #fff;
  border: 1px solid #0b5cad;
  border-radius: 8px;
}

/* separatore "oppure": testo al centro di una linea, fra il pulsante Registrati e Reinvia */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
  font-size: 0.875rem;
  color: #57606a;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid #c9ced6;
}

.back {
  margin-top: 20px;
  text-align: center;
}

button[type="submit"] {
  width: 100%;
  padding: 12px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: #0b5cad;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

/* Pagina dei consensi (/c/{s}): un riquadro per documento */

.consent-card {
  margin: 0 0 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid #c9ced6;
  border-radius: 8px;
}

/* documento che richiede una risposta */
.consent-card-attention {
  border-color: #bf8700;
  box-shadow: inset 4px 0 0 #bf8700;
}

.consent-title {
  font-weight: 600;
}

.consent-version {
  display: block;
  font-size: 0.875rem;
  font-weight: normal;
  color: #57606a;
}

.consent-flag {
  margin: 8px 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #9a6700;
}

.consent-note,
.consent-link,
.consent-text {
  margin: 8px 0 0;
}

.consent-note {
  font-size: 0.875rem;
  color: #57606a;
}

.consent-card > label.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
}

/* "Accetto" / "Non accetto" dei documenti obbligatori */
.choice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 12px;
}

.choice > label.check {
  display: flex;
  gap: 8px;
  align-items: center;
}

.consent-outcome {
  margin: 8px 0 0;
  font-weight: 600;
}

.consent-outcome-yes {
  color: #1a7f37;
}

.consent-outcome-no {
  color: #b42318;
}

/* box giallo: cosa comporta un "Non accetto" e casella di uscita */
.notice-warning {
  background: #fff8c5;
  color: #4d2d00;
}

.notice-warning p {
  margin: 0 0 8px;
}

.notice-warning label.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 600;
}

.notice-warning .hint {
  margin: 8px 0 0;
}

[hidden] {
  display: none !important;
}

/* sezione "I tuoi dati" della pagina dei consensi: il primo campo stacca dal titolo */
.consent-field {
  margin-top: 12px;
}
