/* ============================================================
   HEADER & TOP NAVIGATION
   ============================================================ */
.app-header {
  background: #0d1426;
  color: var(--text);
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 600px;
  height: 70px;
  box-sizing: border-box;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transform: translateZ(0);
  backface-visibility: hidden;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.header-logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.header-logo-img {
  height: 42px;
  width: 42px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 15px rgba(214, 25, 32, 0.25);
  object-fit: cover;
  flex-shrink: 0;
  transition: transform var(--dur) var(--ease);
}
.header-logo-img:hover {
  transform: scale(1.05);
}

.header-title {
  min-width: 0;
  flex: 1;
}

.header-title h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-title > span {
  font-size: 0.82rem;
  color: var(--text-light);
  display: block;
  line-height: 1.25;
  margin-top: 2px;
}

.btn-logout {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--dur) var(--ease);
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-logout:hover {
  background: rgba(214, 25, 32, 0.15);
  border-color: rgba(214, 25, 32, 0.35);
  color: #ff5e62;
}

/* Brand Typography */
.brand-light {
  font-weight: 500;
  color: var(--text);
}
.brand-bold {
  font-weight: 800;
  color: var(--primary);
}
.app-header .brand-light {
  color: #ffffff;
  font-weight: 400;
  display: inline;
}
.app-header .brand-bold {
  font-weight: 800;
  color: #ff333d;
  display: inline;
}

/* ============================================================
   MAIN PANELS & VIEWS
   ============================================================ */
.app-view {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 88px 20px 120px; /* Space for fixed header and bottom nav */
  position: relative;
  z-index: 1;
}

.view-section {
  display: none;
}
.view-section.active {
  display: block;
}

/* ============================================================
   REFERRER DASHBOARD — POINTS CARD
   ============================================================ */
.points-summary-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.points-header {
  font-size: 0.92rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  display: block;
  text-align: center;
  position: relative;
  z-index: 2;
}

.points-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin: 10px 0;
  position: relative;
  z-index: 2;
}

.points-value {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, #ffffff 30%, rgba(255, 255, 255, 0.6) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 15px rgba(255, 255, 255, 0.2));
}

.points-currency {
  font-size: 1.5rem;
  font-weight: 900;
  color: #ff5e62;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: 0 0 20px rgba(255, 94, 98, 0.4);
}

.badge-status-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

.user-badge-name {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.user-badge-level {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: 0.03em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: all var(--dur) var(--ease);
}

.level-base {
  background: rgba(214, 25, 32, 0.12) !important;
  border: 1px solid rgba(214, 25, 32, 0.35) !important;
  color: #ff5c62 !important;
  box-shadow: 0 0 12px rgba(214, 25, 32, 0.2) !important;
}

.level-silver {
  background: rgba(148, 163, 184, 0.12) !important;
  border: 1px solid rgba(148, 163, 184, 0.35) !important;
  color: #e2e8f0 !important;
  box-shadow: 0 0 12px rgba(148, 163, 184, 0.2) !important;
}

.level-gold {
  background: rgba(234, 179, 8, 0.12) !important;
  border: 1px solid rgba(234, 179, 8, 0.35) !important;
  color: #facc15 !important;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.2) !important;
}

.level-bronze {
  background: rgba(205, 127, 50, 0.12) !important;
  border: 1px solid rgba(205, 127, 50, 0.35) !important;
  color: #e8a850 !important;
  box-shadow: 0 0 12px rgba(205, 127, 50, 0.2) !important;
}

.level-diamond {
  background: rgba(185, 242, 255, 0.1) !important;
  border: 1px solid rgba(185, 242, 255, 0.35) !important;
  color: #b9f2ff !important;
  box-shadow: 0 0 16px rgba(185, 242, 255, 0.25), 0 0 30px rgba(185, 242, 255, 0.08) !important;
}

/* ============================================================
   DASHBOARD MENU CARDS â€” GLOW + 3D TILT
   ============================================================ */
.dashboard-menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
  perspective: 800px;
}

.menu-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 24px 12px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}

/* Diagonal glass shine sweep */
.menu-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -80%;
  width: 40%;
  height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(25deg);
  pointer-events: none;
  animation: menuShine 7s infinite ease-in-out;
}

@keyframes menuShine {
  0% { left: -80%; }
  20% { left: 140%; }
  100% { left: 140%; }
}

#menu-card-add::after { animation-delay: 0s; animation-duration: 7s; }
#menu-card-list::after { animation-delay: 1.8s; animation-duration: 7.5s; }
#menu-card-shop::after { animation-delay: 3.5s; animation-duration: 8s; }
#menu-card-how::after { animation-delay: 5s; animation-duration: 8.5s; }
#menu-card-club::after { animation-delay: 6.5s; animation-duration: 9s; }

.menu-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.04);
}

#menu-card-add:hover {
  border-color: rgba(96, 165, 250, 0.5);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

#menu-card-list:hover {
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

#menu-card-shop:hover {
  border-color: rgba(244, 63, 94, 0.5);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

#menu-card-how:hover {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

#menu-card-club:hover {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

#menu-card-invite:hover {
  border-color: rgba(52, 211, 153, 0.5);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.menu-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  transition: transform var(--dur) var(--ease);
  position: relative;
}

#menu-card-add .menu-card-icon {
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.2);
}

#menu-card-list .menu-card-icon {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

#menu-card-shop .menu-card-icon {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
}

#menu-card-how .menu-card-icon {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

#menu-card-add:hover .menu-card-icon { background: rgba(96, 165, 250, 0.18); transform: scale(1.1); }
#menu-card-list:hover .menu-card-icon { background: rgba(251, 191, 36, 0.18); transform: scale(1.1); }
#menu-card-shop:hover .menu-card-icon { background: rgba(244, 63, 94, 0.18); transform: scale(1.1); }
#menu-card-how:hover .menu-card-icon { background: rgba(59, 130, 246, 0.18); transform: scale(1.1); }
#menu-card-invite:hover .menu-card-icon { background: rgba(52, 211, 153, 0.18); transform: scale(1.1); }

.menu-card-icon svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.menu-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.menu-card-desc {
  display: none;
}

/* ============================================================

/* ============================================================
   REFERRALS LIST & DETAIL â€” GRADIENT BORDER
   ============================================================ */
.referral-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.referral-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 20px;
  padding-left: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

/* Gradient left border */
.referral-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary) 0%, rgba(214, 25, 32, 0.2) 100%);
  border-radius: 4px 0 0 4px;
  z-index: 2;
}

/* Subtle shimmer on hover */
.referral-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0) 50%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 1;
}

.referral-card:hover::after {
  opacity: 1;
}

.referral-card:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), 0 0 15px rgba(214, 25, 32, 0.08);
}

.ref-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}
.ref-card-header h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

.ref-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.ref-referrer {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: -6px;
}

.ref-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.ref-inner-badge {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.ref-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

.ref-hotness {
  color: #ff9f43;
}
.ref-date {
  color: rgba(255, 255, 255, 0.4);
}

.ref-status-badge {
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
}

/* Status colors mapping */
.ref-status-badge.status-pending {
  border-color: #3b82f6;
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.15);
}
.ref-status-badge.status-review {
  border-color: #f59e0b;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
}
.ref-status-badge.status-contacted {
  border-color: #fbbf24;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.15);
}
.ref-status-badge.status-negotiation {
  border-color: #a855f7;
  color: #a855f7;
  background: rgba(168, 85, 247, 0.08);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.15);
}
.ref-status-badge.status-acquired {
  border-color: #10b981;
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.15);
}
.ref-status-badge.status-rejected {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.15);
}
.ref-status-badge.status-sold {
  border-color: #14b8a6;
  color: #14b8a6;
  background: rgba(20, 184, 166, 0.08);
  box-shadow: 0 0 8px rgba(20, 184, 166, 0.15);
}
.ref-status-badge.status-rented {
  border-color: #06b6d4;
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.08);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.15);
}
.ref-status-badge.status-orphan {
  border-color: #f59e0b;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
  animation: orphanPulse 2.5s ease-in-out infinite;
}
@keyframes orphanPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.15); }
  50% { box-shadow: 0 0 14px rgba(245, 158, 11, 0.35); }
}

/* Referral detail view elements */
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 0.95rem;
  color: var(--text-light);
}

.detail-val {
  font-size: 0.95rem;
  font-weight: 600;
  text-align: right;
}

.whatsapp-btn {
  background: #25d366;
  color: white;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  transition: all 0.25s ease;
}
.whatsapp-btn:hover {
  background: #1fb855;
  transform: translateY(-1px);
}

.call-btn {
  background: #3b82f6;
  color: white;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  transition: all 0.25s ease;
}
.call-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

/* Timeline Notes */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 7px;
  width: 2px;
  background: linear-gradient(180deg, var(--primary) 0%, rgba(255, 255, 255, 0.06) 100%);
}

.timeline-item {
  display: flex;
  gap: 16px;
  position: relative;
}

.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid #1a1f36;
  box-shadow: 0 0 8px rgba(214, 25, 32, 0.3);
  margin-top: 4px;
  z-index: 2;
}

.timeline-content {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 4px;
}

.timeline-body {
  font-size: 0.95rem;
}

/* ============================================================

/* ============================================================
   PRIZE SHOP
   ============================================================ */
.prizes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.prize-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  gap: 16px;
  align-items: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  position: relative;
  overflow: hidden;
}

/* Gradient left border */
.prize-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary) 0%, rgba(214, 25, 32, 0.2) 100%);
  border-radius: 4px 0 0 4px;
  z-index: 2;
}

/* Subtle shimmer on hover */
.prize-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0) 50%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 1;
}

.prize-card:hover::after {
  opacity: 1;
}

.prize-card:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), 0 0 15px rgba(214, 25, 32, 0.08);
}

.prize-image {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(214,25,32,0.15) 0%, rgba(255,100,100,0.08) 100%);
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.prize-details {
  flex: 1;
}

.prize-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.prize-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 2px;
}

.badge-vat-warn {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--warning);
  background: var(--warning-bg);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  margin: 4px 0;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-vat-ok {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--success);
  background: var(--success-bg);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  margin: 4px 0;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.prize-cost {
  font-size: 1rem;
  font-weight: 900;
  color: #ff5e62;
  margin-top: 4px;
  text-shadow: 0 0 10px rgba(255, 94, 98, 0.2);
}

.btn-redeem {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--text-inverse);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all var(--dur) var(--ease);
}
.btn-redeem:hover {
  background: var(--accent);
  transform: translateY(-1px);
}
.btn-redeem:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
  cursor: not-allowed;
}

/* ============================================================
   MODERN PARTNER PRIZE SHOP (Square/Vertical Rich Cards)
   ============================================================ */
#prizes-catalog-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
  align-items: stretch;
  margin-bottom: 24px;
}

.partner-prize-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.88) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 30px -6px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
}

.partner-prize-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 40px -8px rgba(0, 0, 0, 0.5);
}

.partner-prize-card.is-affordable {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 10px 30px -6px rgba(0, 0, 0, 0.35), 0 0 20px rgba(16, 185, 129, 0.08);
}

.partner-prize-card.is-affordable:hover {
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 18px 40px -8px rgba(0, 0, 0, 0.5), 0 0 28px rgba(16, 185, 129, 0.18);
}

.partner-prize-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 26px;
  margin-bottom: 12px;
}

.partner-prize-custom-badge {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.partner-prize-pill-ok {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 10px;
}

.partner-prize-pill-need {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.28);
  color: #a5b4fc;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 10px;
}

.partner-prize-icon-box {
  width: 88px;
  height: 88px;
  margin: 0 auto 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.14) 0%, rgba(99, 102, 241, 0.05) 70%, transparent 100%), rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.03);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.partner-prize-card:hover .partner-prize-icon-box {
  transform: scale(1.06);
}

.partner-prize-emoji {
  font-size: 2.8rem;
  line-height: 1;
  user-select: none;
}

.partner-prize-info {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  margin-bottom: 14px;
}

.partner-prize-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  margin-bottom: 6px;
  max-width: 100%;
  word-break: break-word;
}

.partner-prize-desc {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.45;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.partner-prize-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
  margin-top: auto;
}

.partner-prize-valore-tag {
  font-size: 0.74rem;
  color: #94a3b8;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 3px 9px;
  border-radius: 8px;
}

.partner-prize-valore-tag strong {
  color: #38bdf8;
  font-weight: 700;
}

.partner-prize-vat-tag {
  font-size: 0.72rem;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px 9px;
  border-radius: 8px;
}

.partner-prize-limit-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 8px;
}

.partner-prize-limit-pill.limit-urg {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.partner-prize-limit-pill.limit-stock {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.partner-prize-bottom {
  width: 100%;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.partner-prize-cost-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.partner-prize-cost-val {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.partner-prize-orig-price {
  font-size: 0.85rem;
  color: #64748b;
  text-decoration: line-through;
  margin-right: 4px;
  font-weight: 600;
}

.partner-prize-cost-num {
  font-size: 1.45rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
}

.partner-prize-card.is-affordable .partner-prize-cost-num {
  color: #34d399;
}

.partner-prize-cost-unit {
  font-size: 0.85rem;
  font-weight: 700;
  color: #94a3b8;
}

.partner-prize-prog-num {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
}

.partner-prize-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.partner-prize-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #38bdf8);
  border-radius: 10px;
  transition: width 0.4s ease;
}

.partner-prize-btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.partner-prize-btn.btn-active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.partner-prize-btn.btn-active:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
  filter: brightness(1.08);
}

.partner-prize-btn.btn-inactive {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: not-allowed;
}

.partner-prize-locked-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 20px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.partner-prize-locked-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.partner-prize-fomo-stamp {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  font-size: 1.6rem;
  font-weight: 900;
  color: #ef4444;
  border: 3px solid #ef4444;
  padding: 4px 14px;
  border-radius: 10px;
  z-index: 8;
  opacity: 0.92;
  pointer-events: none;
  letter-spacing: 1px;
}

/* ============================================================
   ADMIN PRIZE CARDS
   ============================================================ */
.adm-prize-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
}

.adm-prize-card .adm-prize-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.adm-prize-card .adm-prize-image {
  width: 52px;
  height: 52px;
  min-width: 52px;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  flex-shrink: 0;
  margin: 0;
}

.adm-prize-card .adm-prize-details {
  flex: 1;
  min-width: 0;
}

.adm-prize-card .adm-prize-header-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.adm-prize-card .adm-prize-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 104px;
  flex-shrink: 0;
}

.adm-prize-card .adm-prize-btn {
  font-size: 0.78rem;
  padding: 6px 10px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
}

.adm-prize-card .adm-prize-btn-edit {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
}
.adm-prize-card .adm-prize-btn-edit:hover {
  background: rgba(255, 255, 255, 0.14);
}

.adm-prize-card .adm-prize-btn-duplicate {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}
.adm-prize-card .adm-prize-btn-duplicate:hover {
  background: rgba(99, 102, 241, 0.28);
}

.adm-prize-card .adm-prize-btn-delete {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #ef4444;
}
.adm-prize-card .adm-prize-btn-delete:hover {
  background: rgba(239, 68, 68, 0.22);
}

/* ============================================================
   ADMIN / MANAGER DASHBOARD
   ============================================================ */
.stats-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.stat-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), transparent);
  opacity: 0.5;
}

.stat-box:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
}

.stat-val {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
}

.stat-lbl {
  font-size: 0.82rem;
  color: var(--text-light);
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ============================================================
   BOTTOM NAVIGATION BAR
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 600px;
  height: 68px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
  background: #080d19;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 999;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  transform: translateZ(0);
  backface-visibility: hidden;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #64748b;
  cursor: pointer;
  transition: color var(--dur) var(--ease);
  flex: 1;
  position: relative;
  padding: 8px 0;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur) var(--ease);
}
.nav-icon svg {
  color: #64748b;
  transition: color var(--dur) var(--ease);
}

.nav-item span:last-child {
  font-size: 0.78rem;
  font-weight: 600;
  transition: color var(--dur) var(--ease);
}

.nav-item.active {
  color: #ffffff;
}
.nav-item.active .nav-icon {
  transform: translateY(-2px);
}
.nav-item.active .nav-icon svg {
  color: var(--primary);
}

/* Static clean pill indicator */
.nav-item.active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20%;
  width: 60%;
  height: 3px;
  background: var(--primary);
  border-radius: 99px;
}

/* Active background pill behind icon */
.nav-item.active::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(214, 25, 32, 0.12);
  z-index: -1;
}

/* Back button â€” glassmorphic pill */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  margin-bottom: 16px;
  padding: 8px 18px 8px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s var(--ease);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.btn-back svg {
  transition: transform 0.3s var(--ease);
  opacity: 0.7;
}
.btn-back:hover {
  background: rgba(214, 25, 32, 0.1);
  border-color: rgba(214, 25, 32, 0.3);
  color: var(--primary-light);
  box-shadow: 0 4px 16px rgba(214, 25, 32, 0.15);
  transform: translateX(-3px);
}
.btn-back:hover svg {
  transform: translateX(-3px);
  opacity: 1;
}

/* ============================================================
   SHOP & ACTIVITY FILTER BAR

/* ============================================================
   LEVEL PROGRESS BAR
   ============================================================ */
.level-progress-container {
  margin-bottom: 20px;
  padding: 0 4px;
}

.level-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.level-current {
  color: #94a3b8;
}

.level-next {
  color: var(--text-light);
  font-weight: 500;
}

.level-progress-track {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-bottom: 10px;
}

.level-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), #fbbf24);
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(214, 25, 32, 0.3);
}

.level-progress-dots {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
}

.level-dot {
  font-size: 1rem;
  opacity: 0.3;
  transition: opacity 0.2s ease;
}

.level-dot.done {
  opacity: 1;
}

/* ============================================================

/* ============================================================
/* ============================================================
   VERTICAL STORYLINE (Vertical Progress in Detail Modal)
   ============================================================ */
.vertical-storyline {
  display: flex;
  flex-direction: column;
  position: relative;
  margin: 16px 0;
  padding-left: 8px;
}

.story-step {
  display: flex;
  position: relative;
  padding-bottom: 22px;
}

.story-step:last-child {
  padding-bottom: 0;
}

/* Vertical connecting line */
.story-step::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 36px;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.story-step:last-child::before {
  display: none;
}

.story-step.done::before {
  background: var(--success);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.3);
}

.story-step.active::before {
  background: linear-gradient(180deg, var(--primary), rgba(255, 255, 255, 0.08));
}

.story-node {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  z-index: 2;
  transition: all var(--dur) var(--ease);
}

.story-step.done .story-node {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--success);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.story-step.active .story-node {
  background: rgba(214, 25, 32, 0.18);
  border-color: var(--primary);
  box-shadow: 0 0 14px rgba(214, 25, 32, 0.4);
}

.story-step.rejected .story-node {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger);
}

.story-body {
  flex: 1;
  margin-left: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.story-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.story-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #94a3b8;
}

.story-step.done .story-title {
  color: #ffffff;
}

.story-step.active .story-title {
  color: #ff5e62;
  font-weight: 800;
}

.story-step.rejected .story-title {
  color: #ef4444;
}

.story-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
}

.story-step.done .story-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.story-step.active .story-badge {
  background: rgba(214, 25, 32, 0.15);
  color: #ff5e62;
  border: 1px solid rgba(214, 25, 32, 0.3);
}

.story-desc {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 2px;
  line-height: 1.3;
}

.story-reward {
  font-size: 0.75rem;
  font-weight: 700;
  color: #facc15;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Action button variants */
.map-btn {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 14px;
  transition: all var(--dur) var(--ease);
}
.map-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

/* Management Status Button Grid */
.mgmt-status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 6px;
}

@media (min-width: 480px) {
  .mgmt-status-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.mgmt-status-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 10px 8px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  text-align: center;
}

.mgmt-status-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.mgmt-status-btn.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #60a5fa;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.mgmt-status-btn.active.status-contacted,
.mgmt-status-btn.active.status-acquired {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--success);
  color: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
  font-weight: 800;
}

.mgmt-status-btn.completed {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-weight: 700;
}

.mgmt-status-btn.completed:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #ffffff;
}

.mgmt-status-btn.active.status-sold {
  background: rgba(234, 179, 8, 0.2);
  border-color: #facc15;
  color: #facc15;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.4);
  font-weight: 800;
}

.mgmt-status-btn.active.status-rented {
  background: rgba(6, 182, 212, 0.2);
  border-color: #06b6d4;
  color: #06b6d4;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
  font-weight: 800;
}

.mgmt-status-btn.active.status-rejected {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--danger);
  color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
  font-weight: 800;
}

/* Management Agent Card */
.mgmt-agent-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px;
  margin-top: 6px;
  transition: all var(--dur) var(--ease);
}

.mgmt-agent-preview {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.mgmt-agent-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.mgmt-agent-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.mgmt-agent-info {
  flex: 1 1 auto;
  min-width: 0;
}

.mgmt-agent-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mgmt-agent-role {
  font-size: 0.76rem;
  color: var(--text-light);
}

.mgmt-agent-change-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  flex-shrink: 0;
  white-space: nowrap;
  margin-left: auto;
}

.mgmt-agent-change-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* ============================================================

/* ============================================================
   NOTIFICATION BADGE
   ============================================================ */
.nav-item {
  position: relative;
}

.notif-badge {
  position: absolute;
  top: 2px;
  right: 50%;
  transform: translateX(14px);
  background: var(--danger);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
  animation: badgePulse 2s ease-in-out infinite;
  z-index: 10;
}

@keyframes badgePulse {
  0%, 100% { transform: translateX(14px) scale(1); }
  50% { transform: translateX(14px) scale(1.15); }
}

/* ============================================================
   APP FOOTER — Agency Info + palota79 Branding
   ============================================================ */
.app-footer-info {
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.6;
  padding: 0 16px;
}

.app-footer-brand {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  padding: 16px 16px 24px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.app-footer-logo {
  height: 26px;
  width: auto;
  margin-right: 6px;
  opacity: 0.9;
}

.app-footer-brand span:first-child {
  color: #facc15;
  font-weight: 700;
}

.app-footer-brand strong {
  color: rgba(255, 255, 255, 0.6);
}

.app-footer-brand a,
.footer-contact-link {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

.app-footer-brand a:hover,
.footer-contact-link:hover {
  color: #fff;
  text-decoration: underline;
}

.app-footer-version {
  margin-top: 6px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.05em;
}

/* ============================================================
   SUPER ADMIN & HUB MODE STYLES (.sa-*)
   Layout desktop/tablet-first per dashboard di controllo.
   ============================================================ */

/* ── Hub Screens (No Agency, App Picker, Redirect) ── */
.sa-hub-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 20px;
  text-align: center;
  background: radial-gradient(ellipse 800px 500px at 50% 30%, rgba(250,204,21,0.04) 0%, transparent 70%);
}

.sa-hub-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 40px 32px;
  max-width: 420px;
  width: 100%;
  backdrop-filter: blur(12px);
}

.sa-hub-btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  background: linear-gradient(135deg, #facc15, #eab308);
  color: #000;
  box-shadow: 0 4px 16px rgba(250,204,21,0.2);
}

.sa-hub-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(250,204,21,0.35);
}

.sa-hub-btn-ghost {
  background: rgba(255,255,255,0.06);
  color: var(--text-light, #94a3b8);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: none;
}

.sa-hub-btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  box-shadow: none;
}

/* App Picker Card */
.sa-picker-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sa-picker-card:hover {
  background: rgba(250,204,21,0.06);
  border-color: rgba(250,204,21,0.25);
  transform: translateX(4px);
}

/* Spinner */
.sa-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(250,204,21,0.2);
  border-top-color: #facc15;
  border-radius: 50%;
  animation: sa-spin 0.7s linear infinite;
}

@keyframes sa-spin {
  to { transform: rotate(360deg); }
}

/* ── Super Admin Dashboard ── */
.sa-dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 40px;
  min-height: 100vh;
}

/* Header */
.sa-header {
  padding: 28px 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.sa-header-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sa-header-title h1 {
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
  margin: 0;
}

.sa-header-title h1 span {
  color: #facc15;
}

.sa-header-subtitle {
  font-size: 0.85rem;
  color: var(--text-light, #94a3b8);
  font-weight: 500;
  margin-top: 2px;
}

.sa-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sa-btn-logout {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-light, #94a3b8);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.sa-btn-logout:hover {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.3);
  color: #ef4444;
}

/* Tab Navigation */
.sa-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 24px;
  overflow-x: auto;
}

.sa-tab {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-light, #94a3b8);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.sa-tab:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.sa-tab.active {
  background: rgba(250,204,21,0.15);
  color: #facc15;
}

/* Tab Panels */
.sa-panel {
  display: none;
}

.sa-panel.active {
  display: block;
}

/* KPI Grid */
.sa-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.sa-kpi-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px;
  transition: border-color 0.2s;
}

.sa-kpi-card:hover {
  border-color: rgba(255,255,255,0.15);
}

.sa-kpi-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.sa-kpi-value {
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.sa-kpi-value.gold { color: #facc15; }
.sa-kpi-value.green { color: #4ade80; }
.sa-kpi-value.amber { color: #f59e0b; }
.sa-kpi-value.blue { color: #60a5fa; }

/* Section Card */
.sa-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}

.sa-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tables */
.sa-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.sa-table thead th {
  padding: 12px 10px;
  color: var(--text-light, #94a3b8);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sa-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}

.sa-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

.sa-table tbody td {
  padding: 14px 10px;
  font-size: 0.9rem;
  color: #e2e8f0;
  vertical-align: middle;
}

.sa-table-link {
  color: #facc15;
  text-decoration: none;
  font-weight: 600;
}

.sa-table-link:hover {
  text-decoration: underline;
}

/* Badge Pill */
.sa-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.sa-badge-green {
  background: rgba(34,197,94,0.15);
  color: #4ade80;
}

.sa-badge-amber {
  background: rgba(245,158,11,0.15);
  color: #f59e0b;
}

.sa-badge-red {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
}

.sa-badge-blue {
  background: rgba(96,165,250,0.15);
  color: #60a5fa;
}

/* Orphan group card */
.sa-orphan-group {
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.15);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.sa-orphan-group:hover {
  border-color: rgba(245,158,11,0.35);
  background: rgba(245,158,11,0.1);
}

.sa-orphan-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sa-orphan-group-details {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(245,158,11,0.15);
}

.sa-orphan-group.open .sa-orphan-group-details {
  display: block;
}

/* Toolbar / Filters */
.sa-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.sa-search {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 8px 14px;
  color: #fff;
  font-size: 0.88rem;
  outline: none;
  width: 220px;
  transition: border-color 0.2s;
}

.sa-search:focus {
  border-color: rgba(250,204,21,0.4);
}

.sa-search::placeholder {
  color: rgba(255,255,255,0.3);
}

.sa-select {
  background: rgba(255,255,255,0.05);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}

.sa-select option {
  background: #1e293b;
  color: #fff;
}

/* Empty state */
.sa-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light, #94a3b8);
}

.sa-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .sa-dashboard {
    padding: 0 12px 32px;
  }
  
  .sa-header {
    padding: 20px 0 16px;
  }
  
  .sa-header-title h1 {
    font-size: 1.3rem;
  }
  
  .sa-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .sa-kpi-card {
    padding: 16px;
  }
  
  .sa-kpi-value {
    font-size: 1.5rem;
  }
  
  .sa-tabs {
    gap: 2px;
    padding: 3px;
  }
  
  .sa-tab {
    padding: 8px 14px;
    font-size: 0.82rem;
  }
  
  .sa-section {
    padding: 16px;
  }
  
  .sa-table {
    font-size: 0.82rem;
  }
  
  .sa-table thead th,
  .sa-table tbody td {
    padding: 10px 6px;
  }
  
  .sa-search {
    width: 100%;
  }
}

/* ============================================================
   CONTRACTS SECTION · Modern Accordion Layout & Legal Workflow
   ============================================================ */

/* --- Status Badge Header --- */
.ct-status-badge-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.ct-status-badge-header.draft {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fbbf24;
}
.ct-status-badge-header.signed {
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: #4ade80;
}

/* --- Accordion Container --- */
.ct-accordion-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* --- Accordion Item --- */
.ct-acc-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: visible;
  transition: all 0.25s ease;
}
.ct-acc-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
}
.ct-acc-item.open {
  border-color: rgba(250, 204, 21, 0.45);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  background: rgba(255, 255, 255, 0.05);
}
.ct-acc-item .ct-acc-header {
  border-radius: 15px;
}
.ct-acc-item.open .ct-acc-header {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.ct-acc-item.open .ct-acc-body {
  border-bottom-left-radius: 15px;
  border-bottom-right-radius: 15px;
}

/* --- Accordion Header (Layout a Righe Ottimizzato Desktop e Mobile) --- */
.ct-acc-header {
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background 0.2s;
}
.ct-acc-header:hover {
  background: rgba(255, 255, 255, 0.03);
}
.ct-acc-header-row-top {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.ct-acc-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}
.ct-acc-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.1px;
  flex: 1;
}
.ct-acc-chevron {
  width: 20px;
  height: 20px;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
}
.ct-acc-item.open .ct-acc-chevron {
  transform: rotate(180deg);
  color: #facc15;
}
.ct-acc-header-row-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-left: 56px;
}
.ct-acc-desc {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.35;
  flex: 1;
}
.ct-acc-badge-cell {
  flex-shrink: 0;
}
.ct-acc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 700;
}
.ct-acc-badge.ok {
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #4ade80;
}
.ct-acc-badge.warn {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fbbf24;
}
.ct-acc-badge.locked {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #94a3b8;
}

/* --- Accordion Body --- */
.ct-acc-body {
  display: none;
  padding: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  animation: ctFadeIn 0.25s ease-out;
}
.ct-acc-item.open .ct-acc-body {
  display: block;
}

@keyframes ctFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Locked Agency Box --- */
.ct-locked-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  margin-bottom: 22px;
}
.ct-locked-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.ct-locked-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #60a5fa;
  margin: 0 0 4px;
}
.ct-locked-desc {
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
  margin: 0;
}
.ct-btn-change-request {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.2), rgba(250, 204, 21, 0.08));
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: 10px;
  color: #facc15;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 10px;
  font-family: inherit;
}
.ct-btn-change-request:hover {
  background: rgba(250, 204, 21, 0.3);
  transform: translateY(-1px);
}

/* --- Step Header --- */
.ct-step-header {
  text-align: center;
  margin-bottom: 28px;
}
.ct-step-icon {
  font-size: 2.4rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}
.ct-step-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
}
.ct-step-desc {
  font-size: 0.88rem;
  color: var(--text-light);
  margin: 0;
}

/* --- Copy from Profile Button --- */
.ct-btn-copy-profile {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(56,189,248,0.12), rgba(56,189,248,0.04));
  border: 1px dashed rgba(56,189,248,0.4);
  border-radius: 12px;
  color: #38bdf8;
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  margin-bottom: 24px;
}
.ct-btn-copy-profile:hover {
  background: linear-gradient(135deg, rgba(56,189,248,0.2), rgba(56,189,248,0.08));
  border-color: #38bdf8;
  transform: translateY(-1px);
}

/* --- Form --- */
.ct-form-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.ct-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  grid-column: span 3;
}
.ct-form-group.ct-full { grid-column: 1 / -1; }
.ct-form-group.ct-third { grid-column: span 2; }
.ct-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.02em;
}
.ct-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 12px 14px;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.25s, box-shadow 0.25s;
  outline: none;
}
select.ct-input {
  background-color: #0b1329;
  color: #ffffff;
  cursor: pointer;
}
select.ct-input option {
  background-color: #0b1329 !important;
  color: #ffffff !important;
  padding: 10px;
}
select.ct-input option:checked,
select.ct-input option:hover {
  background-color: #1e293b !important;
  color: #facc15 !important;
}
.ct-input:focus {
  border-color: #facc15;
  box-shadow: 0 0 0 3px rgba(250,204,21,0.12);
}
.ct-input::placeholder { color: rgba(255,255,255,0.2); }
.ct-input-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15) !important;
}
.ct-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 28px 0 20px;
}
.ct-section-subtitle {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 16px;
}

/* --- Form Inputs Disabled / Readonly --- */
.ct-input:disabled,
.ct-input[readonly] {
  background: rgba(255, 255, 255, 0.02) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
  color: rgba(255, 255, 255, 0.55) !important;
  cursor: not-allowed;
}

/* --- Agency Actions --- */
.ct-agency-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
.ct-btn-save-agency {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}
.ct-btn-save-agency:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
}

/* --- Features Box --- */
.ct-features-box {
  background: rgba(250, 204, 21, 0.04);
  border: 1px solid rgba(250, 204, 21, 0.15);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 24px;
}
.ct-features-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #facc15;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.ct-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}
.ct-feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-light);
}
.ct-feature-check {
  color: #4ade80;
  font-weight: 800;
  flex-shrink: 0;
}

/* --- Billing Sticky Bar & Bullet Toggle --- */
.ct-billing-sticky-bar {
  position: -webkit-sticky;
  position: sticky;
  top: 74px;
  z-index: 30;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0 12px 0;
  margin: -6px 0 14px 0;
  background: linear-gradient(180deg, rgba(11, 19, 41, 0.98) 0%, rgba(11, 19, 41, 0.92) 80%, rgba(11, 19, 41, 0) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
}

.ct-billing-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #080d1a;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
  padding: 4px 6px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.08);
  max-width: 100%;
}

.ct-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  font-family: inherit;
  white-space: nowrap;
  user-select: none;
}
.ct-toggle-btn:hover:not(.active):not(:disabled) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}
.ct-toggle-btn.active {
  background: linear-gradient(135deg, #facc15 0%, #eab308 100%);
  color: #0b1329;
  font-weight: 800;
  box-shadow: 0 3px 14px rgba(250, 204, 21, 0.35);
}
.ct-toggle-radio-icon {
  font-size: 0.95rem;
  line-height: 1;
  display: inline-block;
}
.ct-toggle-btn.active .ct-toggle-radio-icon {
  color: #0b1329;
}
.ct-toggle-btn:not(.active) .ct-toggle-radio-icon {
  color: #64748b;
}

.ct-save-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 9999px;
  line-height: 1.2;
  transition: all 0.2s;
}
.ct-toggle-btn.active .ct-save-badge {
  background: rgba(0, 0, 0, 0.18);
  color: #064e3b;
  border: 1px solid rgba(0, 0, 0, 0.25);
}
.ct-toggle-btn:not(.active) .ct-save-badge {
  background: rgba(255, 255, 255, 0.06);
  color: #64748b;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- Pricing Cards (Alti Uguali e Perfettamente Allineati) --- */
.ct-pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 20px;
  align-items: stretch;
}
.ct-plan-card {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 24px 22px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}
.ct-plan-card:hover {
  border-color: rgba(250, 204, 21, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}
.ct-plan-card.selected {
  border-color: #facc15;
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.08) 0%, rgba(250, 204, 21, 0.01) 100%);
  box-shadow: 0 0 30px rgba(250, 204, 21, 0.12), 0 12px 32px rgba(0, 0, 0, 0.3);
}
.ct-plan-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.3);
  color: #facc15;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
}
.ct-plan-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  min-height: 28px;
  display: flex;
  align-items: center;
}
.ct-plan-desc {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.45;
  margin-bottom: 22px;
  min-height: 44px; /* Altezza identica per allineare le descrizioni su 1 e 2 righe */
  display: flex;
  align-items: flex-start;
}
.ct-plan-price-block {
  margin-bottom: 14px;
}
.ct-plan-price-block.ct-plan-renewal {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 22px;
}
.ct-plan-year-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.ct-plan-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.ct-plan-amount {
  font-size: 2.2rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}
.ct-plan-renewal .ct-plan-amount {
  font-size: 1.55rem;
  color: rgba(255, 255, 255, 0.7);
}
.ct-plan-currency {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 600;
}
.ct-plan-select-indicator {
  margin-top: auto; /* Allinea entrambi i pulsanti in fondo alla stessa linea */
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-light);
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  box-sizing: border-box;
}
.ct-plan-card.selected .ct-plan-select-indicator {
  background: rgba(250, 204, 21, 0.18);
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.35);
}
.ct-price-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-light);
  opacity: 0.7;
  margin: 12px 0 0;
}

/* --- Accordion 3: Territori ed Espansioni --- */
.ct-territory-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.ct-territory-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px;
  transition: all 0.2s ease;
}
.ct-territory-card.primary {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.08), rgba(250, 204, 21, 0.02));
  border-color: rgba(250, 204, 21, 0.3);
}
.ct-territory-card.founder {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.02));
  border-color: rgba(16, 185, 129, 0.3);
}
.ct-territory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ct-territory-type {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 6px;
}
.ct-territory-type.gold {
  background: rgba(250, 204, 21, 0.2);
  color: #facc15;
}
.ct-territory-type.green {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}
.ct-territory-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}
.ct-territory-meta {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.5;
}
.ct-territory-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.ct-territory-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
}

/* Founder card · Esclusiva Bonus su 3 comuni aggiuntivi (solo Globo) */
.ct-territory-card.ct-founder-wide {
  grid-column: 1 / -1;
  position: relative;
  overflow: hidden;
  padding: 22px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(16, 185, 129, 0.16), transparent 55%),
    linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(250, 204, 21, 0.04));
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.08), 0 10px 34px rgba(16, 185, 129, 0.12);
}
.ct-founder-glow {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.18), transparent 65%);
  pointer-events: none;
  animation: ctFounderPulse 4s ease-in-out infinite;
}
@keyframes ctFounderPulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.12); }
}
.ct-founder-wide > * { position: relative; z-index: 1; }
.ct-founder-wide > .ct-founder-glow { position: absolute; z-index: 0; }
.ct-founder-star { font-size: 1.3rem; filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.6)); }
.ct-founder-title {
  font-size: 1.35rem;
  line-height: 1.25;
  margin-bottom: 14px;
  background: linear-gradient(90deg, #ffffff, #a7f3d0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ct-founder-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed rgba(52, 211, 153, 0.35);
  font-size: 0.85rem;
  color: var(--text-light);
}
.ct-founder-sum-item strong {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 900;
  margin-right: 2px;
}
.ct-founder-sum-item.total strong { color: #facc15; }
.ct-founder-sum-item.total { color: #fde68a; font-weight: 700; }
.ct-founder-sum-plus { color: #34d399; font-weight: 900; font-size: 1.1rem; }
.ct-founder-wide .ct-territory-meta strong { color: #a7f3d0; }
.ct-founder-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.ct-founder-tile {
  text-align: center;
  padding: 16px 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(52, 211, 153, 0.28);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.ct-founder-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(52, 211, 153, 0.7);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.2);
}
.ct-founder-tile-emoji { font-size: 1.8rem; margin-bottom: 4px; }
.ct-founder-tile-name { font-size: 1.1rem; font-weight: 800; color: #fff; }
.ct-founder-tile-prov { font-size: 0.72rem; color: var(--text-light); margin: 2px 0 10px; opacity: 0.85; }
.ct-founder-tile-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.4);
}
.ct-founder-foot {
  margin-top: 14px;
  font-size: 0.72rem;
  color: var(--text-light);
  opacity: 0.7;
  text-align: center;
}
/* ---- Founder · premium pass ---- */
.ct-territory-card.ct-primary-wide {
  grid-column: 1 / -1;
  position: relative;
  overflow: hidden;
  padding: 22px 24px 22px 28px;
  border-color: rgba(250, 204, 21, 0.45);
  background:
    radial-gradient(90% 160% at 100% 0%, rgba(250, 204, 21, 0.14), transparent 60%),
    linear-gradient(135deg, rgba(250, 204, 21, 0.09), rgba(250, 204, 21, 0.02));
  box-shadow: 0 8px 28px rgba(250, 204, 21, 0.08);
}
.ct-primary-wide::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, #facc15, #f59e0b);
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.6);
}
.ct-primary-wide .ct-territory-name {
  font-size: 1.7rem;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, #fff, #fde68a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ct-primary-wide .ct-territory-header span:last-child {
  display: inline-block;
  font-size: 1.5rem !important;
  filter: drop-shadow(0 4px 8px rgba(244, 63, 94, 0.45));
  animation: ctPinBounce 2.6s ease-in-out infinite;
}
@keyframes ctPinBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Card fondatore: trama a punti + riflesso che attraversa la card */
.ct-territory-card.ct-founder-wide::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(52, 211, 153, 0.13) 1px, transparent 1px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), transparent 70%);
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.ct-territory-card.ct-founder-wide::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  transform: skewX(-18deg);
  animation: ctFounderShine 7s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}
@keyframes ctFounderShine {
  0%, 55% { left: -60%; }
  100% { left: 130%; }
}
.ct-founder-star { animation: ctStarSpin 6s ease-in-out infinite; display: inline-block; }
@keyframes ctStarSpin {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50% { transform: rotate(10deg) scale(1.15); }
}
.ct-founder-wide .ct-territory-type.green {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.3), rgba(250, 204, 21, 0.18));
  border: 1px solid rgba(52, 211, 153, 0.4);
  padding: 4px 10px;
}
.ct-founder-summary {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.35), rgba(16, 185, 129, 0.08));
  border-style: solid;
  border-width: 1px;
  box-shadow: inset 0 0 18px rgba(16, 185, 129, 0.08);
}
.ct-founder-sum-item.total {
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.4);
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.18);
}

/* Tessere dei comuni */
.ct-founder-tile {
  position: relative;
  overflow: hidden;
  padding: 22px 12px 16px;
  border: 1px solid transparent;
  background:
    linear-gradient(#0c1f1c, #0b1a1f) padding-box,
    linear-gradient(135deg, #34d399, #facc15, #34d399) border-box;
  background-size: auto, 220% 220%;
  animation: ctTileIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both, ctTileBorder 6s linear infinite;
  animation-delay: calc(var(--i, 0) * 0.14s), 0s;
}
@keyframes ctTileIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ctTileBorder {
  0% { background-position: 0 0, 0% 50%; }
  50% { background-position: 0 0, 100% 50%; }
  100% { background-position: 0 0, 0% 50%; }
}
.ct-founder-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 60% at 50% 0%, rgba(52, 211, 153, 0.16), transparent 70%);
  pointer-events: none;
}
.ct-founder-tile-num {
  position: absolute;
  top: 9px;
  left: 10px;
  font-size: 0.68rem;
  font-weight: 900;
  color: #1c1400;
  background: linear-gradient(135deg, #fde047, #f59e0b);
  padding: 2px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}
.ct-founder-tile-flag {
  position: absolute;
  top: 7px;
  right: 10px;
  font-size: 1.05rem;
  transform-origin: 20% 100%;
  animation: ctFlagWave 2.8s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.35s);
}
@keyframes ctFlagWave {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(8deg); }
}
.ct-founder-tile-emoji {
  width: 58px;
  height: 58px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(52, 211, 153, 0.35), rgba(52, 211, 153, 0.06));
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.35), 0 6px 18px rgba(16, 185, 129, 0.22);
}
.ct-founder-tile-name {
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}
.ct-founder-tile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
}
.ct-founder-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: ctDotPulse 1.8s ease-out infinite;
}
@keyframes ctDotPulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.ct-founder-foot {
  padding-top: 12px;
  border-top: 1px solid rgba(52, 211, 153, 0.15);
}
@media (prefers-reduced-motion: reduce) {
  .ct-founder-glow, .ct-founder-star, .ct-founder-tile, .ct-founder-tile-flag,
  .ct-founder-dot, .ct-primary-wide .ct-territory-header span:last-child,
  .ct-territory-card.ct-founder-wide::after { animation: none !important; }
}
@media (max-width: 640px) {
  .ct-founder-grid { grid-template-columns: 1fr; }
  .ct-founder-title { font-size: 1.15rem; }
  .ct-territory-card.ct-founder-wide { padding: 18px 14px; }
  .ct-primary-wide .ct-territory-name { font-size: 1.4rem; }
  .ct-territory-card.ct-primary-wide { padding: 18px 16px 18px 22px; }
}

/* --- Accordions 4 & 5: Legal Viewer --- */
.ct-legal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.ct-legal-meta {
  font-size: 0.82rem;
  color: var(--text-light);
}
.ct-btn-group-legal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ct-btn-legal-print {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #facc15;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.ct-btn-legal-print:hover {
  background: rgba(250, 204, 21, 0.15);
  border-color: #facc15;
  transform: translateY(-1px);
}
.ct-btn-legal-pdf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  color: #38bdf8;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.ct-btn-legal-pdf:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  transform: translateY(-1px);
}
.ct-legal-viewer {
  max-height: 440px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 24px 28px;
  scrollbar-width: thin;
  scrollbar-color: rgba(250, 204, 21, 0.4) rgba(0, 0, 0, 0.2);
}
.ct-legal-viewer::-webkit-scrollbar {
  width: 6px;
}
.ct-legal-viewer::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
.ct-legal-viewer::-webkit-scrollbar-thumb {
  background-color: rgba(250, 204, 21, 0.4);
  border-radius: 3px;
}
.ct-legal-article {
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.ct-legal-article:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.ct-legal-article-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #facc15;
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}
.ct-legal-body {
  font-size: 0.85rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
}
.ct-legal-body p {
  margin-bottom: 8px;
}
.ct-legal-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.82rem;
}
.ct-legal-body th,
.ct-legal-body td {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  text-align: left;
}
.ct-legal-body th {
  background: rgba(255, 255, 255, 0.05);
  color: #facc15;
  font-weight: 700;
}
.ct-legal-body ul {
  margin: 8px 0 10px 20px;
  padding-left: 0;
}
.ct-legal-body ul li {
  margin-bottom: 5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
}
.ct-legal-body .founder-box {
  background: rgba(250, 204, 21, 0.08);
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-left: 4px solid #facc15;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 16px 0;
}
.ct-legal-body .founder-box .founder-title {
  font-weight: 800;
  color: #facc15;
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.ct-legal-body .info-box {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 14px 0;
  font-size: 0.84rem;
}

/* --- Accordion 6: Sottoscrizione & Download --- */
.ct-sign-checklist {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
}
.ct-sign-check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.86rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.ct-sign-check-row:last-child {
  border-bottom: none;
}
.ct-cert-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.02));
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 24px;
}
.ct-cert-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #34d399;
  margin-bottom: 14px;
}
.ct-cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  font-size: 0.85rem;
}
.ct-cert-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ct-cert-label {
  font-size: 0.72rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ct-cert-val {
  color: #fff;
  font-weight: 600;
}

/* --- Download Area --- */
.ct-download-area {
  text-align: center;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.06), rgba(250, 204, 21, 0.01));
  border: 1px solid rgba(250, 204, 21, 0.15);
  border-radius: 20px;
  padding: 32px 24px;
  margin-bottom: 8px;
}
.ct-download-icon {
  font-size: 2.8rem;
  margin-bottom: 10px;
}
.ct-download-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
}
.ct-download-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  margin: 0 0 22px;
  line-height: 1.5;
}
.ct-btn-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 34px;
  background: linear-gradient(135deg, #facc15, #eab308);
  border: none;
  border-radius: 14px;
  color: #000;
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 6px 24px rgba(250, 204, 21, 0.3);
  font-family: inherit;
}
.ct-btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(250, 204, 21, 0.45);
}
.ct-btn-print-action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  font-family: inherit;
}
.ct-btn-print-action:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}
.ct-btn-draft {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.ct-btn-draft:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.38);
  transform: translateY(-1px);
}
.ct-download-note {
  font-size: 0.76rem;
  color: var(--text-light);
  opacity: 0.6;
  margin: 14px 0 0;
}

/* --- Responsive Mobile Righe --- */
@media (max-width: 600px) {
  .ct-page-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
  }
  .ct-acc-header {
    padding: 14px 16px;
    gap: 8px;
  }
  .ct-acc-header-row-top {
    gap: 10px;
  }
  .ct-acc-icon {
    width: 36px;
    height: 36px;
    font-size: 1.15rem;
    border-radius: 10px;
  }
  .ct-acc-title {
    font-size: 0.98rem;
    line-height: 1.3;
  }
  .ct-acc-header-row-sub {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 0;
    gap: 8px;
    margin-top: 2px;
  }
  .ct-acc-desc {
    font-size: 0.8rem;
    line-height: 1.4;
  }
  .ct-acc-badge-cell {
    width: 100%;
  }
  .ct-acc-badge {
    font-size: 0.76rem;
    padding: 4px 10px;
  }
  .ct-form-grid { grid-template-columns: 1fr; }
  .ct-form-group, .ct-form-group.ct-third, .ct-form-group.ct-full { grid-column: span 1; }
  .ct-pricing-grid { grid-template-columns: 1fr; }
  .ct-plan-desc { min-height: auto; }
  .ct-billing-sticky-bar {
    top: 70px;
    padding: 6px 0 10px 0;
  }
  .ct-billing-toggle {
    padding: 3px 4px;
    gap: 3px;
    width: fit-content;
  }
  .ct-toggle-btn {
    padding: 8px 13px;
    font-size: 0.8rem;
    gap: 5px;
  }
  .ct-save-badge {
    font-size: 0.55rem;
    padding: 2px 5px;
  }
  .ct-acc-body { padding: 16px 14px; }
  .ct-legal-viewer { padding: 16px 14px; }
  .ct-sign-check-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 0;
  }
  .ct-cert-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ==========================================================
   AUTOCOMPLETE INDIRIZZO SEDE LEGALE (CONTRATTI)
   ========================================================== */
.ct-autocomplete-items {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 99999;
  background: #0f172a;
  border: 1px solid rgba(250, 204, 21, 0.45);
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.75), 0 0 16px rgba(250, 204, 21, 0.15);
  max-height: 250px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(250, 204, 21, 0.4) #0b0f19;
}
.ct-autocomplete-items::-webkit-scrollbar {
  width: 6px;
}
.ct-autocomplete-items::-webkit-scrollbar-thumb {
  background: rgba(250, 204, 21, 0.4);
  border-radius: 3px;
}
.ct-autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.86rem;
  color: #e2e8f0;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}
.ct-autocomplete-item:last-child {
  border-bottom: none;
}
.ct-autocomplete-item:hover,
.ct-autocomplete-item.active {
  background: rgba(250, 204, 21, 0.18);
  color: #ffffff;
  padding-left: 18px;
}
.ct-autocomplete-main {
  font-weight: 700;
  color: #ffffff;
}
.ct-autocomplete-sub {
  font-size: 0.76rem;
  color: #94a3b8;
}
.ct-input-autofilled {
  animation: ctFieldPulse 1.4s ease;
}
@keyframes ctFieldPulse {
  0% {
    background-color: rgba(16, 185, 129, 0.4) !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.45);
  }
  50% {
    background-color: rgba(16, 185, 129, 0.2) !important;
    border-color: #34d399 !important;
  }
  100% {
    background-color: #0b1329 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: none;
  }
}

/* ============================================
   MODALE OTP · Firma Contratto Elettronica
   ============================================ */
.ct-otp-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: ctOtpFadeIn 0.3s ease;
}

@keyframes ctOtpFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ct-otp-modal {
  width: 100%;
  max-width: 460px;
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.97), rgba(10, 15, 30, 0.99));
  border: 1px solid rgba(250, 204, 21, 0.15);
  border-radius: 20px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 80px rgba(250, 204, 21, 0.06);
  overflow: hidden;
  animation: ctOtpSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ctOtpSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.ct-otp-header {
  position: relative;
  text-align: center;
  padding: 32px 32px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ct-otp-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: #64748b;
  font-size: 22px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ct-otp-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.ct-otp-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(250, 204, 21, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 32px;
}

.ct-otp-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #f1f5f9;
  margin: 0 0 8px;
  letter-spacing: -0.3px;
}

.ct-otp-subtitle {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}

.ct-otp-body {
  padding: 24px 32px 32px;
}

/* Riepilogo */
.ct-otp-riepilogo {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
}

.ct-otp-riepilogo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.82rem;
}

.ct-otp-riepilogo-row span {
  color: #64748b;
}

.ct-otp-riepilogo-row strong {
  color: #e2e8f0;
  font-weight: 600;
}

/* Digit container */
.ct-otp-digits-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.ct-otp-digit {
  width: 52px;
  height: 62px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: #facc15;
  font-size: 1.6rem;
  font-weight: 800;
  text-align: center;
  outline: none;
  transition: all 0.2s ease;
  caret-color: #facc15;
}

.ct-otp-digit:focus {
  border-color: #facc15;
  background: rgba(250, 204, 21, 0.06);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.12), 0 0 24px rgba(250, 204, 21, 0.08);
}

.ct-otp-sep {
  color: #475569;
  font-size: 1.4rem;
  font-weight: 700;
  padding: 0 2px;
}

/* Error message */
.ct-otp-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
  padding: 10px 14px;
  color: #f87171;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
  animation: ctOtpShake 0.4s ease;
}

@keyframes ctOtpShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Timer row */
.ct-otp-timer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.ct-otp-timer {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.88rem;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 12px;
  border-radius: 8px;
}

.ct-otp-btn-resend {
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s;
}

.ct-otp-btn-resend:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.1);
}

.ct-otp-btn-resend:disabled {
  color: #475569;
  cursor: not-allowed;
}

/* Primary button */
.ct-otp-btn-primary {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #facc15, #eab308);
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: -0.2px;
}

.ct-otp-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(250, 204, 21, 0.3);
}

.ct-otp-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Spinner */
.ct-otp-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(250, 204, 21, 0.15);
  border-top-color: #facc15;
  border-radius: 50%;
  margin: 0 auto;
  animation: ctOtpSpin 0.8s linear infinite;
}

@keyframes ctOtpSpin {
  to { transform: rotate(360deg); }
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  .ct-otp-modal {
    max-width: 100%;
    border-radius: 16px;
  }
  .ct-otp-header { padding: 24px 20px 16px; }
  .ct-otp-body { padding: 20px 20px 24px; }
  .ct-otp-digit {
    width: 44px;
    height: 54px;
    font-size: 1.3rem;
    border-radius: 10px;
  }
  .ct-otp-digits-container { gap: 6px; }
}

