/* Pannello di controllo — Casetta 14
   Stile "vetro solare" alleggerito: stessa famiglia di colori/font del progetto dashboard,
   ma un tool operativo per due persone (host + madre), non un'esperienza ospiti — quindi
   niente animazioni/sheen/ripple, solo chiarezza e target di tocco grandi (va usato anche da
   telefono). Nessun build tool, coerente con il resto del progetto. */

:root {
  --azzurro: #4FC0C4;
  --corallo: #E2632B;
  --testo: #1F2937;
  --testo-soft: #6B7280;
  --bg-top: #DFF3F4;
  --bg-bottom: #FBEFD9;
  --vetro: rgba(255, 255, 255, 0.6);
  --vetro-bordo: rgba(255, 255, 255, 0.8);
  --errore: #D9455F;
  --successo: #3FA76F;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--testo);
  background: linear-gradient(160deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.screen {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* L'attributo hidden va reso esplicito: la regola .screen{display:flex} sopra ha la stessa
   specificità del display:none che il browser applica di default a [hidden], e vince lei
   (è nel foglio di stile dell'app, non nello stile utente-agente) — senza questa riga i due
   schermi (login/pannello) restavano entrambi visibili appena JS toglieva/rimetteva
   l'attributo, affiancati dal flex del body. */
.screen[hidden] {
  display: none;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--vetro);
  border: 1px solid var(--vetro-bordo);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(31, 41, 55, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 32px 28px;
}

.logo { width: 48px; height: auto; display: block; }
.logo-small { width: 36px; }

.login-card { text-align: center; }
.login-card .logo { margin: 0 auto 16px; }

h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 2px;
}

.subtitle {
  color: var(--testo-soft);
  font-size: 14px;
  margin: 0 0 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.panel-header > div { flex: 1; }
.panel-header h1 { margin: 0; }
.panel-header .subtitle { margin: 0; }

.btn-logout {
  align-self: flex-start;
}

.section-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--testo-soft);
  margin: 0 0 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  text-align: left;
}

.field span {
  font-size: 13px;
  font-weight: 500;
  color: var(--testo-soft);
}

.field-row {
  display: flex;
  gap: 12px;
}

.field-row .field { flex: 1; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select {
  font-family: inherit;
  font-size: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(31, 41, 55, 0.15);
  background: rgba(255, 255, 255, 0.9);
  color: var(--testo);
  width: 100%;
  min-height: 48px;
}

input:focus, select:focus {
  outline: 2px solid var(--azzurro);
  outline-offset: 1px;
}

.btn {
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  min-height: 48px;
  cursor: pointer;
  width: 100%;
}

.btn-primary {
  background: var(--corallo);
  color: #fff;
}

.btn-primary:active { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

.btn-ghost {
  background: transparent;
  color: var(--testo-soft);
  border: 1px solid rgba(31, 41, 55, 0.15);
  width: auto;
  padding: 8px 14px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 500;
}

.btn-sync {
  width: 100%;
  color: var(--azzurro);
  border-color: rgba(79, 192, 196, 0.4);
  margin: -6px 0 20px;
}
.btn-sync:disabled { opacity: 0.6; cursor: default; }

.section-label-danger {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(31, 41, 55, 0.1);
}

.btn-danger {
  width: 100%;
  color: var(--errore);
  border-color: rgba(217, 69, 95, 0.4);
  margin-bottom: 8px;
}
.btn-danger:active { opacity: 0.8; }

.message {
  font-size: 14px;
  margin: 12px 0 0;
  text-align: center;
}

.message-error { color: var(--errore); }
.message-success { color: var(--successo); font-weight: 500; }

.hint {
  font-size: 12px;
  color: var(--testo-soft);
  text-align: center;
  margin: 20px 0 0;
}

@media (max-width: 400px) {
  .field-row { flex-direction: column; }
}

/* Popup di scelta soggiorno (dopo "Sincronizza date da Airbnb") */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 41, 55, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-overlay[hidden] { display: none; }

.modal-card {
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.modal-card h2 {
  font-size: 18px;
  margin: 0 0 4px;
}

.modal-hint {
  color: var(--testo-soft);
  font-size: 13px;
  margin: 0 0 16px;
}

.stays-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.stay-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(31, 41, 55, 0.15);
  background: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  cursor: pointer;
  min-height: 48px;
}
.stay-option:active { opacity: 0.8; }

.stay-dates {
  font-weight: 600;
  font-size: 15px;
  color: var(--testo);
}

.stay-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--successo);
  background: rgba(63, 167, 111, 0.15);
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
}
