/* ============================================================
   G.T. TERMOIDRAULICA — Design System condiviso
   Supporto dark + light mode via CSS variables
   ============================================================ */

/* ---------- DARK MODE (default) ---------- */
:root,
.dark {
  --gt-background: #0f1417;
  --gt-surface: #0f1417;
  --gt-surface-dim: #0f1417;
  --gt-surface-bright: #353a3d;
  --gt-surface-container-lowest: #0a0f12;
  --gt-surface-container-low: #171c1f;
  --gt-surface-container: #1b2023;
  --gt-surface-container-high: #262b2e;
  --gt-surface-container-highest: #313539;
  --gt-surface-variant: #313539;
  --gt-on-surface: #dfe3e7;
  --gt-on-surface-variant: #e0c0b1;
  --gt-on-background: #dfe3e7;
  --gt-outline: #a78b7d;
  --gt-outline-variant: #584237;
  --gt-primary: #ffb690;
  --gt-on-primary: #552100;
  --gt-primary-container: #f97316;
  --gt-on-primary-container: #582200;
  --gt-primary-fixed: #ffdbca;
  --gt-primary-fixed-dim: #ffb690;
  --gt-secondary: #c2c6db;
  --gt-on-secondary: #2b3040;
  --gt-secondary-container: #414658;
  --gt-on-secondary-container: #b0b4c9;
  --gt-tertiary: #b9c7e0;
  --gt-on-tertiary: #233144;
  --gt-tertiary-container: #8d9bb2;
  --gt-on-tertiary-container: #253346;
  --gt-error: #ffb4ab;
  --gt-on-error: #690005;
  --gt-error-container: #93000a;
  --gt-on-error-container: #ffdad6;
  --gt-inverse-surface: #dfe3e7;
  --gt-inverse-on-surface: #2c3134;
  --gt-inverse-primary: #9d4300;
  --gt-secondary-fixed: #dee1f7;
  --gt-secondary-fixed-dim: #c2c6db;
  --gt-tertiary-fixed: #d5e3fd;
  --gt-tertiary-fixed-dim: #b9c7e0;
  --gt-on-primary-fixed: #341100;
  --gt-on-primary-fixed-variant: #783200;
  --gt-on-secondary-fixed: #161b2b;
  --gt-on-secondary-fixed-variant: #414658;
  --gt-on-tertiary-fixed: #0d1c2f;
  --gt-on-tertiary-fixed-variant: #3a485c;
  --gt-surface-tint: #ffb690;

  /* Component-specific */
  --gt-card-bg: #161c2d;
  --gt-card-border: #334155;
  --gt-card-accent: #f97316;
  --gt-input-bg: #0a0f1e;
  --gt-input-border: #334155;
  --gt-btn-primary-bg: #f97316;
  --gt-btn-primary-text: #0a0f1e;
  --gt-btn-ghost-border: #f1f5f9;
  --gt-btn-ghost-text: #f1f5f9;
  --gt-btn-ghost-hover-bg: #f1f5f9;
  --gt-btn-ghost-hover-text: #0a0f1e;
  --gt-text-muted: #94a3b8;
  --gt-hero-overlay-from: transparent;
  --gt-hero-overlay-via: rgba(15, 20, 23, 0.5);
  --gt-hero-overlay-to: #0f1417;
  --gt-nav-bg: rgba(15, 20, 23, 0.8);
  --gt-badge-glow: rgba(249, 115, 22, 0.1);
}

/* ---------- LIGHT MODE ---------- */
.light {
  --gt-background: #f8f9ff;
  --gt-surface: #f8f9ff;
  --gt-surface-dim: #cbdbf5;
  --gt-surface-bright: #f8f9ff;
  --gt-surface-container-lowest: #ffffff;
  --gt-surface-container-low: #eff4ff;
  --gt-surface-container: #e9eef9;
  --gt-surface-container-high: #e4e9f4;
  --gt-surface-container-highest: #dee3ee;
  --gt-surface-variant: #f4f0ef;
  --gt-on-surface: #191c20;
  --gt-on-surface-variant: #53433c;
  --gt-on-background: #191c20;
  --gt-outline: #8a756b;
  --gt-outline-variant: #d8c2b9;
  --gt-primary: #f97316;
  --gt-on-primary: #ffffff;
  --gt-primary-container: #f97316;
  --gt-on-primary-container: #582200;
  --gt-primary-fixed: #ffdbca;
  --gt-primary-fixed-dim: #ffb690;
  --gt-secondary: #595d70;
  --gt-on-secondary: #ffffff;
  --gt-secondary-container: #dee1f7;
  --gt-on-secondary-container: #161b2b;
  --gt-tertiary: #3a485c;
  --gt-on-tertiary: #ffffff;
  --gt-tertiary-container: #d5e3fd;
  --gt-on-tertiary-container: #031c34;
  --gt-error: #ba1a1a;
  --gt-on-error: #ffffff;
  --gt-error-container: #ffdad6;
  --gt-on-error-container: #410002;
  --gt-inverse-surface: #2e3135;
  --gt-inverse-on-surface: #eff0f4;
  --gt-inverse-primary: #ffb690;
  --gt-secondary-fixed: #dee1f7;
  --gt-secondary-fixed-dim: #c2c6db;
  --gt-tertiary-fixed: #d5e3fd;
  --gt-tertiary-fixed-dim: #b9c7e0;
  --gt-on-primary-fixed: #341100;
  --gt-on-primary-fixed-variant: #783200;
  --gt-on-secondary-fixed: #161b2b;
  --gt-on-secondary-fixed-variant: #414658;
  --gt-on-tertiary-fixed: #0d1c2f;
  --gt-on-tertiary-fixed-variant: #3a485c;
  --gt-surface-tint: #9d4300;

  /* Component-specific */
  --gt-card-bg: #ffffff;
  --gt-card-border: #e2e8f0;
  --gt-card-accent: #f97316;
  --gt-input-bg: #ffffff;
  --gt-input-border: #e2e8f0;
  --gt-btn-primary-bg: #f97316;
  --gt-btn-primary-text: #ffffff;
  --gt-btn-ghost-border: #0f172a;
  --gt-btn-ghost-text: #0f172a;
  --gt-btn-ghost-hover-bg: #0f172a;
  --gt-btn-ghost-hover-text: #ffffff;
  --gt-text-muted: #64748b;
  --gt-hero-overlay-from: transparent;
  --gt-hero-overlay-via: rgba(248, 249, 255, 0.5);
  --gt-hero-overlay-to: #f8f9ff;
  --gt-nav-bg: rgba(255, 255, 255, 0.8);
  --gt-badge-glow: rgba(249, 115, 22, 0.08);
}

/* ---------- Shared component styles ---------- */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.material-symbols-outlined.fill,
.material-symbols-outlined[data-weight="fill"] {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

body {
  -webkit-font-smoothing: antialiased;
}

/* Industrial Card */
.industrial-card {
  background-color: var(--gt-card-bg);
  border: 1px solid var(--gt-card-border);
  border-top: 2px solid var(--gt-card-accent);
  transition: all 0.3s ease;
}
.industrial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(249, 115, 22, 0.15),
              0 8px 10px -6px rgba(0, 0, 0, 0.25);
}

/* Primary Button */
.btn-primary {
  background-color: var(--gt-btn-primary-bg);
  color: var(--gt-btn-primary-text);
  transition: all 0.3s ease;
}
.btn-primary:hover {
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.4);
  transform: scale(1.02);
}

/* Ghost / Secondary Button */
.btn-ghost {
  border: 2px solid var(--gt-btn-ghost-border);
  color: var(--gt-btn-ghost-text);
  transition: all 0.3s ease;
}
.btn-ghost:hover {
  background-color: var(--gt-btn-ghost-hover-bg);
  color: var(--gt-btn-ghost-hover-text);
}

/* Tech Badge */
.tech-badge {
  border: 1px solid var(--gt-card-border);
  transition: all 0.3s ease;
}
.tech-badge:hover {
  border-color: #f97316;
  color: #f97316;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.1);
}

/* Input fields */
.gt-input {
  background-color: var(--gt-input-bg);
  border: 1px solid var(--gt-outline-variant);
  color: var(--gt-on-surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.gt-input:focus {
  border-color: var(--gt-primary-container);
  outline: none;
  box-shadow: 0 0 0 1px var(--gt-primary-container);
}

/* Glass card (premium configurator) */
.glass-card {
  background: rgba(27, 32, 35, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(88, 66, 55, 0.3);
}
.light .glass-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(216, 194, 185, 0.5);
}

.glass-panel {
  background: rgba(27, 32, 35, 0.4);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(167, 139, 125, 0.1);
}
.light .glass-panel {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(216, 194, 185, 0.4);
}

/* Active selection glow */
.active-selection {
  background: rgba(249, 115, 22, 0.08);
  border-color: #f97316 !important;
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.15);
}
.active-glow {
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.3);
}

/* Hero pattern (dot grid) */
.hero-pattern {
  background-image: radial-gradient(var(--gt-card-border) 1px, transparent 1px),
                    radial-gradient(var(--gt-card-border) 1px, transparent 1px);
  background-position: 0 0, 20px 20px;
  background-size: 40px 40px;
  opacity: 0.1;
}
.light .hero-pattern { opacity: 0.5; }

/* Stepper line */
.stepper-line {
  height: 2px;
  background: var(--gt-surface-container-highest);
  flex-grow: 1;
  margin: 0 12px;
}
.stepper-line.active { background: #f97316; }

/* Premium shadow */
.premium-shadow { box-shadow: 0 20px 50px rgba(0,0,0,0.3); }

/* Custom scrollbar */
.dark ::-webkit-scrollbar { width: 8px; }
.dark ::-webkit-scrollbar-track { background: #0f1417; }
.dark ::-webkit-scrollbar-thumb { background: #313539; border-radius: 4px; }
.dark ::-webkit-scrollbar-thumb:hover { background: #584237; }

/* Animations */
.step-transition { transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); }

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Success check animation */
.check-anim {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: draw 1s ease-in-out forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.pulse-ring {
  animation: pulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}
@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.5; }
  50% { transform: scale(1.05); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}

@keyframes pulse-orange {
  0% { border-color: var(--gt-outline-variant); }
  50% { border-color: #f97316; }
  100% { border-color: var(--gt-outline-variant); }
}
.animate-pulse-orange {
  animation: pulse-orange 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Configurator step visibility */
.config-step { display: none; }
.config-step.active { display: flex; }

/* Smooth theme transition */
* { transition-property: background-color, border-color, color; transition-duration: 0.2s; }
