/* ============================================
   TweakIT - Brand Stylesheet
   ============================================ */

:root {
  /* Brand Colors */
  --color-primary: #fff600;
  --color-dark: #0e1116;
  --color-red: #ed254e;
  --color-white: #ffffff;
  --color-gray: #151a22;
  --color-gray-light: #1e2530;
  --color-muted: #94a3b8;

  /* Typography */
  --font-main: 'DM Sans', system-ui, sans-serif;
  --font-heading: 'Orbitron', 'DM Sans', sans-serif;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 4rem;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ============================================
   Reset & Base Styles
   ============================================ */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-dark);
  color: var(--color-white);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

/* ============================================
   Utility Classes
   ============================================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.text-primary {
  color: var(--color-primary);
}

.text-red {
  color: var(--color-red);
}

.btn {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all var(--transition-normal);
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-dark);
}

.btn-primary:hover {
  background-color: var(--color-red);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(237, 37, 78, 0.35);
}

.btn-danger {
  background-color: var(--color-red);
  color: var(--color-white);
}

.btn-danger:hover {
  background-color: #c91d3e;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(237, 37, 78, 0.3);
}

.btn-discord {
  background-color: #5865F2;
  color: var(--color-white);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.btn-discord:hover {
  background-color: #4752c4;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(88, 101, 242, 0.3);
}

/* ============================================
   Navbar
   ============================================ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: rgba(14, 17, 22, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 246, 0, 0.1);
  padding: var(--spacing-sm) 0;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.navbar-logo-mark-link,
.navbar-wordmark-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.navbar-wordmark-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.navbar-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 246, 0, 0.2);
}

.navbar-wordmark {
  height: 26px;
  width: auto;
  max-width: min(160px, 38vw);
  object-fit: contain;
  object-position: left center;
}

.nav-admin {
  opacity: 0.85;
  font-size: 0.9rem;
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.navbar-menu a {
  font-weight: 600;
  position: relative;
  padding: var(--spacing-xs) 0;
}

.navbar-menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-primary);
  transition: width var(--transition-normal);
}

.navbar-menu a:hover {
  color: var(--color-primary);
}

.navbar-menu a:hover::after {
  width: 100%;
}

.navbar-auth {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  background-color: var(--color-gray);
  border-radius: var(--radius-md);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  padding: var(--spacing-xs);
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--color-white);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 88px;
  padding-bottom: var(--spacing-lg);
  background: var(--color-dark);
  position: relative;
  overflow: hidden;
}

.hero-carousel {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-carousel__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.4s ease-in-out;
}

.hero-carousel__slide.is-active {
  opacity: 1;
  z-index: 1;
}

.hero-carousel__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.04);
}

.hero-carousel__slide.is-active img {
  animation: heroKen 14s ease-in-out infinite alternate;
}

@keyframes heroKen {
  0% {
    transform: scale(1.04) translate(0, 0);
  }
  100% {
    transform: scale(1.08) translate(-0.8%, -0.5%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-carousel__slide {
    transition: none;
  }

  .hero-carousel__slide.is-active img {
    animation: none;
    transform: none;
  }
}

.hero-carousel__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 100% 80% at 50% -30%, rgba(255, 246, 0, 0.1), transparent 55%),
    radial-gradient(ellipse 60% 50% at 100% 60%, rgba(237, 37, 78, 0.07), transparent 45%),
    linear-gradient(180deg, rgba(10, 12, 16, 0.55) 0%, rgba(14, 17, 22, 0.82) 50%, rgba(14, 17, 22, 0.92) 100%);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image:
    linear-gradient(rgba(255, 246, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 246, 0, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 100%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  z-index: 2;
  background: radial-gradient(circle, rgba(255, 246, 0, 0.04) 0%, transparent 65%);
  animation: pulse 12s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(5deg); }
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 800px;
}

.hero-logo {
  margin-bottom: var(--spacing-lg);
  position: relative;
  display: inline-block;
}

.hero-logo img {
  max-width: 400px;
  height: auto;
  display: block;
}

/* Hit area sulla "i" stile toggle del wordmark (click = tema chiaro/scuro) */
.wordmark-theme-hit {
  position: absolute;
  left: 72%;
  width: 14%;
  top: 8%;
  height: 84%;
  z-index: 2;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.wordmark-theme-hit:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.wordmark-theme-hit--hero {
  left: 72%;
  width: 14%;
  top: 8%;
  height: 84%;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.85rem, 5vw, 3rem);
  margin-bottom: var(--spacing-md);
  letter-spacing: 0.04em;
  font-weight: 800;
  line-height: 1.15;
}

.hero-title span {
  color: var(--color-primary);
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--color-muted);
  margin-bottom: var(--spacing-lg);
  line-height: 1.75;
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   Services Section (tech / HUD)
   ============================================ */

.services {
  padding: var(--spacing-xl) 0;
  background-color: var(--color-dark);
}

.services.services-tech {
  position: relative;
  overflow: hidden;
}

.services-tech-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255, 246, 0, 0.07), transparent 55%),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 47px,
      rgba(255, 246, 0, 0.045) 47px,
      rgba(255, 246, 0, 0.045) 48px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 47px,
      rgba(255, 246, 0, 0.045) 47px,
      rgba(255, 246, 0, 0.045) 48px
    );
  pointer-events: none;
  opacity: 0.85;
}

.services-tech-scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 246, 0, 0.04) 48%,
    rgba(237, 37, 78, 0.06) 50%,
    rgba(255, 246, 0, 0.04) 52%,
    transparent 100%
  );
  background-size: 100% 220%;
  animation: techScanSweep 7s ease-in-out infinite;
  pointer-events: none;
  opacity: 0.9;
}

@keyframes techScanSweep {
  0%,
  100% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 0% 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .services-tech-scan {
    animation: none;
    opacity: 0.35;
  }
  .service-card--tech {
    animation: none !important;
    opacity: 1 !important;
  }
  .service-icon--tech {
    animation: none !important;
  }
}

.section-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.section-header--tech {
  position: relative;
  z-index: 1;
}

.section-eyebrow {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 246, 0, 0.55);
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  text-transform: uppercase;
  margin-bottom: var(--spacing-sm);
}

.section-title span {
  color: var(--color-primary);
}

.section-subtitle {
  color: #888;
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.services .container {
  position: relative;
  z-index: 1;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  perspective: 1200px;
}

.service-card {
  background: linear-gradient(165deg, rgba(18, 22, 30, 0.98) 0%, rgba(26, 32, 42, 0.96) 100%);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  border: 1px solid rgba(255, 246, 0, 0.1);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease, border-color 0.35s ease;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-primary), var(--color-red), transparent);
  opacity: 0.85;
  transform: scaleX(0.35);
  transition: transform 0.5s ease;
}

.service-card:hover {
  transform: translateY(-12px) rotateX(2deg);
  box-shadow:
    0 0 0 1px rgba(255, 246, 0, 0.12),
    0 24px 48px rgba(0, 0, 0, 0.55),
    0 0 60px rgba(255, 246, 0, 0.06);
  border-color: rgba(255, 246, 0, 0.28);
}

.service-card:hover::before {
  transform: scaleX(1);
}

@keyframes techCardIn {
  from {
    opacity: 0;
    transform: translateY(36px) scale(0.97);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.service-card--tech {
  animation: techCardIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.service-card--tech[data-tech-delay='1'] {
  animation-delay: 0.06s;
}
.service-card--tech[data-tech-delay='2'] {
  animation-delay: 0.14s;
}
.service-card--tech[data-tech-delay='3'] {
  animation-delay: 0.22s;
}

.service-icon--tech {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-md);
  color: var(--color-primary);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 246, 0, 0.35);
  box-shadow:
    inset 0 0 24px rgba(255, 246, 0, 0.06),
    0 0 20px rgba(255, 246, 0, 0.12);
  animation: iconHudPulse 3.2s ease-in-out infinite;
}

@keyframes iconHudPulse {
  0%,
  100% {
    box-shadow:
      inset 0 0 24px rgba(255, 246, 0, 0.06),
      0 0 16px rgba(255, 246, 0, 0.1);
  }
  50% {
    box-shadow:
      inset 0 0 32px rgba(255, 246, 0, 0.1),
      0 0 28px rgba(255, 246, 0, 0.22);
  }
}

.service-icon--tech .tech-svg {
  width: 42px;
  height: 42px;
}

.service-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: var(--spacing-sm);
  text-transform: uppercase;
}

.service-description {
  color: #aaa;
  margin-bottom: var(--spacing-md);
  line-height: 1.8;
}

.service-features {
  margin-bottom: var(--spacing-md);
}

.service-features li {
  padding: var(--spacing-xs) 0;
  color: #ccc;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.service-features li::before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--color-primary);
  box-shadow: 0 0 10px rgba(255, 246, 0, 0.65);
  flex-shrink: 0;
  transform: rotate(45deg);
  margin-top: 0.35rem;
}

.service-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--spacing-md);
  display: block;
}

.service-price span {
  font-size: 1rem;
  color: #888;
}

/* ============================================
   Features Section
   ============================================ */

.features {
  padding: var(--spacing-xl) 0;
  background-color: var(--color-gray);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
}

.feature-item {
  text-align: center;
  padding: var(--spacing-lg);
}

.feature-item--tech {
  transition: transform 0.35s ease, border-color 0.35s ease;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
}

.feature-item--tech:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 246, 0, 0.12);
  background: rgba(0, 0, 0, 0.2);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-sm);
}

.feature-icon--tech {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--spacing-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  background: linear-gradient(145deg, rgba(255, 246, 0, 0.08), rgba(237, 37, 78, 0.06));
  border: 1px solid rgba(255, 246, 0, 0.2);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.feature-icon--tech svg {
  width: 36px;
  height: 36px;
}

.feature-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: var(--spacing-sm);
  color: var(--color-primary);
}

.feature-description {
  color: #aaa;
  line-height: 1.8;
}

/* ============================================
   CTA Section
   ============================================ */

.cta {
  padding: var(--spacing-xl) 0;
  background: linear-gradient(135deg, #fff600 0%, #e6dc00 50%, #fff600 100%);
  color: var(--color-dark);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%230e1116' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
}

.cta .container {
  position: relative;
  z-index: 1;
}

.cta-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: var(--spacing-md);
  font-weight: 800;
}

.cta-description {
  font-size: 1.2rem;
  margin-bottom: var(--spacing-lg);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta .btn,
.btn-cta-join {
  background-color: var(--color-dark);
  color: var(--color-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  text-transform: none;
  letter-spacing: 0.03em;
  font-weight: 700;
}

.btn-cta-join__icon {
  flex-shrink: 0;
}

.cta .btn:hover,
.btn-cta-join:hover {
  background-color: var(--color-red);
  color: var(--color-white);
}

/* ============================================
   Footer
   ============================================ */

.footer {
  background-color: var(--color-gray);
  padding: var(--spacing-lg) 0;
  border-top: 1px solid rgba(255, 246, 0, 0.1);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.footer-logo img,
.footer-wordmark {
  height: 28px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.footer-links {
  display: flex;
  gap: var(--spacing-lg);
}

.footer-links a {
  color: #aaa;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--color-primary);
}

.footer-copyright {
  color: #666;
  font-size: 0.9rem;
}

/* ============================================
   Admin Panel Styles
   ============================================ */

.admin-panel {
  padding: var(--spacing-xl) 0;
  min-height: 100vh;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xl);
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.admin-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--color-primary);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.stat-card {
  background: linear-gradient(145deg, var(--color-gray) 0%, var(--color-gray-light) 100%);
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-primary);
}

.stat-card.danger {
  border-left-color: var(--color-red);
}

.stat-card.success {
  border-left-color: #00c853;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-white);
}

.stat-label {
  color: #888;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Table Styles */
.table-container {
  background: linear-gradient(145deg, var(--color-gray) 0%, var(--color-gray-light) 100%);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: var(--spacing-md);
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table th {
  background-color: rgba(0, 0, 0, 0.3);
  color: var(--color-primary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.data-table tbody tr {
  transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
  background-color: rgba(255, 246, 0, 0.05);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.status-badge {
  display: inline-block;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pending {
  background-color: rgba(255, 246, 0, 0.2);
  color: var(--color-primary);
}

.status-processing {
  background-color: rgba(88, 101, 242, 0.2);
  color: #5865F2;
}

.status-completed {
  background-color: rgba(0, 200, 83, 0.2);
  color: #00c853;
}

.status-cancelled {
  background-color: rgba(237, 37, 78, 0.2);
  color: var(--color-red);
}

.action-btn {
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.action-btn.edit {
  background-color: rgba(88, 101, 242, 0.2);
  color: #5865F2;
}

.action-btn.delete {
  background-color: rgba(237, 37, 78, 0.2);
  color: var(--color-red);
}

.action-btn:hover {
  transform: translateY(-2px);
}

/* ============================================
   Modal Styles
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: linear-gradient(145deg, var(--color-gray) 0%, var(--color-gray-light) 100%);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  max-width: 500px;
  width: 90%;
  transform: translateY(-50px);
  transition: transform var(--transition-normal);
  border: 1px solid rgba(255, 246, 0, 0.2);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-primary);
}

.modal-close {
  background: transparent;
  color: var(--color-white);
  font-size: 1.5rem;
  padding: var(--spacing-xs);
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--color-red);
}

.modal-body {
  margin-bottom: var(--spacing-md);
}

.modal-footer {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: flex-end;
}

/* ============================================
   Notification/Toast
   ============================================ */

.toast {
  position: fixed;
  bottom: var(--spacing-lg);
  right: var(--spacing-lg);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-md);
  color: var(--color-white);
  font-weight: 600;
  z-index: 3000;
  transform: translateX(150%);
  transition: transform var(--transition-normal);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.toast.active {
  transform: translateX(0);
}

.toast.success {
  background-color: #00c853;
}

.toast.error {
  background-color: var(--color-red);
}

.toast.info {
  background-color: #5865F2;
}

/* ============================================
   Loading Spinner
   ============================================ */

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 246, 0, 0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .navbar-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background-color: var(--color-dark);
    flex-direction: column;
    padding: var(--spacing-lg);
    transform: translateY(-150%);
    transition: transform var(--transition-normal);
  }

  .navbar-menu.active {
    transform: translateY(0);
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .data-table {
    font-size: 0.85rem;
  }

  .data-table th,
  .data-table td {
    padding: var(--spacing-sm);
  }
}

@media (max-width: 480px) {
  .hero-logo img {
    max-width: 250px;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    text-align: center;
  }
}

/* ============================================
   Animations
   ============================================ */

.fade-in {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-up {
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Glow effect for primary elements */
.glow {
  box-shadow: 0 0 20px rgba(255, 246, 0, 0.3);
}

.glow:hover {
  box-shadow: 0 0 40px rgba(255, 246, 0, 0.5);
}

/* ============================================
   Cookie banner (GDPR / ePrivacy)
   ============================================ */

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  padding: var(--spacing-md);
  background: linear-gradient(180deg, transparent 0%, rgba(14, 17, 22, 0.97) 12%);
  pointer-events: none;
}

.cookie-banner[hidden] {
  display: none !important;
}

.cookie-banner__inner {
  pointer-events: auto;
  max-width: 960px;
  margin: 0 auto;
  padding: var(--spacing-lg);
  background: linear-gradient(165deg, #151a22 0%, #0e1116 100%);
  border: 1px solid rgba(255, 246, 0, 0.2);
  border-radius: var(--radius-lg);
  box-shadow:
    0 -8px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 246, 0, 0.06);
}

.cookie-banner__title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--color-primary);
  margin: 0 0 var(--spacing-sm);
  letter-spacing: 0.04em;
}

.cookie-banner__text {
  color: #c4c9d4;
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 0 0 var(--spacing-sm);
}

.cookie-banner__links {
  font-size: 0.85rem;
  margin: 0 0 var(--spacing-md);
}

.cookie-banner__links a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-banner__links a:hover {
  color: var(--color-red);
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  justify-content: flex-end;
}

.btn-cookie-primary {
  background: var(--color-primary);
  color: var(--color-dark);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0.02em;
}

.btn-cookie-primary:hover {
  background: var(--color-red);
  color: var(--color-white);
}

.btn-cookie-secondary {
  background: transparent;
  color: var(--color-white);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  text-transform: none;
}

.btn-cookie-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

@media (max-width: 600px) {
  .cookie-banner__actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .cookie-banner__inner {
    padding: var(--spacing-md);
  }
}

/* ============================================
   Pagine legali (termini, privacy, cookie)
   ============================================ */

.legal-page {
  min-height: 100vh;
  padding: 6rem 0 4rem;
  background: var(--color-dark);
}

.legal-page .container {
  max-width: 820px;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.legal-back:hover {
  color: var(--color-red);
}

.legal-doc {
  color: #d1d5db;
  font-size: 0.95rem;
  line-height: 1.75;
}

.legal-doc h1 {
  font-family: var(--font-heading);
  color: var(--color-white);
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 1.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal-doc h2 {
  font-family: var(--font-heading);
  color: var(--color-primary);
  font-size: 1.15rem;
  margin: 2.25rem 0 1rem;
  letter-spacing: 0.04em;
}

.legal-doc p {
  margin: 0 0 1rem;
}

.legal-doc ol.legal-list,
.legal-doc ul.legal-list {
  margin: 0 0 1rem 1.25rem;
  padding: 0;
  list-style: lower-alpha;
}

.legal-doc ol.legal-list li,
.legal-doc ul.legal-list li {
  margin-bottom: 0.65rem;
  padding-left: 0.35rem;
}

.legal-doc .legal-meta {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 246, 0, 0.12);
}

.legal-doc strong {
  color: var(--color-white);
}

/* Catalogo servizi dinamico */
.services-catalog-root {
  width: 100%;
}

.services-loading,
.services-empty {
  text-align: center;
  color: var(--color-muted);
  padding: 2rem 1rem;
}

.services-category-block {
  margin-bottom: 3.5rem;
}

.services-category-block:last-child {
  margin-bottom: 0;
}

.services-category-title {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  color: var(--color-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 246, 0, 0.15);
}

.service-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.service-card__head .service-title {
  margin: 0;
  flex: 1;
}

.service-badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 246, 0, 0.12);
  color: var(--color-primary);
  border: 1px solid rgba(255, 246, 0, 0.35);
}

.service-badge--pop {
  background: rgba(237, 37, 78, 0.15);
  color: #ff6b8a;
  border-color: rgba(237, 37, 78, 0.4);
}

/* Supporto */
.support-section {
  padding: 4rem 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, transparent 100%);
  border-top: 1px solid rgba(255, 246, 0, 0.08);
}

.support-form {
  max-width: 560px;
  margin: 0 auto;
}

.support-form__row {
  margin-bottom: 1.25rem;
}

.support-form__row label {
  display: block;
  font-size: 0.9rem;
  color: #aaa;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.support-form__row input,
.support-form__row textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--color-gray);
  color: var(--color-white);
  font-family: inherit;
  font-size: 1rem;
}

.support-form__row textarea {
  resize: vertical;
  min-height: 140px;
}

.support-form__row input:focus,
.support-form__row textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.support-form__hint {
  font-size: 0.85rem;
  color: #888;
  margin: 0 0 1rem;
  line-height: 1.5;
}

.nav-admin-wrap a.nav-admin {
  color: #ff6b8a;
  font-weight: 700;
}

/* [hidden] deve prevalere: altrimenti display:flex sui pannelli annulla lo stato nascosto */
.support-widget[hidden],
.support-widget__panel[hidden],
.support-widget__chat-view[hidden] {
  display: none !important;
}

/* Widget supporto (angolo basso destro) */
.support-widget {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none;
}

.support-widget__fab,
.support-widget__panel {
  pointer-events: auto;
}

.support-widget__fab {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255, 246, 0, 0.5);
  background: linear-gradient(145deg, var(--color-gray) 0%, var(--color-dark) 100%);
  color: var(--color-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.support-widget__fab:hover {
  transform: scale(1.05);
  border-color: var(--color-primary);
}

.support-widget__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--color-red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid var(--color-dark);
}

.support-widget__panel {
  width: min(100vw - 2rem, 360px);
  max-height: min(70vh, 420px);
  display: flex;
  flex-direction: column;
  background: var(--color-gray);
  border: 1px solid rgba(255, 246, 0, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.support-widget__panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.support-widget__panel-head h3 {
  margin: 0;
  font-size: 1rem;
  font-family: var(--font-heading);
  letter-spacing: 0.04em;
}

.support-widget__close {
  position: relative;
  z-index: 4;
  flex-shrink: 0;
  background: none;
  border: none;
  color: #aaa;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  pointer-events: auto;
}

.support-widget__close:hover {
  color: var(--color-primary);
}

.support-widget__list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.support-widget__hint {
  margin: 0;
  font-size: 0.88rem;
  color: #888;
  line-height: 1.45;
}

.support-widget__item {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.88rem;
}

.support-widget__item-top {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.support-widget__item-top strong {
  color: var(--color-white);
  font-size: 0.92rem;
}

.support-widget__meta {
  font-size: 0.75rem;
  color: #666;
}

.support-widget__status {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  align-self: flex-start;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

.support-widget__status--wait {
  background: rgba(255, 180, 0, 0.15);
  color: #ffc107;
}

.support-widget__status--ok {
  background: rgba(0, 200, 83, 0.12);
  color: #69f0ae;
}

.support-widget__reply {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #d1d5db;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.support-widget__cta {
  display: block;
  text-align: center;
  padding: 0.65rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-primary);
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.support-widget__cta:hover {
  background: rgba(255, 246, 0, 0.08);
}

.support-widget__chat-view {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 280px;
  max-height: min(70vh, 480px);
}

.support-widget__back {
  align-self: flex-start;
  background: transparent;
  border: none;
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0;
}

.support-widget__back:hover {
  text-decoration: underline;
}

.support-widget__chat-subj {
  margin: 0;
  font-size: 0.88rem;
  color: #aaa;
  font-weight: 600;
}

.support-widget__messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.35rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  min-height: 160px;
  max-height: 240px;
}

.support-widget__bubble-wrap {
  margin-bottom: 0.65rem;
  max-width: 95%;
}

.support-widget__bubble-wrap--user {
  margin-left: auto;
  text-align: right;
}

.support-widget__bubble-wrap--staff {
  margin-right: auto;
  text-align: left;
}

.support-widget__bubble-meta {
  font-size: 0.65rem;
  color: #666;
  margin-bottom: 0.2rem;
}

.support-widget__bubble {
  display: inline-block;
  text-align: left;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.support-widget__bubble-wrap--user .support-widget__bubble {
  background: rgba(88, 101, 242, 0.25);
  border: 1px solid rgba(88, 101, 242, 0.35);
}

.support-widget__bubble-wrap--staff .support-widget__bubble {
  background: rgba(255, 246, 0, 0.08);
  border: 1px solid rgba(255, 246, 0, 0.2);
}

.support-widget__chat-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.support-widget__chat-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 56px;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--color-gray);
  color: var(--color-white);
  font-family: inherit;
  font-size: 0.88rem;
}

.btn--widget-send {
  align-self: flex-end;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

.support-widget__dm-hint {
  margin: 0;
  font-size: 0.72rem;
  color: #666;
  line-height: 1.35;
}

.support-widget__item--btn {
  position: relative;
  width: 100%;
  text-align: left;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.support-widget__item--btn:hover {
  border-color: rgba(255, 246, 0, 0.25);
}

.support-widget__unread-dot {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-red);
  box-shadow: 0 0 0 2px var(--color-dark);
}

@media (max-width: 480px) {
  .support-widget {
    right: 0.75rem;
    bottom: 0.75rem;
  }
  .support-widget__fab {
    width: 52px;
    height: 52px;
  }
}

/* ============================================
   Tema chiaro (toggle dalla "i" del wordmark)
   ============================================ */

html.theme-light body {
  background-color: #f8fafc;
  color: #0f172a;
}

html.theme-light .navbar {
  background-color: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-bottom-color: rgba(15, 23, 42, 0.06);
}

html.theme-light .navbar-menu a {
  color: #1e293b;
}

html.theme-light .navbar-menu a:hover {
  color: #a16207;
}

html.theme-light .navbar-menu a::after {
  background-color: #ca8a04;
}

@media (max-width: 768px) {
  html.theme-light .navbar-menu {
    background-color: #ffffff;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
  }
}

html.theme-light .menu-toggle span {
  background-color: #1e293b;
}

html.theme-light .user-info {
  background-color: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

html.theme-light .user-name {
  color: #0f172a;
}

html.theme-light .hero {
  background: #f1f5f9;
}

html.theme-light .hero-carousel__veil {
  background:
    radial-gradient(ellipse 100% 80% at 50% -30%, rgba(250, 204, 21, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 50% at 100% 60%, rgba(237, 37, 78, 0.04), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(241, 245, 249, 0.88) 55%, rgba(226, 232, 240, 0.94) 100%);
}

html.theme-light .hero-subtitle {
  color: #475569;
}

html.theme-light .services {
  background-color: #f1f5f9;
}

html.theme-light .services-tech-bg {
  opacity: 0.45;
}

html.theme-light .feature-item--tech:hover {
  border-color: rgba(15, 23, 42, 0.08);
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

html.theme-light .feature-description {
  color: #64748b;
}

html.theme-light .features {
  background-color: #ffffff;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

html.theme-light .support-section {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-top-color: rgba(15, 23, 42, 0.06);
}

html.theme-light .support-form__row label {
  color: #334155;
}

html.theme-light .support-form__row input,
html.theme-light .support-form__row textarea {
  border-color: rgba(15, 23, 42, 0.1);
  background: #ffffff;
  color: #0f172a;
}

html.theme-light .support-form__hint {
  color: #64748b;
}

html.theme-light .footer {
  background-color: #f1f5f9;
  border-top-color: rgba(15, 23, 42, 0.07);
}

html.theme-light .footer-links a {
  color: #475569;
}

html.theme-light .footer-links a:hover {
  color: #a16207;
}

html.theme-light .footer-copyright {
  color: #94a3b8;
}

html.theme-light .section-subtitle {
  color: #64748b;
}

html.theme-light .section-title {
  color: #0f172a;
}

html.theme-light .service-card--tech,
html.theme-light .service-card {
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.06);
}

html.theme-light .section-eyebrow {
  color: #94a3b8;
}
