/* ===================================================
   Smonta il Debito — Corporate Blue Theme
   =================================================== */

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

:root {
  --navy:        #1a3a5c;
  --navy-dark:   #0f2640;
  --navy-mid:    #234876;
  --blue:        #2563eb;
  --blue-hover:  #1d4ed8;
  --blue-pale:   #eff6ff;
  --blue-light:  #bfdbfe;
  --green:       #059669;
  --green-pale:  #ecfdf5;
  --amber:       #d97706;
  --amber-pale:  #fffbeb;
  --red:         #dc2626;
  --red-pale:    #fef2f2;
  --text:        #1e293b;
  --text-muted:  #64748b;
  --border:      #e2e8f0;
  --bg:          #f1f5f9;
  --card:        #ffffff;
  --shadow-sm:   0 1px 2px rgba(0,0,0,.06);
  --shadow:      0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:   0 10px 20px rgba(0,0,0,.09), 0 4px 6px rgba(0,0,0,.05);
  --radius:      6px;
  --radius-lg:   10px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* ===== SITE HEADER ===== */
.site-header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.2px;
}
.logo-icon {
  width: 34px; height: 34px;
  background: var(--blue);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-size: 17px;
  flex-shrink: 0;
}
.site-nav { display: flex; gap: 2px; }
.nav-link {
  padding: 7px 14px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  transition: all .15s;
}
.nav-link:hover  { color: #fff; background: rgba(255,255,255,.1); }
.nav-link.active { color: #fff; background: rgba(255,255,255,.12); }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy-mid) 100%);
  color: #fff;
  padding: 60px 24px 68px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 65% 40%, rgba(37,99,235,.35) 0%, transparent 55%);
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 680px; margin: 0 auto; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.85);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 5px 16px;
  border-radius: 99px;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.5px;
  margin-bottom: 16px;
}
.hero h1 span { color: #60a5fa; }
.hero p {
  font-size: 1.05rem;
  color: rgba(255,255,255,.6);
  max-width: 500px;
  margin: 0 auto 36px;
  font-weight: 300;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}
.hero-stat-n {
  font-size: 1.8rem;
  font-weight: 800;
  color: #60a5fa;
  line-height: 1;
}
.hero-stat-l {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin-top: 5px;
}

/* ===== CALCULATOR SECTION ===== */
.calc-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 20px 90px;
}

/* TAB NAV */
.tab-nav {
  display: flex;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 5px;
  margin-bottom: 28px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  box-shadow: var(--shadow-sm);
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  flex-shrink: 0;
  padding: 9px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all .15s;
  white-space: nowrap;
}
.tab-btn:hover  { color: var(--text); background: var(--bg); }
.tab-btn.active { background: var(--navy); color: #fff; }

/* PANEL LAYOUT */
.tab-panel { display: none; }
.tab-panel.active {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 760px) {
  .tab-panel.active { grid-template-columns: 1fr; }
}

/* ===== CARDS ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card-header {
  background: var(--navy);
  padding: 18px 24px;
}
.card-header-tag {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin-bottom: 3px;
}
.card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.card-body { padding: 22px 24px; }

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 18px; }
.form-group:last-of-type { margin-bottom: 0; }
.form-label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 7px;
}
.form-hint {
  font-size: 11px;
  color: #94a3b8;
  margin-top: -3px;
  margin-bottom: 7px;
}
.input-wrap {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  overflow: hidden;
}
.input-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.input-pfx, .input-sfx {
  padding: 0 12px;
  color: var(--text-muted);
  font-size: 13px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  white-space: nowrap;
  min-height: 44px;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.input-sfx { border-right: none; border-left: 1px solid var(--border); }
input[type="number"],
input[type="date"],
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  width: 100%;
  padding: 10px 14px;
  min-height: 44px;
  -webkit-appearance: none;
  appearance: none;
}
input::placeholder, textarea::placeholder { color: #cbd5e1; }
select { background: white; cursor: pointer; }
textarea {
  min-height: 100px;
  resize: vertical;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
  padding: 11px 14px;
}
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  outline: none;
}
.standalone-input {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 15px;
  color: var(--text);
  width: 100%;
  outline: none;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.standalone-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 480px) { .form-grid { grid-template-columns: 1fr; } }

/* CALCULATE BUTTON */
.btn-calc {
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .3px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn-calc:hover  { background: var(--blue-hover); }
.btn-calc:active { transform: scale(.99); }

/* ===== RESULT CARD ===== */
.result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: none;
}
.result-card.visible { display: block; animation: fadeUp .32s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-header {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  padding: 22px 24px 18px;
}
.result-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin-bottom: 5px;
}
.result-main {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -.5px;
}
.result-sub {
  font-size: 12px;
  color: rgba(255,255,255,.4);
  margin-top: 6px;
}
.result-body { padding: 18px 22px; }

/* STATS GRID */
.stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.stats-row.cols3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 440px) {
  .stats-row.cols3 { grid-template-columns: repeat(2, 1fr); }
}
.stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
}
.stat-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.stat-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.stat-value.green { color: var(--green); }
.stat-value.amber { color: var(--amber); }
.stat-value.red   { color: var(--red);   }

/* VERDICT */
.verdict {
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  border-left: 3px solid;
}
.verdict.ok     { background: var(--green-pale); border-color: var(--green); }
.verdict.warn   { background: var(--amber-pale); border-color: var(--amber); }
.verdict.danger { background: var(--red-pale);   border-color: var(--red);   }
.verdict-title  { font-size: 13.5px; font-weight: 700; margin-bottom: 4px; }
.verdict.ok     .verdict-title { color: #065f46; }
.verdict.warn   .verdict-title { color: #92400e; }
.verdict.danger .verdict-title { color: #991b1b; }
.verdict-body { font-size: 12.5px; color: var(--text-muted); line-height: 1.65; }

/* PROGRESS BAR */
.progress-wrap { margin-bottom: 18px; }
.progress-hd {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
}
.progress-lbl { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.progress-pct { font-size: 1.8rem; font-weight: 800; color: var(--text); line-height: 1; }
.progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .85s cubic-bezier(.4,0,.2,1), background .3s;
}

/* AMORTIZATION TABLE */
.ammo-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 14px;
}
.ammo-head {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.1fr 1.2fr;
  background: var(--navy);
  padding: 8px 14px;
  gap: 6px;
}
.ammo-head span {
  font-size: 9.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
}
.ammo-body { max-height: 230px; overflow-y: auto; }
.ammo-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.1fr 1.2fr;
  padding: 8px 14px;
  gap: 6px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border);
}
.ammo-row:last-child { border-bottom: none; }
.ammo-row:nth-child(even) { background: #fafbfd; }
.col-muted { color: var(--text-muted); }
.col-red   { color: var(--red); }
.col-green { color: var(--green); }

/* DEBT ROWS (consolidamento) */
.debt-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.debt-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 10px;
  align-items: end;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
@media (max-width: 480px) { .debt-row { grid-template-columns: 1fr; } }
.debt-row-num {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 10px;
  grid-column: 1/-1;
}
.btn-add-debt {
  padding: 9px 14px;
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--blue);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  transition: all .15s;
  margin-bottom: 14px;
}
.btn-add-debt:hover { border-color: var(--blue); background: var(--blue-pale); }

/* SAVE BUTTON */
.btn-save {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: all .15s;
  margin-top: 12px;
}
.btn-save:hover  { border-color: var(--blue); color: var(--blue); background: var(--blue-pale); }
.btn-save.saved  { border-color: var(--green); color: var(--green); background: var(--green-pale); cursor: default; }
.btn-save.saving { opacity: .55; cursor: wait; }

/* DISCLAIMER */
.disclaimer {
  font-size: 10.5px;
  color: #94a3b8;
  line-height: 1.7;
  text-align: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ===== REVIEWS PAGE ===== */
.page-section {
  max-width: 920px;
  margin: 0 auto;
  padding: 48px 20px 90px;
}
.section-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
}
.section-title {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -.3px;
  margin-bottom: 10px;
  line-height: 1.15;
}
.section-desc {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 600px;
}
.section-heading { margin-bottom: 36px; }

/* REVIEW FORM CARD */
.review-form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 48px;
  box-shadow: var(--shadow);
}
.review-form-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .form-row-2 { grid-template-columns: 1fr; } }

/* STARS WIDGET */
.stars-wrap { margin-bottom: 18px; }
.stars-lbl {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: block;
}
.stars-widget { display: flex; gap: 4px; }
.star-btn {
  width: 38px; height: 38px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 26px;
  color: #d1d5db;
  transition: color .1s, transform .1s;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.star-btn:hover,
.star-btn.active { color: #f59e0b; }
.star-btn:hover  { transform: scale(1.15); }

.btn-submit-review {
  padding: 13px 28px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
  margin-top: 6px;
}
.btn-submit-review:hover  { background: var(--navy-mid); }
.btn-submit-review:active { transform: scale(.99); }

/* REVIEWS GRID */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}
.review-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.review-stars { display: flex; gap: 3px; margin-bottom: 12px; }
.review-stars .s-on  { color: #f59e0b; font-size: 17px; }
.review-stars .s-off { color: #e2e8f0; font-size: 17px; }
.review-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 16px;
}
.review-meta { border-top: 1px solid var(--border); padding-top: 12px; }
.review-author { font-size: 12px; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: .5px; }
.review-date   { font-size: 11px; color: #94a3b8; margin-top: 2px; }

.reviews-avg {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}
.avg-score {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}
.avg-stars { display: flex; gap: 2px; margin-bottom: 3px; }
.avg-count { font-size: 12px; color: var(--text-muted); }

/* ALERTS */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert.success { background: var(--green-pale); color: #065f46; border: 1px solid #a7f3d0; }
.alert.error   { background: var(--red-pale);   color: #991b1b; border: 1px solid #fca5a5; }
.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 15px;
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: .4; }

/* ===== ADMIN PANEL ===== */
.admin-wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 32px 20px 90px;
}
.admin-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}
.admin-hd h2 { font-size: 1.5rem; font-weight: 800; color: var(--navy); }
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}
.admin-stat-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.admin-stat-box .astat-n { font-size: 2rem; font-weight: 800; color: var(--navy); line-height: 1; }
.admin-stat-box .astat-l { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }
.admin-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}
.badge.pending  { background: #fef3c7; color: #92400e; }
.badge.approved { background: #d1fae5; color: #065f46; }
.badge.rejected { background: #fee2e2; color: #991b1b; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  margin-bottom: 36px;
}
.data-table th {
  background: var(--navy);
  color: rgba(255,255,255,.65);
  font-size: 9.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 10px 16px;
  text-align: left;
  font-weight: 500;
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafbfd; }
.td-muted { color: var(--text-muted); font-size: 12px; }

.btn-sm {
  padding: 5px 11px;
  border: none;
  border-radius: var(--radius);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-sm:hover   { opacity: .8; }
.btn-approve    { background: #d1fae5; color: #065f46; }
.btn-reject     { background: #fee2e2; color: #991b1b; }
.btn-delete     { background: #f1f5f9; color: var(--text-muted); }
.action-group   { display: flex; gap: 6px; flex-wrap: wrap; }

/* LOGIN */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-logo { font-size: 2rem; margin-bottom: 16px; }
.login-card h2 { font-size: 1.3rem; font-weight: 800; color: var(--navy); margin-bottom: 5px; }
.login-card p  { font-size: 13px; color: var(--text-muted); margin-bottom: 26px; }
.btn-logout {
  padding: 7px 16px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.8);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.btn-logout:hover { background: rgba(255,255,255,.18); color: #fff; }
.btn-login {
  width: 100%;
  padding: 13px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-login:hover { background: var(--navy-mid); }

/* ===== HOMEPAGE CALCULATOR CARDS ===== */
.home-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}
.home-section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -.2px;
  margin-bottom: 6px;
}
.home-section-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.calc-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 56px;
}
@media (max-width: 900px) { .calc-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .calc-cards { grid-template-columns: 1fr; } }

.calc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 22px 18px;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.calc-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--blue);
  transform: scaleX(0);
  transition: transform .2s;
  transform-origin: left;
}
.calc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--blue-light); }
.calc-card:hover::after { transform: scaleX(1); }
.calc-card-num {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 10px;
}
.calc-card-icon { font-size: 1.8rem; margin-bottom: 12px; }
.calc-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 7px;
  line-height: 1.25;
}
.calc-card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}
.calc-card-cta {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== CALCULATOR PAGE LAYOUT ===== */
.calc-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--blue); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: #cbd5e1; }
.breadcrumb-current { color: var(--text); font-weight: 500; }

.calc-page-header { margin-bottom: 28px; }
.calc-page-num {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 6px;
}
.calc-page-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -.3px;
  margin-bottom: 6px;
}
.calc-page-desc {
  font-size: 14px;
  color: var(--text-muted);
}
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 760px) { .calc-layout { grid-template-columns: 1fr; } }

/* AUTO-SAVE STATUS */
.autosave-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--green);
  margin-top: 12px;
  min-height: 20px;
}
.autosave-status.error { color: var(--amber); }
.autosave-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ===== AGENCY CARDS (recensioni) ===== */
.agency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.agency-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  text-decoration: none;
  color: var(--text);
  display: block;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.agency-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--blue-light); }
.agency-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}
.agency-card-city {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.agency-card-stars { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.agency-card-stars .s-on  { color: #f59e0b; font-size: 16px; }
.agency-card-stars .s-off { color: #e2e8f0; font-size: 16px; }
.agency-card-avg { font-size: 13px; font-weight: 700; color: var(--text); }
.agency-card-count { font-size: 12px; color: var(--text-muted); }
.agency-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.agency-card-cta {
  margin-top: 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--blue);
}

/* SINGLE AGENCY PAGE */
.agency-header {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  color: #fff;
  padding: 36px 32px 32px;
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
}
.agency-header h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 6px; }
.agency-header-meta { font-size: 13px; color: rgba(255,255,255,.55); display: flex; gap: 16px; flex-wrap: wrap; }
.agency-header-meta a { color: rgba(255,255,255,.7); text-decoration: none; }
.agency-header-meta a:hover { color: #fff; }
.agency-avg-big { font-size: 3rem; font-weight: 800; color: #60a5fa; line-height: 1; margin-bottom: 4px; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--navy);
  color: #fff;
  padding: 13px 20px;
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  animation: toastIn .25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 320px;
}
.toast.green { background: var(--green); }
.toast.red   { background: var(--red); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== FOOTER ===== */
footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,.4);
  text-align: center;
  padding: 28px 24px;
  font-size: 12px;
  line-height: 1.7;
}
footer a { color: rgba(255,255,255,.55); text-decoration: none; }
footer a:hover { color: #fff; }
.footer-brand { margin-bottom: 6px; }
.footer-brand strong { color: rgba(255,255,255,.75); }
.footer-reg { display: block; font-size: 11px; color: rgba(255,255,255,.3); margin-top: 2px; }
.footer-nav { margin: 10px 0 8px; }
.footer-sep { margin: 0 6px; opacity: .3; }
.footer-disclaimer { font-size: 11px; color: rgba(255,255,255,.25); }

/* ===== UTILITIES ===== */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.text-muted { color: var(--text-muted); }
.mt-0  { margin-top: 0; }
.mb-0  { margin-bottom: 0; }


/* ===== SEO TEXT BLOCK ===== */
.calc-seo-text {
  max-width: 860px;
  margin: 48px auto 0;
  padding: 0 16px 48px;
  color: var(--text);
  line-height: 1.75;
  font-size: 0.95rem;
}
.calc-seo-text h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.calc-seo-text h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 28px 0 8px;
}
.calc-seo-text p { margin: 0 0 14px; }
.calc-seo-text ul { padding-left: 22px; margin: 0 0 14px; }
.calc-seo-text ul li { margin-bottom: 6px; }
.calc-seo-text strong { color: var(--navy); }

/* ===== PRIVACY NOTE ===== */
.privacy-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  font-size: 11.5px;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 7px 12px;
}
.privacy-note i { color: #059669; font-size: 11px; flex-shrink: 0; }

/* ===== SITEMAP PAGE ===== */
.sitemap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}
.sitemap-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.sitemap-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--navy);
  padding: 14px 20px;
  color: #fff;
}
.sitemap-section-header i { font-size: 14px; opacity: .8; }
.sitemap-section-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
}
.sitemap-list {
  list-style: none;
  padding: 12px 0;
}
.sitemap-list li {
  border-bottom: 1px solid var(--border);
}
.sitemap-list li:last-child { border-bottom: none; }
.sitemap-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  color: var(--navy);
  text-decoration: none;
  font-size: 13.5px;
  transition: background .12s;
}
.sitemap-list a::before {
  content: '›';
  color: var(--blue);
  font-weight: 700;
  flex-shrink: 0;
}
.sitemap-list a:hover { background: var(--bg); color: var(--blue); }
