/* ============================================================
   AUTH (login / registrati) + DASHBOARD PERSONALE (profilo.php)
   Da caricare DOPO style.css
   ============================================================ */

/* ─── AUTH PAGES ────────────────────────────────────────────── */
.auth-shell {
  display: flex;
  min-height: calc(100vh - 74px); /* 74px ≈ altezza .nav */
}
.auth-brand {
  flex: 1 1 42%;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0050B8 0%, #0273FC 55%, #2E9CFF 100%);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 56px 48px;
}
.ab-geo1 { position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; border: 46px solid rgba(180,223,252,0.12); }
.ab-geo2 { position: absolute; left: -40px; bottom: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,0.06); }
.auth-brand-content { position: relative; z-index: 1; max-width: 380px; }
.auth-brand-content .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: 1.8px; text-transform: uppercase; color: #B4DFFC; margin-bottom: 16px; }
.auth-brand-content .eyebrow::before { content: ''; width: 20px; height: 2px; background: #B4DFFC; border-radius: 1px; }
.auth-brand-content h2 { font-size: 28px; font-weight: 700; line-height: 1.2; margin-bottom: 14px; }
.auth-brand-content p { font-size: 14px; color: rgba(255,255,255,.82); line-height: 1.7; margin-bottom: 28px; }
.auth-brand-features { display: flex; flex-direction: column; gap: 12px; font-size: 13px; font-weight: 500; color: #B4DFFC; }

.auth-form-wrap {
  flex: 1 1 58%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 20px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
}
.auth-card h1 {
  font-size: 26px;
  margin: 6px 0 8px;
}
.auth-sub {
  color: #6B7280;
  font-size: 14px;
  margin-bottom: 28px;
}
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; min-width: 0; }
.form-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-group label { font-size: 13px; font-weight: 600; color: #374151; }
.form-group input,
.form-group select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid #D1D5DB;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 15px;
  font-family: inherit;
  color: #111827;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #0273FC;
  box-shadow: 0 0 0 3px rgba(2, 115, 252, 0.12);
}

/* ─── Campo password con toggle mostra/nascondi ─────────────── */
.password-field { position: relative; }
.password-field input { width: 100%; padding-right: 72px; }
.toggle-pw {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #0273FC;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 6px;
}
.toggle-pw:hover { text-decoration: underline; }

/* ─── Misuratore di forza password ──────────────────────────── */
.pw-strength { margin-top: 8px; display: none; }
.pw-strength.visible { display: block; }
.pw-strength-bar {
  height: 5px;
  background: #E5E9F0;
  border-radius: 3px;
  overflow: hidden;
}
.pw-strength-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: width .2s ease, background .2s ease;
}
.pw-strength-bar span.weak   { width: 33%;  background: #EF4444; }
.pw-strength-bar span.medium { width: 66%;  background: #F59E0B; }
.pw-strength-bar span.strong { width: 100%; background: #22C55E; }
.pw-strength-label { font-size: 12px; margin-top: 4px; font-weight: 600; }
.pw-strength-label.weak   { color: #EF4444; }
.pw-strength-label.medium { color: #F59E0B; }
.pw-strength-label.strong { color: #22C55E; }
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #4B5563;
}
.form-check a { color: #0273FC; }

/* Bottone pieno dedicato ai form auth (su sfondo bianco).
   .btn-primary di style.css ha sfondo bianco/testo blu: pensato
   per stare sopra l'hero blu, su una card bianca sarebbe invisibile. */
.btn-auth-primary {
  display: inline-block;
  background: #0273FC;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border: none;
  border-radius: 12px;
  padding: 13px 26px;
  box-shadow: 0 4px 14px rgba(2,115,252,.35);
  cursor: pointer;
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  transition: transform .15s, box-shadow .15s;
}
.btn-auth-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(2,115,252,.45); }

.btn-block { width: 100%; text-align: center; }
.auth-forgot { text-align: right; margin: -8px 0 4px; font-size: 12px; }
.auth-forgot a { color: var(--muted, #6B7280); }
.auth-forgot a:hover { color: #0273FC; }

.auth-switch {
  text-align: center;
  margin-top: 22px;
  font-size: 14px;
  color: #6B7280;
}
.auth-switch a { color: #0273FC; font-weight: 600; }
.form-alert {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #B91C1C;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 20px;
}
.form-alert ul { margin: 0; padding-left: 18px; }
.form-success {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: #15803D;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .auth-shell { flex-direction: column; min-height: auto; }
  .auth-brand { padding: 40px 24px; }
  .auth-form-wrap { padding: 40px 20px; }
}

/* ─── DASHBOARD HEADER ──────────────────────────────────────── */
.dash-header {
  background: #0B1B33;
  padding: 48px 20px 40px;
  color: #fff;
}
.dash-header-inner { max-width: 1100px; margin: 0 auto; }
.dash-header h1 { font-size: 30px; margin-top: 6px; }

/* ─── TABS ──────────────────────────────────────────────────── */
.dash-section { max-width: 1100px; margin: 0 auto; padding: 32px 20px 80px; }
.dash-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #E5E9F0;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.dash-tab {
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #6B7280;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dash-tab.active { color: #0273FC; border-bottom-color: #0273FC; }
.dash-tab-badge {
  background: #EF4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
  min-width: 18px;
  text-align: center;
}
.dash-panel { padding-top: 4px; }
.dash-muted { color: #9CA3AF; font-size: 14px; }
.dash-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 40px;
}
.dash-two-col > * { min-width: 0; }
.dash-two-col h3 { font-size: 16px; margin-bottom: 14px; }
@media (max-width: 800px) {
  .dash-two-col { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

/* ─── NOTIFICHE ─────────────────────────────────────────────── */
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid #E5E9F0;
  border-radius: 12px;
  background: #fff;
}
.notif-item.unread { background: #F0F7FF; border-color: #BFDBFE; }
.notif-title { font-weight: 600; font-size: 15px; color: #111827; }
.notif-meta { font-size: 13px; color: #6B7280; margin-top: 3px; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: #0273FC; flex-shrink: 0; }

/* ─── RICERCHE SALVATE ──────────────────────────────────────── */
.ricerca-list { display: flex; flex-direction: column; gap: 10px; }
.ricerca-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #E5E9F0;
  border-radius: 12px;
}
.ricerca-criteri { font-size: 13px; color: #6B7280; margin-top: 3px; }
.btn-icon-delete {
  border: none;
  background: #FEF2F2;
  color: #B91C1C;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.btn-icon-delete:hover { background: #FEE2E2; }

/* ─── RICHIESTE CONSULENZA ──────────────────────────────────── */
.richiesta-list { display: flex; flex-direction: column; gap: 12px; }
.richiesta-item {
  border: 1px solid #E5E9F0;
  border-radius: 12px;
  padding: 16px 18px;
}
.richiesta-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.richiesta-msg { font-size: 13px; color: #4B5563; margin: 8px 0 6px; }
.richiesta-data { font-size: 12px; color: #9CA3AF; }
.badge-stato {
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
  padding: 3px 10px;
  border-radius: 999px;
}
.badge-nuova { background: #DBEAFE; color: #1D4ED8; }
.badge-in_lavorazione { background: #FEF3C7; color: #B45309; }
.badge-chiusa { background: #DCFCE7; color: #15803D; }

/* ─── HEART BUTTON (stato attivo) ───────────────────────────── */
/* .heart.active vive in style.css (caricato ovunque), non serve duplicarla qui */

/* ─── SCHERMATE DI SUCCESSO (email inviata / confermata) ────── */
.auth-success { text-align: center; }
.auth-success-icon { font-size: 40px; margin-bottom: 12px; }
.auth-success h1 { font-size: 24px; margin-bottom: 10px; }
.auth-success .btn-auth-primary {
  display: inline-block;
  text-decoration: none;
  margin-top: 8px;
}
.auth-success-standalone {
  max-width: 440px;
  margin: 0 auto;
  padding: 64px 20px;
}

/* ─── PAGINE LEGALI (privacy, cookie) ───────────────────────── */
.legal-section {
  display: flex;
  justify-content: center;
  padding: 56px 20px 96px;
}

/* ─── EMPTY STATE ARRICCHITO (dashboard: notifiche/ricerche/richieste) ── */
.empty-state-rich { text-align: center; padding: 56px 24px; }
.empty-state-icon {
  width: 56px; height: 56px; margin: 0 auto 18px;
  background: var(--blue-ultra); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}
.empty-state-rich h3 { font-size: 17px; margin-bottom: 8px; color: var(--text); }
.empty-state-rich p { color: var(--muted); font-size: 14px; max-width: 380px; margin: 0 auto 22px; line-height: 1.6; }
.empty-state-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.legal-card {
  width: 100%;
  max-width: 760px;
}
.legal-card h1 { font-size: 30px; margin: 6px 0 4px; }
.legal-updated { color: #9CA3AF; font-size: 13px; margin-bottom: 28px; }
.legal-notice { color: #4B5563; font-size: 15px; margin-bottom: 32px; }
.legal-card h2 { font-size: 18px; margin: 32px 0 12px; }
.legal-card p { color: #4B5563; font-size: 14px; line-height: 1.7; margin-bottom: 10px; }
.legal-card ul { margin: 0 0 10px; padding-left: 20px; color: #4B5563; font-size: 14px; line-height: 1.8; }
.legal-card a { color: #0273FC; }
.legal-table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 13px; }
.legal-table th, .legal-table td { text-align: left; padding: 10px 12px; border: 1px solid #E5E9F0; }
.legal-table th { background: #F9FAFB; font-weight: 600; }
.legal-disclaimer {
  margin-top: 36px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.6;
}

/* ── Preferenze di avviso (email / push) ───────────────────── */
.notif-prefs { background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 14px; padding: 18px 20px; margin-bottom: 20px; }
.notif-prefs h3 { font-size: 16px; font-weight: 700; margin: 0 0 6px; color: #0D1B2A; }
.notif-prefs > p { font-size: 13px; color: #5A7A9A; line-height: 1.6; margin: 0 0 14px; }
.notif-prefs .form-success { margin-bottom: 12px; }
.notif-prefs-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid #E2E8F0; font-size: 14px; }
.notif-check { display: flex; align-items: center; gap: 10px; cursor: pointer; flex: 1; min-width: 200px; }
.notif-check input { width: 18px; height: 18px; accent-color: #0273FC; }
.notif-prefs-status { font-size: 12.5px; color: #5A7A9A; margin-top: 3px; line-height: 1.5; max-width: 520px; }
.notif-prefs-status[data-state="on"] { color: #15803D; }
.notif-prefs-status[data-state="denied"], .notif-prefs-status[data-state="ios-install"] { color: #B45309; }
.notif-prefs .btn-auth-primary { padding: 10px 18px; font-size: 13px; }
.notif-prefs .btn-outline { padding: 9px 16px; font-size: 13px; cursor: pointer; background: transparent; }
.notif-prefs-test { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: #5A7A9A; padding-top: 4px; }
.notif-prefs [hidden] { display: none !important; }

/* ─── FIX MOBILE: nessun overflow orizzontale in dashboard ──── */
.dash-section { overflow-x: clip; }
.ricerca-item > div:first-child { min-width: 0; flex: 1; }
.ricerca-criteri { overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .form-row { gap: 10px; }
  .ricerca-item { flex-direction: column; align-items: flex-start; }
  .ricerca-item .ricerca-azioni { flex-wrap: wrap; }
}
