/* ============================================================
   REFERRAL PLATFORM Â· CSS Style Sheet
   Premium Glassmorphism & Modern Dashboard Theme
   V2 Â· Visual Overhaul: Holographic, Aurora, Cascade
   p79-referral-engine/2.4.0 Â· palota79 Â· IT04856750403
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800;900&display=swap');

:root {
  /* HSL Colors */
  --primary-h: 358;
  --primary-s: 80%;
  --primary-l: 47%;
  --primary-rgb: 214, 25, 32;
  
  --accent-h: 0;
  --accent-s: 0%;
  --accent-l: 7%;

  /* Generated color shades */
  --primary-deep: HSL(var(--primary-h), var(--primary-s), calc(var(--primary-l) - 5%));
  --primary: HSL(var(--primary-h), var(--primary-s), var(--primary-l));
  --primary-light: HSL(var(--primary-h), var(--primary-s), calc(var(--primary-l) + 15%));
  
  --accent: HSL(var(--accent-h), var(--accent-s), var(--accent-l));
  --accent-hover: HSL(var(--accent-h), var(--accent-s), calc(var(--accent-l) - 5%));
  
  /* Premium Dark Theme Palette (Default: Midnight Navy) */
  --bg-gradient: radial-gradient(ellipse 85% 460px at 16% 0%, #1b3b7a 0%, #0c1a38 34%, #050914 72%, #03060d 100%);
  --bg-dark: #03060d;
  --app-canvas-bg: radial-gradient(ellipse 85% 460px at 16% 0%, #1b3b7a 0%, #0c1a38 34%, #050914 72%, #03060d 100%);
  --header-bg: rgba(8, 20, 43, 0.96);
  --header-border: rgba(96, 165, 250, 0.16);
  --nav-bg: rgba(6, 14, 32, 0.97);
  --nav-border: rgba(96, 165, 250, 0.14);
  --modal-bg: #0b162e;
  --gold-accent-text: #facc15;
  --text: #ffffff;
  --text-light: #b0bec5;
  --text-inverse: #ffffff;
  
  /* Alerts */
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.1);
  
  /* Glassmorphism card values (tuned per theme preset) */
  --card-bg: rgba(11, 22, 46, 0.72);
  --card-border: rgba(96, 165, 250, 0.16);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
  
  /* Sizes & Easings */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 30px;
  --radius-full: 9999px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur: 0.15s;
}

/* ============================================================
   RESET & FOUNDATIONS
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

html {
  font-size: 18px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-overflow-scrolling: touch;
  /* Mai una parola sola nell'ultima riga di un testo che va a capo (ereditato da tutti i testi) */
  text-wrap: pretty;
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: color var(--dur) var(--ease);
}
a:hover {
  color: var(--primary-light, #ff5252);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  outline: none;
}

/* ============================================================
   APP CONTAINER & 6 THEME PRESETS (4 DARK NETTI · 2 LIGHT NITIDI)
   ============================================================ */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 600px;
  margin: 0 auto;
  background-color: var(--bg-dark);
  background-image: var(--app-canvas-bg);
  background-repeat: no-repeat;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.8);
  border-left: 1px solid var(--card-border);
  border-right: 1px solid var(--card-border);
  position: relative;
}

/* 1. Midnight Navy (Bagliore Blu Zaffiro → Nero Notte Profondo) */
[data-theme-preset="midnight"] {
  --bg-dark: #03060d;
  --app-canvas-bg: radial-gradient(ellipse 85% 460px at 16% 0%, #1b3b7a 0%, #0c1a38 34%, #050914 72%, #03060d 100%);
  --header-bg: rgba(8, 20, 43, 0.96);
  --header-border: rgba(96, 165, 250, 0.16);
  --nav-bg: rgba(6, 14, 32, 0.97);
  --nav-border: rgba(96, 165, 250, 0.14);
  --modal-bg: #0b162e;
  --card-bg: rgba(11, 22, 46, 0.72);
  --card-border: rgba(96, 165, 250, 0.16);
}

/* 2. Forest Emerald (Bagliore Verde Bosco → Nero Smeraldo Profondo) */
[data-theme-preset="emerald"] {
  --bg-dark: #020806;
  --app-canvas-bg: radial-gradient(ellipse 85% 460px at 16% 0%, #114b36 0%, #08241a 34%, #040f0b 72%, #020806 100%);
  --header-bg: rgba(6, 32, 23, 0.96);
  --header-border: rgba(52, 211, 153, 0.17);
  --nav-bg: rgba(4, 21, 15, 0.97);
  --nav-border: rgba(52, 211, 153, 0.15);
  --modal-bg: #071e16;
  --card-bg: rgba(8, 28, 21, 0.72);
  --card-border: rgba(52, 211, 153, 0.16);
  --text-light: #a7c9bc;
}

/* 3. Pure Obsidian (Bagliore Grafite Freddo → Nero OLED Assoluto) */
[data-theme-preset="obsidian"] {
  --bg-dark: #000000;
  --app-canvas-bg: radial-gradient(ellipse 85% 440px at 50% 0%, #20232b 0%, #0e0f14 30%, #040406 66%, #000000 100%);
  --header-bg: rgba(8, 9, 12, 0.97);
  --header-border: rgba(255, 255, 255, 0.12);
  --nav-bg: rgba(3, 3, 5, 0.98);
  --nav-border: rgba(255, 255, 255, 0.10);
  --modal-bg: #0c0d10;
  --card-bg: rgba(17, 18, 22, 0.80);
  --card-border: rgba(255, 255, 255, 0.12);
  --text-light: #a1a1aa;
}

/* 4. Warm Charcoal (Bagliore Espresso Bronzo → Nero Carbone Caldo) */
[data-theme-preset="charcoal"] {
  --bg-dark: #070403;
  --app-canvas-bg: radial-gradient(ellipse 85% 460px at 16% 0%, #4a2818 0%, #22120b 34%, #0d0705 72%, #070403 100%);
  --header-bg: rgba(29, 16, 10, 0.96);
  --header-border: rgba(251, 146, 60, 0.17);
  --nav-bg: rgba(18, 10, 6, 0.97);
  --nav-border: rgba(251, 146, 60, 0.15);
  --modal-bg: #1c100b;
  --card-bg: rgba(28, 16, 11, 0.74);
  --card-border: rgba(251, 146, 60, 0.16);
  --text-light: #d6c3b6;
}

/* Rendi davvero visibile la tinta del preset scuro sulle card principali */
[data-theme="dark"] .content-card,
[data-theme="dark"] .menu-card,
[data-theme="dark"] .referral-card,
[data-theme="dark"] .prize-card,
[data-theme="dark"] .accordion-item,
[data-theme="dark"] .gamif-accordion-item,
[data-theme="dark"] .ct-acc-item,
[data-theme="dark"] .points-summary-card {
  background: var(--card-bg);
  border-color: var(--card-border);
}

/* ============================================================
   LIGHT THEME SUPPORT ([data-theme="light"] · Pure Pearl e Slate Minimal)
   ============================================================ */
[data-theme="light"] {
  --bg-gradient: radial-gradient(ellipse 95% 65% at 15% 0%, #ffffff 0%, #f8fafc 55%, #f1f5f9 100%);
  --bg-dark: #f8fafc;
  --app-canvas-bg: radial-gradient(ellipse 95% 65% at 15% 0%, #ffffff 0%, #f8fafc 55%, #f1f5f9 100%);
  --header-bg: #ffffff;
  --header-border: rgba(15, 23, 42, 0.10);
  --nav-bg: #ffffff;
  --nav-border: rgba(15, 23, 42, 0.10);
  --modal-bg: #ffffff;
  --gold-accent-text: #b45309;
  --text: #0f172a;
  --text-light: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --card-bg: #ffffff;
  --card-border: rgba(15, 23, 42, 0.11);
  --shadow-sm: 0 3px 10px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 44px rgba(15, 23, 42, 0.14);
}

/* 5. Pure Pearl (Bianco Perla Candido) */
[data-theme-preset="pearl"] {
  --bg-dark: #f8fafc;
  --app-canvas-bg: radial-gradient(ellipse 95% 65% at 15% 0%, #ffffff 0%, #f8fafc 55%, #f1f5f9 100%);
  --header-bg: #ffffff;
  --nav-bg: #ffffff;
}

/* 6. Slate Minimal (Grigio Ardesia Architettonico · Netto stacco dalle card bianche) */
[data-theme-preset="slate-light"] {
  --bg-dark: #dce3ec;
  --app-canvas-bg: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
  --header-bg: #f1f5f9;
  --header-border: rgba(15, 23, 42, 0.14);
  --nav-bg: #f1f5f9;
  --nav-border: rgba(15, 23, 42, 0.14);
  --card-border: rgba(15, 23, 42, 0.14);
}

[data-theme="light"] body {
  color: #0f172a;
}

[data-theme="light"] .app-container {
  background: var(--app-canvas-bg);
  box-shadow: 0 0 50px rgba(15, 23, 42, 0.08);
  border-left: 1px solid var(--card-border);
  border-right: 1px solid var(--card-border);
}

[data-theme="light"] .app-header {
  background: var(--header-bg) !important;
  border-bottom: 1px solid var(--header-border) !important;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

[data-theme="light"] .bottom-nav {
  background: var(--nav-bg) !important;
  border-top: 1px solid var(--nav-border) !important;
  border-right-color: var(--nav-border) !important;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .bottom-nav .nav-item {
  color: #475569 !important;
}

[data-theme="light"] .bottom-nav .nav-item .nav-icon svg {
  color: #64748b;
}

[data-theme="light"] .bottom-nav .nav-item.active,
[data-theme="light"] .bottom-nav .nav-item:hover {
  color: var(--primary) !important;
  background: rgba(var(--primary-rgb, 214, 25, 32), 0.09) !important;
}

[data-theme="light"] .bottom-nav .nav-item.active .nav-icon svg,
[data-theme="light"] .bottom-nav .nav-item:hover .nav-icon svg {
  color: var(--primary) !important;
}

[data-theme="light"] .brand-light,
[data-theme="light"] .app-header .brand-light {
  color: #0f172a !important;
}

[data-theme="light"] .brand-slogan,
[data-theme="light"] #brand-slogan,
[data-theme="light"] #auth-brand-slogan {
  color: #475569 !important;
}

[data-theme="light"] .section-title,
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4 {
  color: #0f172a;
}

[data-theme="light"] .card,
[data-theme="light"] .content-card,
[data-theme="light"] .profile-card,
[data-theme="light"] .stats-card,
[data-theme="light"] .stat-card,
[data-theme="light"] .stat-box,
[data-theme="light"] .referral-card,
[data-theme="light"] .menu-card,
[data-theme="light"] .points-summary-card,
[data-theme="light"] .prize-card,
[data-theme="light"] .partner-prize-card,
[data-theme="light"] .adm-prize-card,
[data-theme="light"] .accordion-item,
[data-theme="light"] .gamif-accordion-item,
[data-theme="light"] .ct-acc-item,
[data-theme="light"] .ct-plan-card,
[data-theme="light"] .ct-territory-card,
[data-theme="light"] .agent-card {
  background: #ffffff !important;
  border-color: var(--card-border) !important;
  color: #0f172a !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06) !important;
}

/* Titoli card Home Partner, Accesso Rapido Admin, Segnalazioni, Accordion */
[data-theme="light"] .menu-card-title,
[data-theme="light"] .menu-card .menu-title,
[data-theme="light"] .referral-card h4,
[data-theme="light"] .ref-card-header h4,
[data-theme="light"] .accordion-header,
[data-theme="light"] .gamif-accordion-header,
[data-theme="light"] .gamif-acc-title,
[data-theme="light"] .agent-card-name,
[data-theme="light"] .contact-pref-label,
[data-theme="light"] .partner-prize-title,
[data-theme="light"] .partner-prize-cost-num,
[data-theme="light"] .prize-title,
[data-theme="light"] .detail-val,
[data-theme="light"] .timeline-body,
[data-theme="light"] .mgmt-agent-name,
[data-theme="light"] .story-step.done .story-title {
  color: #0f172a !important;
}

[data-theme="light"] .menu-card .menu-sub,
[data-theme="light"] .referral-card p,
[data-theme="light"] .ref-referrer,
[data-theme="light"] .ref-meta-row,
[data-theme="light"] .ref-date,
[data-theme="light"] .stat-label,
[data-theme="light"] .stat-lbl,
[data-theme="light"] .partner-prize-desc,
[data-theme="light"] .partner-prize-cost-unit,
[data-theme="light"] .partner-prize-prog-num,
[data-theme="light"] .gamif-acc-subtitle,
[data-theme="light"] .story-title {
  color: #475569 !important;
}

[data-theme="light"] .ref-inner-badge,
[data-theme="light"] .partner-prize-vat-tag {
  background: #f1f5f9 !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  color: #334155 !important;
}

[data-theme="light"] .partner-prize-valore-tag {
  background: rgba(14, 165, 233, 0.1) !important;
  border-color: rgba(14, 165, 233, 0.25) !important;
  color: #334155 !important;
}
[data-theme="light"] .partner-prize-valore-tag strong {
  color: #0369a1 !important;
}

[data-theme="light"] .partner-prize-progress-track,
[data-theme="light"] .level-progress-track {
  background: rgba(15, 23, 42, 0.10) !important;
}

[data-theme="light"] .partner-prize-btn.btn-inactive,
[data-theme="light"] .adm-prize-card .adm-prize-btn-edit,
[data-theme="light"] .mgmt-agent-change-btn {
  background: #f1f5f9 !important;
  border: 1px solid rgba(15, 23, 42, 0.16) !important;
  color: #334155 !important;
}

[data-theme="light"] .adm-prize-card .adm-prize-btn-duplicate {
  background: rgba(79, 70, 229, 0.10) !important;
  border-color: rgba(79, 70, 229, 0.28) !important;
  color: #4338ca !important;
}

[data-theme="light"] .partner-prize-locked-overlay {
  background: rgba(248, 250, 252, 0.90) !important;
  color: #0f172a !important;
}

/* Saldo punti Partner e Badge Livello in Light Mode */
[data-theme="light"] .points-value {
  background: linear-gradient(135deg, #0f172a 20%, #334155 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  filter: none !important;
}

[data-theme="light"] .user-badge-name {
  background: #f1f5f9 !important;
  border-color: rgba(15, 23, 42, 0.14) !important;
  color: #0f172a !important;
  box-shadow: none !important;
}

[data-theme="light"] .level-silver {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
  color: #334155 !important;
}

[data-theme="light"] .level-gold {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: rgba(217, 119, 6, 0.45) !important;
  color: #b45309 !important;
}

[data-theme="light"] .level-bronze {
  background: rgba(180, 83, 9, 0.12) !important;
  border-color: rgba(180, 83, 9, 0.35) !important;
  color: #9a3412 !important;
}

[data-theme="light"] .level-platinum {
  background: rgba(124, 58, 237, 0.12) !important;
  border-color: rgba(124, 58, 237, 0.35) !important;
  color: #6d28d9 !important;
}

[data-theme="light"] .level-diamond {
  background: rgba(2, 132, 199, 0.12) !important;
  border-color: rgba(2, 132, 199, 0.38) !important;
  color: #0369a1 !important;
}

/* Bottoni Gestione · Indietro · Controlli Form */
[data-theme="light"] .btn-gestione {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  color: #0f172a !important;
}

[data-theme="light"] .btn-gestione:hover {
  background: #f1f5f9 !important;
}

[data-theme="light"] .btn-gestione--gold {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(254, 243, 199, 0.65)) !important;
  border-color: rgba(217, 119, 6, 0.42) !important;
  color: #0f172a !important;
}
[data-theme="light"] .btn-gestione--gold .btn-gestione-gold-title {
  color: #92400e !important;
}
[data-theme="light"] .btn-gestione--gold .btn-gestione-gold-sub {
  color: #475569 !important;
}
[data-theme="light"] .btn-gestione--gold .btn-gestione-gold-chevron svg {
  stroke: #b45309 !important;
}

[data-theme="light"] .btn-back {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.16) !important;
  color: #0f172a !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .btn-secondary {
  background: #f1f5f9 !important;
  border: 1px solid rgba(15, 23, 42, 0.16) !important;
  color: #0f172a !important;
}

[data-theme="light"] .form-control,
[data-theme="light"] .ct-input,
[data-theme="light"] select.ct-input,
[data-theme="light"] .gamif-ms-select,
[data-theme="light"] .gamif-ms-input,
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="tel"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="date"],
[data-theme="light"] select,
[data-theme="light"] textarea {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
  color: #0f172a !important;
}

[data-theme="light"] select option,
[data-theme="light"] select.ct-input option,
[data-theme="light"] .gamif-ms-select option {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder,
[data-theme="light"] .ct-input::placeholder {
  color: #94a3b8 !important;
}

[data-theme="light"] label,
[data-theme="light"] .form-group label,
[data-theme="light"] .ct-label {
  color: #334155 !important;
}

[data-theme="light"] .modal-content,
[data-theme="light"] .ct-otp-modal {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  color: #0f172a !important;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18) !important;
}

[data-theme="light"] .modal-content h3,
[data-theme="light"] .modal-content h2,
[data-theme="light"] .ct-otp-title,
[data-theme="light"] .ct-otp-riepilogo-row strong,
[data-theme="light"] .agent-modal-name,
[data-theme="light"] .agent-modal-info-value {
  color: #0f172a !important;
}

[data-theme="light"] .ct-otp-riepilogo,
[data-theme="light"] .ct-otp-digit,
[data-theme="light"] .ct-otp-timer {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.16) !important;
  color: #0f172a !important;
}

[data-theme="light"] .filter-btn,
[data-theme="light"] .shop-filter-btn,
[data-theme="light"] .tab-btn,
[data-theme="light"] .notif-btn,
[data-theme="light"] .ref-type-pill,
[data-theme="light"] .gamif-type-pill,
[data-theme="light"] .gamif-month-pill,
[data-theme="light"] .gamif-preset-btn,
[data-theme="light"] .gamif-ms-mode-btn,
[data-theme="light"] .mgmt-status-btn,
[data-theme="light"] .snc-toggle-btn,
[data-theme="light"] .contact-pref-toggle,
[data-theme="light"] .temp-btn {
  background: #f1f5f9 !important;
  border-color: rgba(15, 23, 42, 0.15) !important;
  color: #334155 !important;
}

[data-theme="light"] .filter-btn.active,
[data-theme="light"] .shop-filter-btn.active,
[data-theme="light"] .tab-btn.active,
[data-theme="light"] .ref-type-pill.active,
[data-theme="light"] .gamif-type-pill.active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #ffffff !important;
}

[data-theme="light"] .temp-btn[data-val="1"].active {
  background: rgba(14, 165, 233, 0.14) !important;
  border-color: #0284c7 !important;
}
[data-theme="light"] .temp-btn[data-val="1"].active .temp-btn-title { color: #0369a1 !important; }
[data-theme="light"] .temp-btn[data-val="1"].active .temp-btn-sub { color: #0284c7 !important; }

[data-theme="light"] .temp-btn[data-val="3"].active {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: #d97706 !important;
}
[data-theme="light"] .temp-btn[data-val="3"].active .temp-btn-title { color: #92400e !important; }
[data-theme="light"] .temp-btn[data-val="3"].active .temp-btn-sub { color: #b45309 !important; }

[data-theme="light"] .temp-btn[data-val="5"].active {
  background: rgba(239, 68, 68, 0.14) !important;
  border-color: #dc2626 !important;
}
[data-theme="light"] .temp-btn[data-val="5"].active .temp-btn-title { color: #991b1b !important; }
[data-theme="light"] .temp-btn[data-val="5"].active .temp-btn-sub { color: #b91c1c !important; }

/* Gamification e Punti/Livelli in Light Mode */
[data-theme="light"] .gamif-status-bar,
[data-theme="light"] .gamif-action-check-item,
[data-theme="light"] .gamif-ms-card,
[data-theme="light"] .gamif-ms-box,
[data-theme="light"] .timeline-content,
[data-theme="light"] .mgmt-agent-card {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  color: #0f172a !important;
}
[data-theme="light"] .gamif-toggle-btn {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
  color: #0f172a !important;
}
[data-theme="light"] .gamif-toggle-btn-label,
[data-theme="light"] .gamif-toggle-btn.active .gamif-toggle-btn-label {
  color: #0f172a !important;
}
[data-theme="light"] .gamif-tier-track-wrap {
  background: var(--header-bg) !important;
  border-bottom-color: rgba(15, 23, 42, 0.12) !important;
}
[data-theme="light"] .gamif-field,
[data-theme="light"] input.gamif-pts-input[type="number"] {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.20) !important;
  color: #0f172a !important;
}
[data-theme="light"] .gamif-field > input[type="number"],
[data-theme="light"] .gamif-field-static {
  color: #0f172a !important;
}
[data-theme="light"] .gamif-field-unit {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-left-color: rgba(15, 23, 42, 0.12) !important;
}
[data-theme="light"] .gamif-ms-legal-note,
[data-theme="light"] .gamif-ms-badge-resp {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(217, 119, 6, 0.35) !important;
  color: #92400e !important;
}
[data-theme="light"] .gamif-ms-box-label {
  color: #b45309 !important;
}
[data-theme="light"] .gamif-ms-preview,
[data-theme="light"] .gamif-ms-preview strong {
  color: #334155 !important;
}
[data-theme="light"] .gamif-ms-mode-btn.active {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: #d97706 !important;
  color: #92400e !important;
}
[data-theme="light"] .gamif-status-indicator.active .gamif-status-text,
[data-theme="light"] .gamif-status-pill.pill-active {
  color: #047857 !important;
}

/* Contratti e Licenza d'Uso in Light Mode */
[data-theme="light"] .ct-page-header-bar {
  background: rgba(245, 158, 11, 0.08) !important;
  border-left-color: #d97706 !important;
}
[data-theme="light"] .ct-acc-title,
[data-theme="light"] .ct-step-title,
[data-theme="light"] .ct-section-subtitle,
[data-theme="light"] .ct-plan-name,
[data-theme="light"] .ct-plan-amount,
[data-theme="light"] .ct-territory-name,
[data-theme="light"] .ct-cert-val,
[data-theme="light"] .ct-download-title,
[data-theme="light"] .ct-founder-sum-item strong,
[data-theme="light"] .ct-founder-tile-name {
  color: #0f172a !important;
}
[data-theme="light"] .ct-acc-chevron,
[data-theme="light"] .ct-locked-desc,
[data-theme="light"] .ct-plan-renewal .ct-plan-amount {
  color: #475569 !important;
}
[data-theme="light"] .ct-plan-price-block.ct-plan-renewal,
[data-theme="light"] .ct-acc-body,
[data-theme="light"] .ct-divider {
  border-color: rgba(15, 23, 42, 0.10) !important;
}
[data-theme="light"] .ct-plan-card.selected {
  border-color: #d97706 !important;
  background: linear-gradient(180deg, rgba(254, 243, 199, 0.55) 0%, #ffffff 100%) !important;
}
[data-theme="light"] .ct-plan-card.selected .ct-plan-select-indicator,
[data-theme="light"] .ct-plan-badge,
[data-theme="light"] .ct-features-title,
[data-theme="light"] .ct-btn-change-request,
[data-theme="light"] .ct-btn-legal-print,
[data-theme="light"] .ct-territory-type.gold {
  color: #92400e !important;
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: rgba(217, 119, 6, 0.40) !important;
}
[data-theme="light"] .ct-plan-select-indicator {
  background: #f1f5f9 !important;
  color: #334155 !important;
}
[data-theme="light"] .ct-billing-sticky-bar {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(248, 250, 252, 0.90) 80%, rgba(248, 250, 252, 0) 100%) !important;
}
[data-theme="light"] .ct-billing-toggle {
  background: #e2e8f0 !important;
  border-color: rgba(15, 23, 42, 0.14) !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.10) !important;
}
[data-theme="light"] .ct-toggle-btn {
  color: #475569 !important;
}
[data-theme="light"] .ct-toggle-btn:hover:not(.active):not(:disabled) {
  color: #0f172a !important;
  background: rgba(15, 23, 42, 0.06) !important;
}
[data-theme="light"] .ct-toggle-btn.active {
  color: #0f172a !important;
}
[data-theme="light"] .ct-legal-viewer {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.14) !important;
}
[data-theme="light"] .ct-legal-article {
  border-bottom-color: rgba(15, 23, 42, 0.08) !important;
}
[data-theme="light"] .ct-legal-article-title,
[data-theme="light"] .ct-legal-body th,
[data-theme="light"] .ct-legal-body .founder-box .founder-title {
  color: #92400e !important;
}
[data-theme="light"] .ct-legal-body,
[data-theme="light"] .ct-legal-body ul li {
  color: #1e293b !important;
}
[data-theme="light"] .ct-legal-body th,
[data-theme="light"] .ct-legal-body td {
  border-color: rgba(15, 23, 42, 0.14) !important;
}
[data-theme="light"] .ct-legal-body th {
  background: #f1f5f9 !important;
}
[data-theme="light"] .ct-sign-checklist,
[data-theme="light"] .ct-territory-pill,
[data-theme="light"] .ct-founder-summary {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  color: #334155 !important;
}
[data-theme="light"] .ct-founder-title,
[data-theme="light"] .ct-primary-wide .ct-territory-name {
  background: none !important;
  -webkit-text-fill-color: #0f172a !important;
  color: #0f172a !important;
}
[data-theme="light"] .ct-founder-tile {
  background: linear-gradient(#ffffff, #f8fafc) padding-box, linear-gradient(135deg, #10b981, #d97706, #10b981) border-box !important;
}
[data-theme="light"] .ct-founder-sum-item.total,
[data-theme="light"] .ct-founder-sum-item.total strong {
  color: #92400e !important;
}
[data-theme="light"] .ct-btn-print-action,
[data-theme="light"] .ct-btn-draft {
  background: #f1f5f9 !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
  color: #0f172a !important;
}
[data-theme="light"] .ct-autocomplete-items,
[data-theme="light"] .autocomplete-items {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.16) !important;
}
[data-theme="light"] .ct-autocomplete-item,
[data-theme="light"] .ct-autocomplete-main,
[data-theme="light"] .autocomplete-items div {
  color: #0f172a !important;
  border-bottom-color: rgba(15, 23, 42, 0.08) !important;
}
[data-theme="light"] .ct-status-badge-header.draft,
[data-theme="light"] .ct-acc-badge.warn {
  color: #92400e !important;
  background: rgba(245, 158, 11, 0.16) !important;
}
[data-theme="light"] .ct-status-badge-header.signed,
[data-theme="light"] .ct-acc-badge.ok,
[data-theme="light"] .ct-cert-title {
  color: #047857 !important;
}

/* Territori e Carrello ZonaBlindata in Light Mode */
[data-theme="light"] .zb-expansion-toolbar {
  background: var(--header-bg) !important;
  border-bottom-color: rgba(15, 23, 42, 0.12) !important;
}
[data-theme="light"] .zb-toolbar-title {
  color: #0f172a !important;
}
[data-theme="light"] .zb-toolbar-count,
[data-theme="light"] .zb-toolbar-sub {
  color: #b45309 !important;
}
[data-theme="light"] .zb-billing-switch {
  background: #e2e8f0 !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}
[data-theme="light"] .zb-sort-select {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
}
[data-theme="light"] .zb-sort-select option {
  background: #ffffff !important;
  color: #0f172a !important;
}
[data-theme="light"] .zb-cart-bar {
  background: #ffffff !important;
  border-color: rgba(217, 119, 6, 0.45) !important;
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.14) !important;
}
[data-theme="light"] .zb-cart-count {
  color: #334155 !important;
}
[data-theme="light"] .zb-cart-price {
  color: #b45309 !important;
}

/* Rete di sicurezza Light Mode per testi inline bianchi o giallo-chiaro generati da HTML/JS */
[data-theme="light"] .app-container [style*="color: #fff"]:not(.btn-primary):not(.btn-primary *):not(.whatsapp-btn):not(.call-btn):not(.notif-badge):not(#mdl-ref-avatar):not(#prof-pic-initials):not(.agent-initials):not(.adm-brand-browser-tab):not(.adm-brand-prev-box--dark *),
[data-theme="light"] .app-container [style*="color:#fff"]:not(.btn-primary):not(.btn-primary *):not(.whatsapp-btn):not(.call-btn):not(.notif-badge):not(#mdl-ref-avatar):not(#prof-pic-initials):not(.agent-initials),
[data-theme="light"] .app-container [style*="color: #ffffff"]:not(.btn-primary):not(.btn-primary *):not(.whatsapp-btn):not(.call-btn):not(.notif-badge):not(#mdl-ref-avatar):not(#prof-pic-initials),
[data-theme="light"] .app-container [style*="color: #e2e8f0"]:not(.btn-primary *),
[data-theme="light"] .app-container [style*="color: #cbd5e1"]:not(.btn-primary *),
[data-theme="light"] .app-container [style*="color: #f1f5f9"]:not(.btn-primary *),
[data-theme="light"] .app-container [style*="color: rgba(255,255,255"]:not(.btn-primary):not(.btn-primary *),
[data-theme="light"] .app-container [style*="color: rgba(255, 255, 255"]:not(.btn-primary):not(.btn-primary *),
[data-theme="light"] .modal-content [style*="color: #fff"]:not(.btn-primary):not(.btn-primary *):not(.whatsapp-btn):not(.call-btn):not(#mdl-ref-avatar):not(.adm-brand-browser-tab):not(.adm-brand-prev-box--dark *),
[data-theme="light"] .modal-content [style*="color: #e2e8f0"]:not(.btn-primary *),
[data-theme="light"] .modal-content [style*="color: #cbd5e1"]:not(.btn-primary *) {
  color: #0f172a !important;
}

/* Ambra brunito ad alto contrasto al posto del giallo neon #facc15 sui fondi chiari */
[data-theme="light"] .app-container [style*="color: #facc15"],
[data-theme="light"] .app-container [style*="color:#facc15"],
[data-theme="light"] .app-container [style*="color: #fbbf24"],
[data-theme="light"] .app-container [style*="color: #fde68a"],
[data-theme="light"] .app-container [style*="color: rgba(255,210,100"],
[data-theme="light"] .modal-content [style*="color: #facc15"] {
  color: #92400e !important;
}

[data-theme="light"] .app-container [style*="color: #bae6fd"],
[data-theme="light"] .app-container [style*="color: #93c5fd"] {
  color: #0369a1 !important;
}

[data-theme="light"] .auth-card {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  color: #0f172a !important;
}

[data-theme="light"] .onboarding-step {
  color: #64748b !important;
}
[data-theme="light"] .onboarding-step.active {
  color: #0f172a !important;
}

/* Footer: pillola scura elegante dietro il logotipo ZonaBlindata bianco+oro */
[data-theme="light"] .app-footer-brand {
  border-top-color: rgba(15, 23, 42, 0.12) !important;
  color: #475569 !important;
}
[data-theme="light"] .app-footer-logo-link {
  background: #0f172a;
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.16);
}
[data-theme="light"] .app-footer-logo {
  margin-right: 0;
  height: 22px;
}
[data-theme="light"] .app-footer-brand strong {
  color: #0f172a !important;
}
[data-theme="light"] .app-footer-info,
[data-theme="light"] .app-footer-tagline {
  color: #64748b !important;
}

[data-theme="light"] .app-footer-tagline span,
[data-theme="light"] .app-footer-tagline a {
  color: #475569 !important;
}

[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-primary span,
[data-theme="light"] .whatsapp-btn,
[data-theme="light"] .call-btn {
  color: #ffffff !important;
}


