/* ── QPIDO BRAND CSS ─────────────────────────────────────── */
:root {
  --qblue:     #3977a7;
  --qnavy:     #204870;
  --qblack:    #2c3135;
  --qorange:   #ffb126;
  --qbluegray: #f0f4f7;
  --qwhite:    #ffffff;
  --qmid:      #58626c;
  --qgray:     #94a2ac;
  --border:    #d2dce4;
  --radius-card: 12px;
  --shadow-card: 0 2px 10px rgba(0,0,0,0.07);
  --transition:  0.2s ease;
}

* { box-sizing: border-box; }

body {
  font-family: 'Nunito', 'Calibri', 'Segoe UI', sans-serif;
  color: var(--qblack);
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main#main-content { flex: 1; }

/* ── NAVBAR ── */
.qpido-navbar {
  background: var(--qblue) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  padding: 0.6rem 0;
}
.qpido-navbar .nav-link {
  color: rgba(255,255,255,0.88) !important;
  font-weight: 600;
  transition: color var(--transition);
  padding: 0.5rem 0.9rem;
}
.qpido-navbar .nav-link:hover,
.qpido-navbar .nav-link.active { color: #fff !important; }
.qpido-navbar .nav-link.active { text-decoration: underline; text-underline-offset: 4px; }
.fw-600 { font-weight: 600; }

/* Logo navbar */
.qpido-logo-nav { display:inline-flex; align-items:center; gap:2px; }
.qpido-logo-text {
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
  font-family: 'Nunito', sans-serif;
  line-height: 1;
}
.qpido-logo-butterfly {
  font-size: 1.1rem;
  filter: hue-rotate(200deg) saturate(1.5);
  line-height: 1;
  margin-top: -4px;
}

/* Logo footer (JPG su sfondo chiaro) */
.footer-logo { height: 36px; width: auto; }

/* ── CARDS ── */
.qpido-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  background: #fff;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.qpido-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.11);
  transform: translateY(-2px);
}
.qpido-card-acquirente { border-top: 5px solid var(--qblue); }
.qpido-card-venditore  { border-top: 5px solid var(--qnavy); }
.qpido-card-agenzia    { border-top: 5px solid var(--qblack); }
.qpido-card-orange     { border-top: 5px solid var(--qorange); }
.qpido-card-shared     { border-top: 5px solid var(--qgray); }

/* ── BADGES ── */
.badge-acquirente { background: var(--qblue)   !important; color: #fff; border-radius:50px; font-size:.75rem; padding:.35em .7em; }
.badge-venditore  { background: var(--qnavy)   !important; color: #fff; border-radius:50px; font-size:.75rem; padding:.35em .7em; }
.badge-agenzia    { background: var(--qblack)  !important; color: #fff; border-radius:50px; font-size:.75rem; padding:.35em .7em; }
.badge-orange     { background: var(--qorange) !important; color: var(--qblack); border-radius:50px; font-size:.75rem; padding:.35em .7em; }

/* ── MATCH SCORE CIRCLE ── */
.match-score {
  width:44px; height:44px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:.85rem; flex-shrink:0;
}
.match-score.high   { background:#d1f5e0; color:#0a8246; }
.match-score.medium { background:#fff3cd; color:#856404; }
.match-score.low    { background:#fde8e8; color:#842029; }

/* ── BUTTONS ── */
.btn-qblue {
  background: var(--qblue); color: #fff; border: none;
  border-radius: 50px; font-weight: 700;
  transition: background var(--transition);
}
.btn-qblue:hover { background: var(--qnavy); color: #fff; }

.btn-qorange {
  background: var(--qorange); color: var(--qblack); border: none;
  border-radius: 50px; font-weight: 700;
  transition: filter var(--transition);
}
.btn-qorange:hover { filter: brightness(0.92); color: var(--qblack); }

.btn-qnavy {
  background: var(--qnavy); color: #fff; border: none;
  border-radius: 50px; font-weight: 700;
}
.btn-qnavy:hover { background: #163350; color: #fff; }

/* ── HERO HOMEPAGE ── */
.qpido-hero {
  background: linear-gradient(135deg, var(--qblue) 0%, var(--qnavy) 100%);
  color: #fff;
  padding: 5rem 0 6rem;
  position: relative;
  overflow: hidden;
}
.qpido-hero::before {
  content:'';
  position:absolute; top:-60px; right:-60px;
  width:400px; height:400px;
  background: rgba(255,255,255,0.05);
  border-radius:50%;
}
.qpido-hero::after {
  content:'';
  position:absolute; bottom:-1px; left:0; right:0;
  height:60px;
  background:#fff;
  clip-path: ellipse(55% 100% at 50% 100%);
}
.qpido-hero h1 { font-size: 2.8rem; font-weight: 900; line-height: 1.15; }
.qpido-hero .hero-sub { font-size: 1.15rem; opacity: .9; }

/* Phone mockup hero */
.phone-mockup {
  background: linear-gradient(160deg, var(--qbluegray) 0%, #dde8f0 100%);
  border-radius: 36px;
  padding: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  max-width: 240px;
  margin: 0 auto;
}
.phone-mockup-inner {
  background: var(--qbluegray);
  border-radius: 28px;
  overflow: hidden;
  padding: 1rem;
  color: var(--qblack);
}

/* ── PROFILE CHOICE CARDS ── */
.profile-choice-card {
  border-radius: 16px;
  padding: 1.75rem;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: all var(--transition);
  background: #fff;
  text-align: center;
}
.profile-choice-card:hover { border-color: var(--qblue); box-shadow: 0 8px 24px rgba(57,119,167,0.15); }
.profile-choice-card.active { border-color: var(--qblue); background: var(--qbluegray); }
.profile-choice-card .icon-wrapper {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem; font-size: 1.5rem;
}

/* ── HOW IT WORKS STEPS ── */
.step-number {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--qblue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.2rem; flex-shrink: 0;
}
.step-connector { width: 2px; height: 40px; background: var(--border); margin: 0 auto; }

/* ── KPI CARDS (dashboard) ── */
.kpi-card {
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.kpi-value { font-size: 2.2rem; font-weight: 800; line-height: 1; color: var(--qblue); }
.kpi-trend-up   { color: #0a8246; font-size: 0.8rem; font-weight: 600; }
.kpi-trend-down { color: #842029; font-size: 0.8rem; font-weight: 600; }

/* ── AI INSIGHT CARD ── */
.ai-insight-card {
  background: var(--qbluegray);
  border-radius: var(--radius-card);
  padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  border: 1px solid rgba(57,119,167,0.15);
}
.ai-insight-card .ai-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--qblue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 1rem;
}
.ai-insight-card .ai-arrow {
  width: 32px; height: 32px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer;
  transition: background var(--transition);
}
.ai-insight-card .ai-arrow:hover { background: var(--qblue); color: #fff; }

/* ── TAB SWITCHER (dashboard) ── */
.tab-switcher {
  display: flex; gap: .5rem; background: var(--qbluegray);
  border-radius: 50px; padding: 4px; width: 100%;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-switcher::-webkit-scrollbar { display: none; }
.tab-switcher .tab-btn {
  border: none; border-radius: 50px; padding: .4rem 1rem;
  background: transparent; font-weight: 700; color: var(--qmid);
  transition: all var(--transition); position: relative;
  font-family: inherit; font-size: .85rem; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
}
.tab-switcher .tab-btn.active { background: var(--qblue); color: #fff; box-shadow: 0 2px 8px rgba(57,119,167,0.3); }
.tab-switcher .tab-btn .tab-badge {
  position: absolute; top: -6px; right: -4px;
  background: #dc3545; color: #fff;
  border-radius: 50%; width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 700;
}

/* ── MATCH CARD (lista/dashboard) ── */
.match-card {
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  padding: 1rem;
  background: #fff;
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
  cursor: pointer;
}
.match-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.1); border-color: var(--qblue); transform: translateY(-1px); }
.match-card .match-info-row { display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--qmid); }

/* ── RICHIESTA CARD ── */
.richiesta-card {
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  padding: 1.25rem;
  background: #fff;
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
}
.richiesta-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.1); border-color: var(--qblue); }

/* ── PLAN CARDS (prezzi) ── */
.plan-card {
  border-radius: 16px;
  padding: 2rem;
  border: 2px solid var(--border);
  transition: all var(--transition);
  position: relative;
  background: #fff;
}
.plan-card.featured { border-color: var(--qblue); box-shadow: 0 8px 32px rgba(57,119,167,0.18); }
.plan-card .plan-price { font-size: 2.6rem; font-weight: 800; color: var(--qblue); }
.plan-card .plan-price small { font-size: 1rem; color: var(--qgray); font-weight: 400; }
.plan-card ul li { padding: .3rem 0; font-size: .9rem; }
.badge-featured {
  position:absolute; top:-14px; left:50%; transform:translateX(-50%);
  background:var(--qorange); color:var(--qblack); font-weight:700;
  border-radius:50px; padding:2px 16px; font-size:.75rem; white-space:nowrap;
}

/* ── CREDITI PACCHETTI ── */
.crediti-pack {
  border-radius: 14px;
  border: 2px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: #fff;
  position: relative;
}
.crediti-pack:hover, .crediti-pack.selected { border-color: var(--qorange); background: #fffbf0; }
.crediti-pack .pack-price { font-size: 1.8rem; font-weight: 800; color: var(--qblack); }
.crediti-pack .pack-unit { color: var(--qgray); font-size: .8rem; }
.crediti-pack .pack-badge {
  position:absolute; top:-12px; left:50%; transform:translateX(-50%);
  background:var(--qorange); color:var(--qblack); font-weight:700;
  border-radius:50px; padding:2px 14px; font-size:.72rem; white-space:nowrap;
}

/* ── WIZARD REGISTRAZIONE ── */
.wizard-steps { display:flex; align-items:flex-start; margin-bottom:2rem; }
.wizard-step { flex:1; text-align:center; position:relative; }
.wizard-step-circle {
  width:36px; height:36px; border-radius:50%;
  background:var(--border); color:var(--qgray);
  display:flex; align-items:center; justify-content:center;
  font-weight:700; margin:0 auto 6px;
  transition:all var(--transition);
}
.wizard-step.active .wizard-step-circle { background:var(--qblue); color:#fff; box-shadow:0 0 0 4px rgba(57,119,167,0.2); }
.wizard-step.done   .wizard-step-circle { background:#0a8246; color:#fff; }
.wizard-step-label { font-size:.75rem; color:var(--qgray); font-weight:600; }
.wizard-step.active .wizard-step-label { color:var(--qblue); }
.wizard-step.done   .wizard-step-label { color:#0a8246; }
.wizard-step:not(:last-child)::after {
  content:''; position:absolute; top:18px; left:60%; right:-40%;
  height:2px; background:var(--border);
}
.wizard-step.done:not(:last-child)::after { background:#0a8246; }

/* ── AUTH PAGES ── */
.auth-container { min-height:100vh; background:var(--qbluegray); display:flex; align-items:center; padding:2rem 0; }
.auth-card {
  background:#fff; border-radius:20px; padding:2.5rem;
  box-shadow:0 8px 40px rgba(0,0,0,0.1);
  max-width:440px; width:100%; margin:0 auto;
}

/* ── CHAT AI ── */
.chat-container {
  height:480px; overflow-y:auto;
  border:1px solid var(--border); border-radius:var(--radius-card);
  padding:1.5rem; background:var(--qbluegray);
}
.chat-bubble {
  max-width:80%; padding:.75rem 1rem;
  border-radius:18px; margin-bottom:.75rem;
  font-size:.9rem; line-height:1.5;
}
.chat-bubble.user { background:var(--qblue); color:#fff; margin-left:auto; border-bottom-right-radius:4px; }
.chat-bubble.ai   { background:#fff; border:1px solid var(--border); border-bottom-left-radius:4px; }

/* ── MOBILE BOTTOM NAV ── */
.mobile-bottom-nav {
  position:fixed; bottom:0; left:0; right:0; z-index:1000;
  background:#fff; border-top:1px solid var(--border);
  display:flex; padding:.5rem 0 calc(.5rem + env(safe-area-inset-bottom));
  box-shadow:0 -2px 12px rgba(0,0,0,0.08);
  transform:translateZ(0); -webkit-transform:translateZ(0);
  will-change:transform;
}
.mobile-nav-item {
  flex:1; display:flex; flex-direction:column; align-items:center;
  gap:.2rem; text-decoration:none; color:var(--qgray);
  font-size:.65rem; font-weight:600; padding:.25rem 0;
  transition:color var(--transition);
}
.mobile-nav-item i { font-size:1.1rem; }
.mobile-nav-item.active { color:var(--qblue); }
.pb-footer-mobile { padding-bottom: 80px !important; }

/* ── FOOTER ── */
.qpido-footer { background:var(--qbluegray); border-top:1px solid var(--border); }

/* ── UTILITIES ── */
.text-qblue    { color:var(--qblue)   !important; }
.text-qorange  { color:var(--qorange) !important; }
.text-qnavy    { color:var(--qnavy)   !important; }
.bg-qblue      { background:var(--qblue)    !important; color:#fff; }
.bg-qorange    { background:var(--qorange)  !important; }
.bg-qbluegray  { background:var(--qbluegray)!important; }
.bg-qnavy      { background:var(--qnavy)    !important; color:#fff; }
.rounded-pill-xl { border-radius:50px !important; }
.shadow-qpido  { box-shadow:var(--shadow-card); }
.fw-800        { font-weight:800; }
.fw-900        { font-weight:900; }

/* ── DASHBOARD PAGE ── */
.dashboard-wrapper { background:var(--qbluegray); min-height:calc(100vh - 64px); padding:2rem 0 6rem; }
.dashboard-header { background:#fff; border-bottom:1px solid var(--border); padding:1.25rem 0; margin-bottom:1.5rem; }

/* ── SECTION TITLES ── */
.section-title { font-weight:800; font-size:1.8rem; color:var(--qblack); }
.section-sub   { color:var(--qmid); font-size:1rem; }

/* ── FAQ ACCORDION ── */
.accordion-button:not(.collapsed) { background:var(--qbluegray); color:var(--qblue); font-weight:700; box-shadow:none; }
.accordion-button:focus { box-shadow:none; }
.accordion-button { font-weight:600; }

/* ── FORM CONTROLS ── */
.form-control:focus, .form-select:focus { border-color:var(--qblue); box-shadow:0 0 0 .2rem rgba(57,119,167,.2); }
.form-check-input:checked { background-color:var(--qblue); border-color:var(--qblue); }

/* ── STATS BANNER ── */
.stats-banner { background:var(--qbluegray); border-radius:var(--radius-card); padding:2rem; }
.stat-item .stat-num { font-size:2.2rem; font-weight:900; color:var(--qblue); }
.stat-item .stat-label { color:var(--qmid); font-size:.9rem; }

/* ── PILL BUTTONS (tipologia) ── */
.pill-btn {
  border: 2px solid var(--border);
  border-radius: 50px;
  padding: .5rem 1.25rem;
  background: #fff;
  font-weight: 700;
  color: var(--qmid);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  font-size: .9rem;
}
.pill-btn:hover { border-color: var(--qblue); color: var(--qblue); }
.pill-btn.selected { background: var(--qblue); color: #fff; border-color: var(--qblue); }

/* ── COMPARE TABLE ── */
.compare-table th { background: var(--qbluegray); font-weight: 800; }
.compare-table td, .compare-table th { padding: .75rem 1rem; vertical-align: middle; }
.compare-table .check-yes { color: #0a8246; font-size: 1.1rem; }
.compare-table .check-no  { color: #842029; font-size: 1.1rem; }

/* ── FEATURE GRID ── */
.feature-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--qbluegray); border-radius: 50px;
  padding: .4rem 1rem; font-size: .85rem; font-weight: 600;
  color: var(--qmid); border: 1px solid var(--border);
}
.feature-chip.active { background: #e8f0f8; color: var(--qblue); border-color: var(--qblue); }

/* ── AGENZIA DASHBOARD DARK ACCENTS ── */
.page-dashboard-agenzia .dashboard-wrapper { background: #e8edf2; }
.agency-stat-card {
  background: var(--qnavy); color: #fff;
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
}
.agency-stat-card .kpi-value { color: var(--qorange); }

/* ── SLIDER RANGE ── */
input[type="range"] { accent-color: var(--qblue); }

/* ── RESPONSIVE ── */
@media (max-width:991px) {
  .qpido-hero h1 { font-size:2rem; }
  .kpi-value { font-size:1.8rem; }
}
@media (max-width:767px) {
  .qpido-hero { padding:3rem 0 4rem; }
  .plan-card { margin-bottom:1rem; }
  .auth-card { padding:1.75rem; }
  .dashboard-wrapper { padding-bottom:5rem; }
}
/* Padding bottom per bottom nav su tutte le pagine app (mobile) */
@media (max-width:991px) {
  body.page-dashboard, body.page-dashboard-acquirente, body.page-dashboard-venditore,
  body.page-dashboard-agenzia, body.page-lista-richieste, body.page-dettaglio-richiesta,
  body.page-nuova-richiesta, body.page-profilo, body.page-assistente,
  body.page-crediti, body.page-abbonamento, body.page-fatture {
    padding-bottom: 72px;
  }
}
