.account-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
  background: linear-gradient(160deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  font-family: var(--font-body);
}
.account-body.legal-body { justify-content: flex-start; }
.account-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 440px;
}
.account-card.legal-card { max-width: 760px; line-height: 1.6; }
.account-card h1 { font-family: var(--font-heading); font-size: 1.5rem; color: var(--color-primary); margin: 0 0 6px; }
.account-card h2 { font-size: 1.05rem; color: var(--color-primary); margin: 22px 0 6px; }
.account-card p.sub { color: var(--color-text-muted); font-size: 0.9rem; margin: 0 0 22px; }
.account-card .btn { width: 100%; margin-top: 8px; }
.account-feedback { display: none; margin-bottom: 16px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.88rem; }
.account-feedback.error { display: block; background: var(--color-danger-bg); color: var(--color-danger); }
.account-feedback.ok { display: block; background: var(--color-success-bg); color: var(--color-success); }
.account-links { font-size: 0.85rem; color: var(--color-text-muted); text-align: center; margin-top: 16px; }
.account-links a { color: var(--color-accent); }
.account-footer, .account-footer a { color: rgba(255, 255, 255, 0.85); }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 0.88rem; margin: 10px 0; color: var(--color-dark); }
.check input { margin-top: 3px; }
.draft-notice { background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; border-radius: var(--radius-sm); padding: 12px 14px; font-size: 0.9rem; margin-bottom: 18px; }

.signup-notice { background: var(--color-accent-light, #eef6fb); border: 1px solid var(--color-border, #d6e2ea); border-radius: 12px; padding: 14px 16px; margin: 6px 0 14px; font-size: 0.88rem; line-height: 1.5; color: var(--color-primary, #0a2540); }
.signup-notice ul { margin: 8px 0 0 18px; padding: 0; }
.signup-notice li { margin-bottom: 4px; }

/* Link dei consensi ben visibili (Termini, Privacy) */
.check a, .account-footer a { color: #0077b6; text-decoration: underline; font-weight: 700; }
.check a::after { content: " ↗"; font-size: .8em; }

.legal-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 8px 0 14px; }
.legal-table th, .legal-table td { border: 1px solid var(--color-border, #d6e2ea); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal-table th { background: #f1f5f9; }

/* Registrazione: su schermo largo la scheda si divide in due colonne (avvertenze a sinistra, campi affiancati a destra).
   Su telefono l'ordine resta quello di sempre: dati di base, avvertenze, resto. */
@media (min-width: 960px) {
  .account-card.signup-card { max-width: 1040px; padding: 36px 44px 30px; }
  .signup-card #oauthBox .oauth-buttons { grid-template-columns: 1fr 1fr; }
  .signup-card #signupForm { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 1.8fr); column-gap: 36px; align-items: start; }
  .signup-card .signup-notice { grid-column: 1; grid-row: 1 / span 2; margin: 6px 0 0; }
  .signup-card .signup-basic, .signup-card .signup-rest { grid-column: 2; display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; align-items: start; }
  .signup-card .signup-basic { grid-row: 1; }
  .signup-card .signup-rest { grid-row: 2; }
  .signup-card .signup-rest > .check, .signup-card .signup-rest > .btn { grid-column: 1 / -1; }
}

/* Pagine di accesso e registrazione su telefono: il selettore della lingua sta sopra la scheda, non sopra il titolo */
@media (max-width: 720px) {
  .account-body > .lang-float { position: static; align-self: flex-end; margin: 0 0 -4px; }
}

/* Area ospiti */
.guest-card { max-width: 760px; }
.guest-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0; }
.guest-tabs button { flex: 1 1 140px; min-height: 44px; padding: 10px 14px; border: 1px solid var(--color-border, #e2e8f0); border-radius: 10px; background: #fff; font-weight: 600; cursor: pointer; }
.guest-tabs button.is-active { background: var(--color-primary, #0f3057); color: #fff; border-color: var(--color-primary, #0f3057); }
.guest-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.guest-email { color: var(--color-text-muted, #64748b); font-size: .9rem; overflow-wrap: anywhere; }
.guest-item { border: 1px solid var(--color-border, #e2e8f0); border-radius: 12px; padding: 12px 14px; margin: 10px 0; display: grid; gap: 4px; }
.guest-item__top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.guest-item__msg { color: var(--color-text-muted, #64748b); font-style: italic; overflow-wrap: anywhere; }
.guest-item--fav { grid-template-columns: 84px 1fr auto; align-items: center; }
.guest-item--fav img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; }
.guest-badge { font-size: .8rem; padding: 3px 10px; border-radius: 999px; background: #e0f2fe; color: #075985; font-weight: 600; }
.guest-badge--confirmed { background: #dcfce7; color: #166534; }
.guest-badge--declined { background: #fee2e2; color: #991b1b; }
.guest-foot { margin-top: 18px; font-size: .9rem; }
@media (max-width: 560px) { .guest-item--fav { grid-template-columns: 64px 1fr; } .guest-item--fav button { grid-column: 1 / -1; } }

/* Messaggi ospite/host */
.msg-thread { max-height: 260px; overflow-y: auto; display: grid; gap: 8px; padding: 8px; border: 1px solid var(--color-border, #e2e8f0); border-radius: 10px; background: #f8fafc; margin: 8px 0; }
.msg { max-width: 88%; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--color-border, #e2e8f0); }
.msg--host { justify-self: end; background: #e0f2fe; border-color: #bae6fd; }
.msg__who { font-size: .75rem; color: var(--color-text-muted, #64748b); margin-bottom: 2px; }
.msg__body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-form { display: grid; gap: 6px; margin-top: 6px; }
.msg-box { margin-bottom: 14px; }
.msg-badge { background: #b91c1c; color: #fff; border-radius: 999px; padding: 1px 8px; font-size: .75rem; margin-left: 4px; }
.guest-msgs { margin-top: 8px; }

#pushOffer{position:fixed;left:50%;transform:translateX(-50%);bottom:16px;z-index:1000;width:min(94vw,520px);background:#fff;color:#1c2b33;border:1px solid #cfd8dc;border-radius:12px;box-shadow:0 8px 28px rgba(0,0,0,.25);padding:14px 16px}
#pushOffer p{margin:0 0 10px}#pushOffer .btn{min-height:44px}

/* ===== Area ospiti: versione ampia (dopo l'accesso) ===== */
/* Larghezza identica prima e dopo l'accesso e tra le schede: niente salti. */
.guest-card, .guest-card.is-in { max-width: 820px; padding: 32px; }
.guest-card.is-in > .sub { display: none; }
#tabRequests, #tabFavorites, #tabAccount { min-height: 460px; }
.guest-head { padding-bottom: 14px; border-bottom: 1px solid var(--color-border, #e2e8f0); justify-content: flex-start; flex-wrap: nowrap; }
.guest-head .btn { width: auto; margin: 0 0 0 auto; }
.guest-head__who { display: grid; min-width: 0; }
.guest-head__who strong { font-size: 1.1rem; }
.avatar { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--color-primary, #0f3057); color: #fff; font-weight: 700; letter-spacing: .5px; }
.guest-tabs { border-bottom: 1px solid var(--color-border, #e2e8f0); gap: 4px; margin: 0 0 16px; }
.guest-tabs button { flex: 0 1 auto; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 12px 16px; color: var(--color-text-muted, #64748b); }
.guest-tabs button.is-active { background: none; color: var(--color-primary, #0f3057); border-bottom-color: var(--color-accent, #0077b6); }
.guest-card.is-in .guest-tabs { margin-top: 10px; }
.guest-tabs .msg-badge { margin-left: 6px; }

.next-stay { display: flex; gap: 12px; align-items: center; background: linear-gradient(135deg, #e0f2fe, #f0f9ff); border: 1px solid #bae6fd; border-radius: 14px; padding: 14px 16px; margin: 4px 0 12px; }
.next-stay__icon { font-size: 1.8rem; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.tile { border: 1px solid var(--color-border, #e2e8f0); border-radius: 12px; padding: 12px; text-align: center; background: #f8fafc; }
.tile b { display: block; font-size: 1.6rem; line-height: 1.1; color: var(--color-primary, #0f3057); }
.tile span { font-size: .8rem; color: var(--color-text-muted, #64748b); }
.tile--alert { background: #fef2f2; border-color: #fecaca; } .tile--alert b { color: #b91c1c; }

.req { display: grid; grid-template-columns: 200px 1fr; gap: 16px; border: 1px solid var(--color-border, #e2e8f0); border-radius: 16px; padding: 12px; margin: 12px 0; background: #fff; box-shadow: 0 1px 3px rgba(15, 48, 87, .06); }
.req__photo { display: block; border-radius: 12px; overflow: hidden; background: #e2e8f0; min-height: 140px; }
.req__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.req__photo span { display: grid; place-items: center; height: 100%; font-size: 2.4rem; }
.req__body { display: grid; gap: 8px; min-width: 0; align-content: start; }
.req__top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.req__top a { font-size: 1.1rem; color: var(--color-primary, #0f3057); text-decoration: none; }
.req__addr { color: var(--color-text-muted, #64748b); }
.req__facts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .92rem; }
.req__actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.guest-card .req__actions .btn, .guest-card .fav__actions .btn, .guest-card .empty .btn { width: auto; margin-top: 0; min-height: 44px; }
.req__actions .msg-badge { margin-left: 8px; background: #fff; color: #b91c1c; }
.steps { list-style: none; display: flex; margin: 4px 0; padding: 0; gap: 0; }
.steps li { flex: 1; position: relative; text-align: center; font-size: .78rem; color: #94a3b8; padding-top: 22px; }
.steps li::before { content: ""; position: absolute; top: 4px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #e2e8f0; z-index: 1; }
.steps li::after { content: ""; position: absolute; top: 10px; left: -50%; width: 100%; height: 3px; background: #e2e8f0; }
.steps li:first-child::after { display: none; }
.steps li.done, .steps li.now { color: var(--color-primary, #0f3057); font-weight: 600; }
.steps li.done::before, .steps li.now::before, .steps li.done::after, .steps li.now::after { background: #0ea5e9; }
.steps li.now::before { box-shadow: 0 0 0 4px #bae6fd; }
.steps li.bad { color: #991b1b; font-weight: 600; } .steps li.bad::before, .steps li.bad::after { background: #ef4444; }

/* Conversazione */
.guest-msgs { margin-top: 4px; border: 1px solid var(--color-border, #e2e8f0); border-radius: 14px; overflow: hidden; background: #f1f5f9; }
.thread { height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 14px 12px; }
.thread-empty { margin: auto; text-align: center; padding: 10px; }
.msg-day { text-align: center; margin: 8px 0 2px; } .msg-day span { font-size: .72rem; color: #64748b; background: #e2e8f0; border-radius: 999px; padding: 2px 10px; text-transform: capitalize; }
.bubble { max-width: 82%; padding: 8px 12px 4px; border-radius: 16px; position: relative; box-shadow: 0 1px 1px rgba(0, 0, 0, .06); }
.bubble__text { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble__time { font-size: .68rem; opacity: .65; text-align: right; margin-top: 1px; }
.bubble--me { align-self: flex-end; background: #0ea5e9; color: #fff; border-bottom-right-radius: 4px; }
.bubble--them { align-self: flex-start; background: #fff; color: #1c2b33; border-bottom-left-radius: 4px; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 8px; background: #fff; border-top: 1px solid var(--color-border, #e2e8f0); }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--color-border, #cbd5e1); border-radius: 20px; padding: 10px 14px; font: inherit; line-height: 1.35; max-height: 140px; }
.composer textarea:focus { outline: 2px solid #0ea5e9; outline-offset: 0; }
.composer__send { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #0ea5e9; color: #fff; font-size: 1.1rem; cursor: pointer; }
.composer__send:hover { background: #0284c7; }

/* Preferiti */
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.fav { border: 1px solid var(--color-border, #e2e8f0); border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 1px 3px rgba(15, 48, 87, .06); display: grid; }
.fav__photo { display: block; aspect-ratio: 4 / 3; background: #e2e8f0; }
.fav__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fav__photo span { display: grid; place-items: center; height: 100%; font-size: 2.4rem; }
.fav__body { padding: 12px; display: grid; gap: 4px; } .fav__body a { color: var(--color-primary, #0f3057); text-decoration: none; }
.fav__body small { color: var(--color-text-muted, #64748b); }
.fav__actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.empty { text-align: center; padding: 28px 12px; } .empty > span { font-size: 2.6rem; display: block; }

@media (max-width: 720px) {
  .guest-card, .guest-card.is-in { padding: 20px 14px; }
  #tabRequests, #tabFavorites, #tabAccount { min-height: 0; }
  .req { grid-template-columns: 1fr; }
  .req__photo { min-height: 0; aspect-ratio: 16 / 9; }
  .bubble { max-width: 92%; }
  .guest-tabs button { flex: 1 1 0; padding: 10px 6px; font-size: .9rem; }
}
.composer textarea { overflow-y: hidden; box-sizing: border-box; min-height: 44px; }
.guest-head__who { min-width: 0; } .guest-head .guest-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-body.guest-body { justify-content: flex-start; padding-top: 28px; }

/* Dati degli ospiti e documenti (dopo la conferma) */
.portal { display: flex; gap: 12px; align-items: center; background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 12px 14px; margin: 4px 0; }
.portal--ok { background: #f0fdf4; border-color: #bbf7d0; }
.portal__icon { font-size: 1.6rem; flex: none; }
.portal__text { display: grid; gap: 2px; flex: 1; min-width: 0; font-size: .9rem; }
.guest-card .portal .btn { width: auto; margin: 0; min-height: 44px; flex: none; }
@media (max-width: 720px) { .portal { flex-wrap: wrap; } .guest-card .portal .btn { width: 100%; } }

/* Accesso unico */
.unified-card .guest-tabs { margin-top: 6px; }
.choice { display: flex; gap: 14px; align-items: center; border: 1px solid var(--color-border, #e2e8f0); border-radius: 14px; padding: 14px 16px; margin: 10px 0; background: #fff; color: inherit; text-decoration: none; cursor: pointer; min-height: 56px; }
.choice:hover { border-color: #0ea5e9; background: #f0f9ff; }
.choice > span:first-child { font-size: 1.6rem; flex: none; }
.choice small { color: var(--color-text-muted, #64748b); }
.choice--last { border-color: #0ea5e9; box-shadow: 0 0 0 3px #bae6fd; }
.choice--radio { align-items: flex-start; }
.choice--radio input { margin-top: 4px; width: 20px; height: 20px; flex: none; }
.choice--radio:has(input:checked) { border-color: #0ea5e9; background: #f0f9ff; }
