:root {
  /* Primitive Color Tokens */
  --color-white: rgba(255, 255, 255, 1);
  --color-black: rgba(0, 0, 0, 1);
  --color-cream-50: rgba(252, 252, 249, 1);
  --color-cream-100: rgba(255, 255, 253, 1);
  --color-gray-200: rgba(245, 245, 245, 1);
  --color-gray-300: rgba(167, 169, 169, 1);
  --color-gray-400: rgba(119, 124, 124, 1);
  --color-slate-500: rgba(98, 108, 113, 1);
  --color-brown-600: rgba(94, 82, 64, 1);
  --color-charcoal-700: rgba(31, 33, 33, 1);
  --color-charcoal-800: rgba(38, 40, 40, 1);
  --color-slate-900: rgba(19, 52, 59, 1);
  --color-teal-300: rgba(50, 184, 198, 1);
  --color-teal-400: rgba(45, 166, 178, 1);
  --color-teal-500: rgba(33, 128, 141, 1);
  --color-teal-600: rgba(29, 116, 128, 1);
  --color-teal-700: rgba(26, 104, 115, 1);
  --color-teal-800: rgba(41, 150, 161, 1);
  --color-red-400: rgba(255, 84, 89, 1);
  --color-red-500: rgba(192, 21, 47, 1);
  --color-orange-400: rgba(230, 129, 97, 1);
  --color-orange-500: rgba(168, 75, 47, 1);

  /* RGB versions for opacity control */
  --color-brown-600-rgb: 94, 82, 64;
  --color-teal-500-rgb: 33, 128, 141;
  --color-slate-900-rgb: 19, 52, 59;
  --color-slate-500-rgb: 98, 108, 113;
  --color-red-500-rgb: 192, 21, 47;
  --color-red-400-rgb: 255, 84, 89;
  --color-orange-500-rgb: 168, 75, 47;
  --color-orange-400-rgb: 230, 129, 97;

  /* Background color tokens (Light Mode) */
  --color-bg-1: rgba(59, 130, 246, 0.08); /* Light blue */
  --color-bg-2: rgba(245, 158, 11, 0.08); /* Light yellow */
  --color-bg-3: rgba(34, 197, 94, 0.08); /* Light green */
  --color-bg-4: rgba(239, 68, 68, 0.08); /* Light red */
  --color-bg-5: rgba(147, 51, 234, 0.08); /* Light purple */
  --color-bg-6: rgba(249, 115, 22, 0.08); /* Light orange */
  --color-bg-7: rgba(236, 72, 153, 0.08); /* Light pink */
  --color-bg-8: rgba(6, 182, 212, 0.08); /* Light cyan */

  /* Semantic Color Tokens (Light Mode) */
  --color-background: var(--color-cream-50);
  --color-surface: var(--color-cream-100);
  --color-text: var(--color-slate-900);
  --color-text-secondary: var(--color-slate-500);
  --color-primary: var(--color-teal-500);
  --color-primary-hover: var(--color-teal-600);
  --color-primary-active: var(--color-teal-700);
  --color-secondary: rgba(var(--color-brown-600-rgb), 0.12);
  --color-secondary-hover: rgba(var(--color-brown-600-rgb), 0.2);
  --color-secondary-active: rgba(var(--color-brown-600-rgb), 0.25);
  --color-border: rgba(var(--color-brown-600-rgb), 0.2);
  --color-btn-primary-text: var(--color-cream-50);
  --color-card-border: rgba(var(--color-brown-600-rgb), 0.12);
  --color-card-border-inner: rgba(var(--color-brown-600-rgb), 0.12);
  --color-error: var(--color-red-500);
  --color-success: var(--color-teal-500);
  --color-warning: var(--color-orange-500);
  --color-info: var(--color-slate-500);
  --color-focus-ring: rgba(var(--color-teal-500-rgb), 0.4);
  --color-select-caret: rgba(var(--color-slate-900-rgb), 0.8);

  /* Common style patterns */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.15;
  --status-border-opacity: 0.25;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* RGB versions for opacity control */
  --color-success-rgb: 33, 128, 141;
  --color-error-rgb: 192, 21, 47;
  --color-warning-rgb: 168, 75, 47;
  --color-info-rgb: 98, 108, 113;

  /* Typography */
  --font-family-base: "FKGroteskNeue", "Geist", "Inter", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-mono: "Berkeley Mono", ui-monospace, SFMono-Regular, Menlo,
    Monaco, Consolas, monospace;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  --font-size-3xl: 24px;
  --font-size-4xl: 30px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 550;
  --font-weight-bold: 600;
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --letter-spacing-tight: -0.01em;

  /* Spacing */
  --space-0: 0;
  --space-1: 1px;
  --space-2: 2px;
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-10: 10px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-48: 48px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-base: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04),
    0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04),
    0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.03);

  /* Animation */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
}

/* Dark mode colors */
@media (prefers-color-scheme: dark) {
  :root {
    /* RGB versions for opacity control (Dark Mode) */
    --color-gray-400-rgb: 119, 124, 124;
    --color-teal-300-rgb: 50, 184, 198;
    --color-gray-300-rgb: 167, 169, 169;
    --color-gray-200-rgb: 245, 245, 245;

    /* Background color tokens (Dark Mode) */
    --color-bg-1: rgba(29, 78, 216, 0.15); /* Dark blue */
    --color-bg-2: rgba(180, 83, 9, 0.15); /* Dark yellow */
    --color-bg-3: rgba(21, 128, 61, 0.15); /* Dark green */
    --color-bg-4: rgba(185, 28, 28, 0.15); /* Dark red */
    --color-bg-5: rgba(107, 33, 168, 0.15); /* Dark purple */
    --color-bg-6: rgba(194, 65, 12, 0.15); /* Dark orange */
    --color-bg-7: rgba(190, 24, 93, 0.15); /* Dark pink */
    --color-bg-8: rgba(8, 145, 178, 0.15); /* Dark cyan */

    /* Semantic Color Tokens (Dark Mode) */
    --color-background: var(--color-charcoal-700);
    --color-surface: var(--color-charcoal-800);
    --color-text: var(--color-gray-200);
    --color-text-secondary: rgba(var(--color-gray-300-rgb), 0.7);
    --color-primary: var(--color-teal-300);
    --color-primary-hover: var(--color-teal-400);
    --color-primary-active: var(--color-teal-800);
    --color-secondary: rgba(var(--color-gray-400-rgb), 0.15);
    --color-secondary-hover: rgba(var(--color-gray-400-rgb), 0.25);
    --color-secondary-active: rgba(var(--color-gray-400-rgb), 0.3);
    --color-border: rgba(var(--color-gray-400-rgb), 0.3);
    --color-error: var(--color-red-400);
    --color-success: var(--color-teal-300);
    --color-warning: var(--color-orange-400);
    --color-info: var(--color-gray-300);
    --color-focus-ring: rgba(var(--color-teal-300-rgb), 0.4);
    --color-btn-primary-text: var(--color-slate-900);
    --color-card-border: rgba(var(--color-gray-400-rgb), 0.2);
    --color-card-border-inner: rgba(var(--color-gray-400-rgb), 0.15);
    --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1),
      inset 0 -1px 0 rgba(0, 0, 0, 0.15);
    --button-border-secondary: rgba(var(--color-gray-400-rgb), 0.2);
    --color-border-secondary: rgba(var(--color-gray-400-rgb), 0.2);
    --color-select-caret: rgba(var(--color-gray-200-rgb), 0.8);

    /* Common style patterns - updated for dark mode */
    --focus-ring: 0 0 0 3px var(--color-focus-ring);
    --focus-outline: 2px solid var(--color-primary);
    --status-bg-opacity: 0.15;
    --status-border-opacity: 0.25;
    --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

    /* RGB versions for dark mode */
    --color-success-rgb: var(--color-teal-300-rgb);
    --color-error-rgb: var(--color-red-400-rgb);
    --color-warning-rgb: var(--color-orange-400-rgb);
    --color-info-rgb: var(--color-gray-300-rgb);
  }
}

/* Data attribute for manual theme switching */
[data-color-scheme="dark"] {
  /* RGB versions for opacity control (dark mode) */
  --color-gray-400-rgb: 119, 124, 124;
  --color-teal-300-rgb: 50, 184, 198;
  --color-gray-300-rgb: 167, 169, 169;
  --color-gray-200-rgb: 245, 245, 245;

  /* Colorful background palette - Dark Mode */
  --color-bg-1: rgba(29, 78, 216, 0.15); /* Dark blue */
  --color-bg-2: rgba(180, 83, 9, 0.15); /* Dark yellow */
  --color-bg-3: rgba(21, 128, 61, 0.15); /* Dark green */
  --color-bg-4: rgba(185, 28, 28, 0.15); /* Dark red */
  --color-bg-5: rgba(107, 33, 168, 0.15); /* Dark purple */
  --color-bg-6: rgba(194, 65, 12, 0.15); /* Dark orange */
  --color-bg-7: rgba(190, 24, 93, 0.15); /* Dark pink */
  --color-bg-8: rgba(8, 145, 178, 0.15); /* Dark cyan */

  /* Semantic Color Tokens (Dark Mode) */
  --color-background: var(--color-charcoal-700);
  --color-surface: var(--color-charcoal-800);
  --color-text: var(--color-gray-200);
  --color-text-secondary: rgba(var(--color-gray-300-rgb), 0.7);
  --color-primary: var(--color-teal-300);
  --color-primary-hover: var(--color-teal-400);
  --color-primary-active: var(--color-teal-800);
  --color-secondary: rgba(var(--color-gray-400-rgb), 0.15);
  --color-secondary-hover: rgba(var(--color-gray-400-rgb), 0.25);
  --color-secondary-active: rgba(var(--color-gray-400-rgb), 0.3);
  --color-border: rgba(var(--color-gray-400-rgb), 0.3);
  --color-error: var(--color-red-400);
  --color-success: var(--color-teal-300);
  --color-warning: var(--color-orange-400);
  --color-info: var(--color-gray-300);
  --color-focus-ring: rgba(var(--color-teal-300-rgb), 0.4);
  --color-btn-primary-text: var(--color-slate-900);
  --color-card-border: rgba(var(--color-gray-400-rgb), 0.15);
  --color-card-border-inner: rgba(var(--color-gray-400-rgb), 0.15);
  --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  --color-border-secondary: rgba(var(--color-gray-400-rgb), 0.2);
  --color-select-caret: rgba(var(--color-gray-200-rgb), 0.8);

  /* Common style patterns - updated for dark mode */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.15;
  --status-border-opacity: 0.25;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* RGB versions for dark mode */
  --color-success-rgb: var(--color-teal-300-rgb);
  --color-error-rgb: var(--color-red-400-rgb);
  --color-warning-rgb: var(--color-orange-400-rgb);
  --color-info-rgb: var(--color-gray-300-rgb);
}

[data-color-scheme="light"] {
  /* RGB versions for opacity control (light mode) */
  --color-brown-600-rgb: 94, 82, 64;
  --color-teal-500-rgb: 33, 128, 141;
  --color-slate-900-rgb: 19, 52, 59;

  /* Semantic Color Tokens (Light Mode) */
  --color-background: var(--color-cream-50);
  --color-surface: var(--color-cream-100);
  --color-text: var(--color-slate-900);
  --color-text-secondary: var(--color-slate-500);
  --color-primary: var(--color-teal-500);
  --color-primary-hover: var(--color-teal-600);
  --color-primary-active: var(--color-teal-700);
  --color-secondary: rgba(var(--color-brown-600-rgb), 0.12);
  --color-secondary-hover: rgba(var(--color-brown-600-rgb), 0.2);
  --color-secondary-active: rgba(var(--color-brown-600-rgb), 0.25);
  --color-border: rgba(var(--color-brown-600-rgb), 0.2);
  --color-btn-primary-text: var(--color-cream-50);
  --color-card-border: rgba(var(--color-brown-600-rgb), 0.12);
  --color-card-border-inner: rgba(var(--color-brown-600-rgb), 0.12);
  --color-error: var(--color-red-500);
  --color-success: var(--color-teal-500);
  --color-warning: var(--color-orange-500);
  --color-info: var(--color-slate-500);
  --color-focus-ring: rgba(var(--color-teal-500-rgb), 0.4);

  /* RGB versions for light mode */
  --color-success-rgb: var(--color-teal-500-rgb);
  --color-error-rgb: var(--color-red-500-rgb);
  --color-warning-rgb: var(--color-orange-500-rgb);
  --color-info-rgb: var(--color-slate-500-rgb);
}

/* Base styles */
html {
  font-size: var(--font-size-base);
  font-family: var(--font-family-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
  letter-spacing: var(--letter-spacing-tight);
}

h1 {
  font-size: var(--font-size-4xl);
}
h2 {
  font-size: var(--font-size-3xl);
}
h3 {
  font-size: var(--font-size-2xl);
}
h4 {
  font-size: var(--font-size-xl);
}
h5 {
  font-size: var(--font-size-lg);
}
h6 {
  font-size: var(--font-size-md);
}

p {
  margin: 0 0 var(--space-16) 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}

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

code,
pre {
  font-family: var(--font-family-mono);
  font-size: calc(var(--font-size-base) * 0.95);
  background-color: var(--color-secondary);
  border-radius: var(--radius-sm);
}

code {
  padding: var(--space-1) var(--space-4);
}

pre {
  padding: var(--space-16);
  margin: var(--space-16) 0;
  overflow: auto;
  border: 1px solid var(--color-border);
}

pre code {
  background: none;
  padding: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-base);
  font-size: var(--font-size-base);
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-standard);
  border: none;
  text-decoration: none;
  position: relative;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

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

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

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

.btn--secondary {
  background: var(--color-secondary);
  color: var(--color-text);
}

.btn--secondary:hover {
  background: var(--color-secondary-hover);
}

.btn--secondary:active {
  background: var(--color-secondary-active);
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn--outline:hover {
  background: var(--color-secondary);
}

.btn--sm {
  padding: var(--space-4) var(--space-12);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
}

.btn--lg {
  padding: var(--space-10) var(--space-20);
  font-size: var(--font-size-lg);
  border-radius: var(--radius-md);
}

.btn--full-width {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Form elements */
.form-control {
  display: block;
  width: 100%;
  padding: var(--space-8) var(--space-12);
  font-size: var(--font-size-md);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  transition: border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

textarea.form-control {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
}

select.form-control {
  padding: var(--space-8) var(--space-12);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: var(--select-caret-light);
  background-repeat: no-repeat;
  background-position: right var(--space-12) center;
  background-size: 16px;
  padding-right: var(--space-32);
}

/* Add a dark mode specific caret */
@media (prefers-color-scheme: dark) {
  select.form-control {
    background-image: var(--select-caret-dark);
  }
}

/* Also handle data-color-scheme */
[data-color-scheme="dark"] select.form-control {
  background-image: var(--select-caret-dark);
}

[data-color-scheme="light"] select.form-control {
  background-image: var(--select-caret-light);
}

.form-control:focus {
  border-color: var(--color-primary);
  outline: var(--focus-outline);
}

.form-label {
  display: block;
  margin-bottom: var(--space-8);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.form-group {
  margin-bottom: var(--space-16);
}

/* Card component */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-card-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--duration-normal) var(--ease-standard);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card__body {
  padding: var(--space-16);
}

.card__header,
.card__footer {
  padding: var(--space-16);
  border-bottom: 1px solid var(--color-card-border-inner);
}

/* Status indicators - simplified with CSS variables */
.status {
  display: inline-flex;
  align-items: center;
  padding: var(--space-6) var(--space-12);
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.status--success {
  background-color: rgba(
    var(--color-success-rgb, 33, 128, 141),
    var(--status-bg-opacity)
  );
  color: var(--color-success);
  border: 1px solid
    rgba(var(--color-success-rgb, 33, 128, 141), var(--status-border-opacity));
}

.status--error {
  background-color: rgba(
    var(--color-error-rgb, 192, 21, 47),
    var(--status-bg-opacity)
  );
  color: var(--color-error);
  border: 1px solid
    rgba(var(--color-error-rgb, 192, 21, 47), var(--status-border-opacity));
}

.status--warning {
  background-color: rgba(
    var(--color-warning-rgb, 168, 75, 47),
    var(--status-bg-opacity)
  );
  color: var(--color-warning);
  border: 1px solid
    rgba(var(--color-warning-rgb, 168, 75, 47), var(--status-border-opacity));
}

.status--info {
  background-color: rgba(
    var(--color-info-rgb, 98, 108, 113),
    var(--status-bg-opacity)
  );
  color: var(--color-info);
  border: 1px solid
    rgba(var(--color-info-rgb, 98, 108, 113), var(--status-border-opacity));
}

/* Container layout */
.container {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--space-16);
  padding-left: var(--space-16);
}

@media (min-width: 640px) {
  .container {
    max-width: var(--container-sm);
  }
}
@media (min-width: 768px) {
  .container {
    max-width: var(--container-md);
  }
}
@media (min-width: 1024px) {
  .container {
    max-width: var(--container-lg);
  }
}
@media (min-width: 1280px) {
  .container {
    max-width: var(--container-xl);
  }
}

/* Utility classes */
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-4 {
  gap: var(--space-4);
}
.gap-8 {
  gap: var(--space-8);
}
.gap-16 {
  gap: var(--space-16);
}

.m-0 {
  margin: 0;
}
.mt-8 {
  margin-top: var(--space-8);
}
.mb-8 {
  margin-bottom: var(--space-8);
}
.mx-8 {
  margin-left: var(--space-8);
  margin-right: var(--space-8);
}
.my-8 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
}

.p-0 {
  padding: 0;
}
.py-8 {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}
.px-8 {
  padding-left: var(--space-8);
  padding-right: var(--space-8);
}
.py-16 {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}
.px-16 {
  padding-left: var(--space-16);
  padding-right: var(--space-16);
}

.block {
  display: block;
}
.hidden {
  display: none;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

/* Dark mode specifics */
[data-color-scheme="dark"] .btn--outline {
  border: 1px solid var(--color-border-secondary);
}

@font-face {
  font-family: 'FKGroteskNeue';
  src: url('https://r2cdn.perplexity.ai/fonts/FKGroteskNeue.woff2')
    format('woff2');
    font-display: swap;

}

/* END PERPLEXITY DESIGN SYSTEM */
/* Custom Domotech S.r.l Colors */
:root {
  --color-primary: #1e3a8a;
  --color-primary-hover: #1e40af;
  --color-primary-active: #1d4ed8;
  --color-secondary: #f97316;
  --color-secondary-hover: #ea580c;
  --color-secondary-active: #dc2626;
  --color-accent: #fbbf24;
}

/* Single Page Application - Hide all sections except active */
.section {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease-out;
}

.section--active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Logo styling */
.nav__logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  margin-right: var(--space-12);
}

.nav__brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--color-text);
}

.brand-text {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
}

/* Header and Navigation */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  transition: all var(--duration-normal) var(--ease-standard);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-12) 0;
}

.nav__links {
  display: flex;
  gap: var(--space-24);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__link {
  color: var(--color-text);
  font-weight: var(--font-weight-medium);
  transition: color var(--duration-fast) var(--ease-standard);
  cursor: pointer;
  border: none;
  background: none;
  font-size: var(--font-size-base);
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-base);
}

.nav__link:hover, .nav__link.active {
  color: var(--color-primary);
  background: rgba(30, 58, 138, 0.1);
}

.nav__toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-8);
}

.nav__toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-text);
  margin: 2px 0;
  transition: all var(--duration-fast) var(--ease-standard);
}

/* Hero Carousel */
.hero-carousel {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.carousel-container {
  position: relative;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.carousel-slide.active {
  opacity: 1;
}

.carousel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(30, 58, 138, 0.7),
    rgba(249, 115, 22, 0.5)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.carousel-title {
  font-size: clamp(var(--font-size-4xl), 8vw, 72px);
  color: white;
  margin-bottom: var(--space-16);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  font-weight: var(--font-weight-bold);
}

.carousel-subtitle {
  font-size: var(--font-size-2xl);
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  opacity: 0.9;
}

/* Carousel Controls */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid white;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: var(--font-size-3xl);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.carousel-btn--prev {
  left: var(--space-32);
}

.carousel-btn--next {
  right: var(--space-32);
}

.carousel-dots {
  position: absolute;
  bottom: var(--space-32);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-12);
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
  background: transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
}

.carousel-dot.active,
.carousel-dot:hover {
  background: white;
}

/* Call to Action Section */
.cta-section {
  padding: var(--space-32) 0;
  background: var(--color-bg-1);
  text-align: center;
}

.cta-section h2 {
  margin-bottom: var(--space-16);
  color: var(--color-primary);
}

.cta-section h1 {
  margin-bottom: var(--space-16);
  color: var(--color-primary);
}

.cta-section p {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-32);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  gap: var(--space-16);
  justify-content: center;
  flex-wrap: wrap;
}

/* Button Updates */
.btn--primary {
  background: var(--color-primary);
  color: white;
}

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

.btn--outline {
  background: transparent;
  border: 2px solid var(--color-secondary);
  color: var(--color-secondary);
}

.btn--outline:hover {
  background: var(--color-secondary);
  color: white;
}

/* Section Styles */
.section__title {
  text-align: center;
  margin-bottom: var(--space-48);
  position: relative;
  color: var(--color-primary);
  padding-top: 50px;
}

.section__title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 3px;
  background: var(--color-secondary);
  border-radius: var(--radius-full);
}


* ========================================
STATS SECTION - NUMERI CHE PARLANO
======================================== */

.stats-section {
    padding: var(--space-48) var(--space-20);
    background: linear-gradient(135deg, var(--color-background) 0%, var(--color-surface) 100%);
    position: relative;
    overflow: hidden;
    display: none;
    margin-bottom: var(--space-48);
}

.stats-section.visible {
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    animation: fadeInStats 0.6s ease forwards;
}

@keyframes fadeInStats {
    to {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}


/* Grid Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-32);
    max-width: 1200px;
    margin: 0 auto;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-24);
    text-align: center;
    transition: all var(--duration-normal) var(--ease-standard);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-16);
    position: relative;
    overflow: hidden;
}

/* Hover Effect */
.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

/* Animazione background al hover */
.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(33, 128, 141, 0.1), transparent);
    transition: left var(--duration-normal) var(--ease-standard);
    z-index: 0;
}

.stat-card:hover::before {
    left: 100%;
}

/* Icon Wrapper */
.stat-icon-wrapper {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-teal-600));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 15px rgba(33, 128, 141, 0.2);
}

.stat-icon {
    width: 40px;
    height: 40px;
    color: var(--color-white);
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Content */
.stat-content {
    position: relative;
    z-index: 1;
}

.stat-number {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    margin: 0;
    line-height: 1;
    transition: color var(--duration-normal) var(--ease-standard));
}

.stat-number::after {
  content: '+';
}

.stat-card:hover .stat-number {
    color: var(--color-primary-hover);
}

.stat-label {
    font-size: var(--font-size-md);
    color: var(--color-text-secondary);
    margin: var(--space-8) 0 0 0;
    font-weight: var(--font-weight-medium);
}

/* Responsive */
@media (max-width: 768px) {
    .stats-section {
        padding: var(--space-32) var(--space-16);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-24);
    }

    .stat-card {
        padding: var(--space-24);
    }

    .stat-icon-wrapper {
        width: 70px;
        height: 70px;
    }

    .stat-icon {
        width: 35px;
        height: 35px;
    }

    .stat-number {
        font-size: var(--font-size-3xl);
    }

    .stats-title {
        font-size: var(--font-size-3xl);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-20);
    }

    .stat-card {
        padding: var(--space-20);
    }

    .stat-icon-wrapper {
        width: 60px;
        height: 60px;
    }

    .stat-icon {
        width: 30px;
        height: 30px;
    }

    .stat-number {
        font-size: var(--font-size-2xl);
    }
}


/* About Section */
#about {
  padding: var(--space-32) 0;
  background: var(--color-bg-2);
}

.about__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-32);
  align-items: start;
}

.about__text p {
  font-size: var(--font-size-lg);
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-16);
}

.team__grid {
  display: grid;
  gap: var(--space-24);
}

.team__member {
  text-align: center;
  transition: transform var(--duration-normal) var(--ease-standard);
}

.team__member:hover {
  transform: translateY(-4px);
}

.team__photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin: 24px auto var(--space-16);
  border: 4px solid var(--color-primary);
  box-shadow: var(--shadow-lg);
}

.team__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.team__member h3 {
  color: var(--color-primary);
  margin-bottom: var(--space-8);
}

.team__role {
  color: var(--color-secondary);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: var(--space-12);
}

.team__member p {
  font-size: var(--font-size-sm);
  line-height: 1.5;
  color: var(--color-text-secondary);
}

/* Services Section */
#services {
  padding-top: 100px; 
  margin-top: -50px; 
  box-sizing: border-box;
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-24);
}

.service__item {
  height: 100%;
  transition: transform var(--duration-normal) var(--ease-standard);
}

.service__item:hover {
  transform: translateY(-4px);
}

.service__item h3 {
  color: var(--color-primary);
  margin-bottom: var(--space-16);
}

.service__item ul {
  list-style: none;
  padding: 0;
  margin: var(--space-16) 0 0;
}

.service__item li {
  padding: var(--space-8) 0;
  border-bottom: 1px solid var(--color-border);
  position: relative;
  padding-left: var(--space-20);
}

.service__item li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-secondary);
  font-weight: bold;
}

.service__item li:last-child {
  border-bottom: none;
}

/* I Nostri Lavori Section */
#portfolio {
  padding: var(--space-32) 0;
  background: var(--color-surface);
}

.portfolio__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-20);
}

.portfolio__item {
  overflow: hidden;
  transition: transform var(--duration-normal) var(--ease-standard);
}

.portfolio__item:hover {
  transform: translateY(-4px);
}

.portfolio__image {
  aspect-ratio: 4/3;
  overflow: hidden;
}

.portfolio__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-normal) var(--ease-standard);
}

.portfolio__item:hover .portfolio__image img {
  transform: scale(1.05);
}

.portfolio__item h3 {
  color: var(--color-primary);
  margin-bottom: var(--space-8);
  font-size: var(--font-size-lg);
}

.portfolio__item p {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.portfolio__item .status {
  margin-top: var(--space-12);
}

/* Reviews Section */
#reviews {
  padding: var(--space-32) 0;
  background: var(--color-bg-4);
}

.reviews__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-20);
}

.review__item {
  transition: transform var(--duration-normal) var(--ease-standard);
  height: 100%;
}

.review__item:hover {
  transform: translateY(-4px);
}

.review__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-12);
  flex-wrap: wrap;
}

.review__header h4 {
  color: var(--color-primary);
  margin-bottom: var(--space-4);
  flex: 1;
  min-width: 120px;
  font-size: var(--font-size-md);
}

.review__stars {
  color: var(--color-secondary);
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-4);
  margin-left: var(--space-8);
}

.review__location {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-style: italic;
  width: 100%;
  margin-top: var(--space-4);
}

.review__item p {
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
  font-size: var(--font-size-sm);
}

/* Contact Section */
#contact {
  padding: var(--space-32) 0;
  background: var(--color-bg-5);
}

.contact__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-32);
}

.contact__info h3 {
  color: var(--color-primary);
  margin-bottom: var(--space-24);
}

.contact__details p {
  margin-bottom: var(--space-16);
  line-height: 1.6;
}

.contact__details a {
  color: var(--color-secondary);
  font-weight: var(--font-weight-medium);
}

.contact__form {
  background: var(--color-surface);
  padding: var(--space-24);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.contact__form h3 {
  color: var(--color-primary);
  margin-bottom: var(--space-20);
  text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .nav__links {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background: white;
    flex-direction: column;
    padding: var(--space-24);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-normal) var(--ease-standard);
  }
  
  .nav__links--open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav__toggle {
    display: flex;
  }

  .carousel-btn {
    width: 50px;
    height: 50px;
    font-size: var(--font-size-xl);
  }

  .carousel-btn--prev {
    left: var(--space-16);
  }

  .carousel-btn--next {
    right: var(--space-16);
  }

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

  .about__content {
    grid-template-columns: 1fr;
    gap: var(--space-24);
  }

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

  .portfolio__grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

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

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

  .footer__content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .brand-text {
    font-size: var(--font-size-lg);
  }

  .nav__logo {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: var(--space-12);
    padding-right: var(--space-12);
  }

  .carousel-title {
    font-size: var(--font-size-3xl);
  }

  .carousel-subtitle {
    font-size: var(--font-size-lg);
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: var(--font-size-lg);
  }

  .carousel-btn--prev {
    left: var(--space-8);
  }

  .carousel-btn--next {
    right: var(--space-8);
  }

  .carousel-dots {
    bottom: var(--space-16);
  }

  .services__grid {
    gap: var(--space-16);
  }

  .portfolio__grid {
    grid-template-columns: 1fr;
    gap: var(--space-16);
  }

  .reviews__grid {
    gap: var(--space-16);
  }

  .contact__form {
    padding: var(--space-16);
  }

  .nav__logo {
    width: 35px;
    height: 35px;
  }

  .brand-text {
    font-size: var(--font-size-base);
  }

  .team__photo {
    width: 100px;
    height: 100px;
  }
}

/* Smooth scrolling and animations */
html {
  scroll-behavior: smooth;
}

/* Form success message */
.form-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #16a34a;
  padding: var(--space-12);
  border-radius: var(--radius-base);
  margin-bottom: var(--space-16);
  text-align: center;
}

/* Animation classes */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--duration-normal) var(--ease-standard);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile Navigation Toggle Animation */
.nav__toggle--open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav__toggle--open span:nth-child(2) {
  opacity: 0;
}

.nav__toggle--open span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Loading state */
body.loaded .section--active {
  animation: slideInUp 0.8s ease-out;
}

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

/* Enhanced form styles */
.form-message {
  padding: var(--space-12);
  border-radius: var(--radius-base);
  margin-bottom: var(--space-16);
  text-align: center;
  font-weight: var(--font-weight-medium);
}

.form-message--success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #16a34a;
}

.form-message--error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #dc2626;
}

/* Dark mode header adjustment */
@media (prefers-color-scheme: dark) {
  .header {
    background: rgba(31, 33, 33, 0.95);
  }
}

[data-color-scheme="dark"] .header {
  background: rgba(31, 33, 33, 0.95);
}

/* Accessibility improvements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus indicators */
.user-is-tabbing .nav__link:focus,
.user-is-tabbing .btn:focus,
.user-is-tabbing .form-control:focus,
.user-is-tabbing .carousel-btn:focus,
.user-is-tabbing .carousel-dot:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Enhanced carousel accessibility */
.carousel-slide[aria-hidden="true"] {
  visibility: hidden;
}

/* Improved team member layout for larger screens */
@media (min-width: 1024px) {
  .team__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-32);
  }
}

/* ========================================
   NEW SLIDESHOW STYLES
   ======================================== */

.pagination {
  position: absolute !important;
  width: 100%;
  text-align: center;
  right: 0;
  padding: 0 !important;
  bottom: 30px;
  z-index: 999;
}

.pagination__item {
  cursor: pointer;
  display: inline-block;
  white-space: nowrap;
  font-size: 0;
  width: 10px;
  height: 10px;
  border: 1px solid #fff;
  margin: 0 5px;
  transition: .2s ease-in-out;
}

.pagination__item.is-current,
.pagination__item:hover {
  background-color: #fff;
}

.background-absolute {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-position: center;
  background-size: cover;
}

.slideshow {
  position: relative;
  color: #fff;
  overflow: hidden;
  min-height: 600px;
  height: 60vh;
  margin-top: 80px; 
}
/* Posizionamento immagini come codice originale */
.slideshow__slide-image.background-absolute {
  width: 60%;
  left: 40%;
}

/* Allineamento testo a sinistra */
h2.slideshow__slide-caption-title {
  padding-left: 98px;
  padding-right: 98px;
  color: #1e3a8a; 
  font-weight: 700;
}

.o-hsub.-link {
  padding-left: 98px;
  padding-right: 98px;
  color: #000;
  text-decoration: none;
}

p.slideshow__slide-caption-content {
  padding-left: 98px;
  padding-right: 98px;
  box-sizing: border-box;
  color: rgba(0, 0, 0, 0.7);
  max-width: 40%;
  width: 40%;
  font-size: 14px;
  line-height: 28px;
  margin-top: 20px;
}

/* Responsive per mobile */
@media (max-width: 699px) {
  .slideshow__slide-image.background-absolute {
    width: 100%;
    left: 0;
  }
  
  h2.slideshow__slide-caption-title,
  .o-hsub.-link,
  p.slideshow__slide-caption-content {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  p.slideshow__slide-caption-content {
    max-width: 100%;
    width: 100%;
  }
}
.slideshow h3,
.slideshow h1,
.slideshow h2 {
  font-family: 'Lato', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5em;
  line-height: 2em;
}

.slideshow h1 {
  font-size: 44px;
  font-weight: 800;
}

.slideshow__slide {
  visibility: hidden;
  transition: visibility 0s 1.7s;
}

.slideshow__slide.is-current {
  visibility: visible;
  transition-delay: 0s;
}

.slideshow .slideshow__slide {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.slideshow__slide-background-load-wrap {
  transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translate3d(0, 100%, 0);
  overflow: hidden;
}

.is-animated .slideshow__slide-background-load-wrap {
  transform: translate3d(0, 0, 0);
  transition-delay: 0s;
}

.slideshow__slide.is-prev .slideshow__slide-background-parallax,
.slideshow__slide.is-next .slideshow__slide-background-parallax {
  transform: none !important;
}

.slideshow__slide-background-load {
  transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translate3d(0, -50%, 0);
}

.is-animated .slideshow__slide-background-load {
  transform: translate3d(0, 0, 0);
}

.slideshow__slide-background-wrap {
  transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.5s;
  transform: translate3d(0, 0, 0);
}

.slideshow__slide.is-prev .slideshow__slide-background-wrap {
  transform: translate3d(0, -100%, 0);
}

.slideshow__slide.is-next .slideshow__slide-background-wrap {
  transform: translate3d(0, 100%, 0);
}

.slideshow__slide-background {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1) 1.5s;
  transform: scale(1);
  overflow: hidden;
}

.slideshow__slide.is-prev .slideshow__slide-background,
.slideshow__slide.is-next .slideshow__slide-background {
  transform: scale(0.5);
  transition-delay: 0s;
}

.slideshow__slide-image-wrap {
  transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.6s;
  transform: translate3d(0, 0, 0);
}

.slideshow__slide.is-prev .slideshow__slide-image-wrap {
  transform: translate3d(0, 50%, 0);
}

.slideshow__slide-image {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1) 1.5s;
  transform: scale(1);
}

.slideshow__slide.is-prev .slideshow__slide-image,
.slideshow__slide.is-next .slideshow__slide-image {
  transform: scale(1.25);
  transition-delay: 0s;
}

.slideshow__slide-image::before,
.slideshow__slide-image::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: 0.35;
}

.slideshow__slide-image::before {
  background-color: rgba(255, 255, 255, 0.26);
}

.slideshow__slide-image::after {
  background: linear-gradient(to top, transparent 0%, #fff 20%);
}

.slideshow__slide-caption-text {
  position: relative;
  height: 100%;
  padding-top: 10%;
  transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.4s;
  transform: translate3d(0, 0, 0);
}

.slideshow__slide.is-prev .slideshow__slide-caption-text {
  transform: translate3d(-100%, -50%, 0);
}

.slideshow__slide.is-next .slideshow__slide-caption-text {
  transform: translate3d(-100%, 10%, 0);
}

.slideshow__slide-caption {
  position: relative;
  height: 100%;
  transform: translate3d(-100%, 10%, 0);
  transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

.is-animated .slideshow__slide-caption {
  transform: translate3d(0, 0, 0);
}

.slideshow__slide-caption-title {
  line-height: 1;
  font-size: clamp(1.5rem, 5vw, 3.5rem);
  margin-bottom: 1.25rem;
}

.slideshow__slide-caption-content {
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.6;
  max-width: 600px;
  margin-bottom: 2rem;
  opacity: 0.95;
}

.slideshow__slide-caption-subtitle {
  display: inline-block;
  padding: 1.875rem 0;
  transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1) 0.4s;
  transform: translate3d(0, 3.75rem, 0);
}

.is-animated .slideshow__slide-caption-subtitle.-load {
  transform: translate3d(0, 0, 0);
}

.o-hsub {
  font-size: 0.75rem;
  padding: 1.25rem 0;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  transition: all 0.3s ease;
}

.o-hsub::before {
  content: "";
  display: inline-block;
  vertical-align: middle;
  border-bottom: 1px solid;
  width: 1.5rem;
  background-color: #fff;
  margin-right: 1.125rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center left;
}

.o-hsub:hover::before {
  transform: scaleX(1.5);
}

.o-hsub_label,
.slideshow__slide-caption-subtitle-label {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateZ(0);
  display: inline-block;
}

.o-hsub:hover .o-hsub_label,
.o-hsub:hover .slideshow__slide-caption-subtitle-label {
  transform: translateX(20px);
}

/* Responsive adjustments */
@media (max-width: 699px) {
  .slideshow__slide-caption-title {
    font-size: 40px;
    margin-bottom: 100px;
  }
  
  .slideshow__slide-caption-content {
    font-size: 16px;
  }
}

@media (max-height: 500px) {
  .slideshow__slide-caption-title {
    margin-bottom: 0 !important;
  }
}

/* Logo fisso background sulla sinistra */
.slideshow__logo-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 65%; 
  height: 100%;
  z-index: 1; 
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none; 
  opacity: 0.15; 
}

.slideshow__logo-background img {
  width: 80%;
  height: auto;
  max-height: 70%;
  object-fit: contain;
}

/* Assicurati che le slide siano sopra */
.slideshow__slide {
  position: relative;
  z-index: 2;
}

.slideshow__slide-caption {
  position: relative;
  z-index: 3; /
}

/* Responsive per mobile */
@media (max-width: 699px) {
  .slideshow__logo-background {
    width: 70%;
    opacity: 0.1; 
  }
  
  .slideshow__logo-background img {
    width: 90%;
    max-height: 50%;
  }
}
/* ========================================
   SERVICES SECTION - MODERN GRID (VERSIONE FINALE)
   ======================================== */

.section-subtitle {
  text-align: center;
  font-size: 18px;
  color: var(--color-text-secondary);
  margin-top: -20px;
  margin-bottom: 50px;
  font-weight: 400;
}

.services-grid-modern {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 40px;
}

.service-card-modern {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.service-card-modern:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(30, 58, 138, 0.15);
}

.service-card-image {
  position: relative;
  width: 100%;
  height: 350px;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease; 
}

/* EFFETTO ZOOM AL HOVER */
.service-card-modern:hover .service-card-image {
  transform: scale(1.1);
}

.service-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* PATINA BLU RIMOSSA - solo ombra leggera per leggibilità titolo */
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0.3) 100%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.service-card-title {
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  /* TITOLO SEMPRE AL CENTRO */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
}

.service-card-btn {
  background: #fff;
  color: #1e3a8a;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  /* PULSANTE IN BASSO */
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  /* NASCOSTO PER DEFAULT */
  opacity: 0;
  pointer-events: none;
}

/* PULSANTE APPARE AL HOVER */
.service-card-modern:hover .service-card-btn {
  opacity: 1;
  pointer-events: auto;
}

.service-card-btn:hover {
  background: #1e3a8a;
  color: #fff;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.4);
  transform: translateX(-50%) translateY(-2px);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .services-grid-modern {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }
  
  .service-card-image {
    height: 300px;
  }
  
  .service-card-title {
    font-size: 22px;
  }
}

@media (max-width: 699px) {
  .services-grid-modern {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .service-card-image {
    height: 280px;
  }
  
  .service-card-title {
    font-size: 20px;
  }
  
  .service-card-btn {
    font-size: 11px;
    padding: 7px 18px;
    bottom: 15px;
    /* Su mobile il pulsante è sempre visibile */
    opacity: 1;
    pointer-events: auto;
  }
  
  .section-subtitle {
    font-size: 16px;
    margin-bottom: 30px;
  }
}

/* Animation on scroll */
.service-card-modern {
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

.service-card-modern:nth-child(1) { animation-delay: 0.1s; }
.service-card-modern:nth-child(2) { animation-delay: 0.2s; }
.service-card-modern:nth-child(3) { animation-delay: 0.3s; }
.service-card-modern:nth-child(4) { animation-delay: 0.4s; }
.service-card-modern:nth-child(5) { animation-delay: 0.5s; }
.service-card-modern:nth-child(6) { animation-delay: 0.6s; }
.service-card-modern:nth-child(7) { animation-delay: 0.7s; }
.service-card-modern:nth-child(8) { animation-delay: 0.8s; }
.service-card-modern:nth-child(9) { animation-delay: 0.9s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ========================================
   PARTNERS SECTION - SLIDING CAROUSEL (3 visibili)
   ======================================== */

.partners-section {
  padding: 80px 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  margin-top: 80px;
}

.section-title-partners {
  text-align: center;
  font-size: 28px !important;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 60px;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
margin-top: 80px;
}

.section-title-partners::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 100%);
  border-radius: 2px;
}

.partners-carousel-container {
  position: relative;
  overflow: hidden;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

.partners-track {
  display: flex;
  transition: transform 0.6s ease;
  gap: 40px;
}

.partner-item {
  min-width: calc((100% - 80px) / 3);
  flex-shrink: 0;
}

.partner-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  min-height: 120px;
}

.partner-logo:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(30, 58, 138, 0.15);
}

.partner-logo img {
  max-width: 140px;
  max-height: 70px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.partner-logo:hover img {
  filter: grayscale(0%);
  opacity: 1;
}

/* Indicators */
.partners-carousel-controls {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  gap: 15px;
}

.partners-prev,
.partners-next {
  background-color: trasparent;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 10px;
  transition: background-color 0.3s ease;
}

.partners-prev:hover,
.partners-next:hover {
  background-color: #1e3a8a;;
}


/* Responsive */
@media (max-width: 1024px) {
  .partner-item {
    min-width: calc((100% - 40px) / 2);
  }
  
  .partners-track {
    gap: 20px;
  }
}

@media (max-width: 699px) {
  .partners-section {
    padding: 60px 0;
  }
  
  .section-title-partners {
    font-size: 32px;
    margin-bottom: 40px;
  }
  
  .partner-item {
    min-width: 100%; 
  }
  
  .partners-track {
    gap: 0;
  }
  
  .partner-logo {
    min-height: 100px;
  }
  
  .partner-logo img {
    max-width: 150px;
    max-height: 60px;
  }

}

/* Miglioramenti Mobile: testi e immagini */
@media (max-width: 768px) {
  /* Contenitori con padding per evitare tagli testi */
  .slideshow__slide-caption,
  .carousel-caption {
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
  }

  /* Testi principali fluidi e leggibili */
  .slideshow__slide-caption-title,
  .carousel-title {
    font-size: clamp(1.8rem, 6vw, 3rem);
    line-height: 1.2;
    margin-bottom: 1rem;
  }

  /* Sottotitoli fluidi e leggibili */
  .slideshow__slide-caption-content,
  .carousel-subtitle {
    font-size: clamp(1rem, 4vw, 1.2rem);
    line-height: 1.4;
  }

  /* Spaziatura per paragrafi */
  p {
    margin-bottom: 1rem;
  }

  /* Immagini adattive */
  img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .slideshow__slide-caption-title {
    font-size: 1.8rem !important;
    margin-bottom: 50px !important;
  }
  
  .slideshow__slide-caption-content {
    font-size: 1rem !important;
  }

  .brand-text {
    font-size: 14px;
  }
}

/* Correzione titoli slideshow per mobile */
@media (max-width: 768px) {
  h1.slideshow__slide-caption-title {
    padding-left: 20px !important;
    padding-right: 20px !important;
    font-size: clamp(1.5rem, 5vw, 2.5rem) !important;
    line-height: 1.3 !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .o-hsub.-link {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  
  p.slideshow__slide-caption-content {
    padding-left: 20px !important;
    padding-right: 20px !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  h2.slideshow__slide-caption-title {
    font-size: 1.5rem !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    margin-bottom: 30px !important;
  }
}

/* Titolo centrato sopra l'immagine */
.portfolio__image-center {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.portfolio__image-center img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

.portfolio__title-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 95%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    background: transparent;
    padding: 0;
    font-size: 1rem;
    pointer-events: none;
}

.portfolio__title-overlay h3 {
    color: #fff;
    font-size: clamp(1.6rem, 5vw, 2.2rem); 
    font-weight: 700;
    line-height: 1.15;
    margin: 0;
    width: 100%;
    word-break: break-word;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 10px;
    box-sizing: border-box;
    text-align: center;
    font-family: inherit; 
    text-shadow: 0 4px 18px rgba(0,0,0,0.34), 0 1px 0 #111;

}

.estendi-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    background: var(--color-teal-600, #1a6873);
    color: #fff;
    padding: 8px 24px;
    border: none;
    border-radius: 22px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.96;
    transition: background .2s;
}

.estendi-btn:hover { background: var(--color-teal-700, #10525c); }

/* Piccolo body */
.card__body-small {
    padding: 10px 0 0 0;
    text-align: center;
}

/* Modal Gallery */
.portfolio-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    background: rgba(0,0,0,.55);
}

.portfolio-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-modal__overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: transparent;
    z-index: 1;
}

.portfolio-modal__content {
    background: #fff;
    border-radius: 10px;
    padding: 28px 20px 20px 20px;
    position: relative;
    max-width: 90vw; max-height: 85vh;
    text-align: center;
    min-width: 300px;
    z-index: 2;
    box-shadow: 0 6px 36px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 100px;
}

.portfolio-modal__gallery {
    position: relative;
    display: flex;
    align-items: center;
    margin: 1.2rem 0 0 0;
    justify-content: center;
    gap: 1rem;
}

.portfolio-modal__gallery img {
    max-width: 70vw;
    max-height: 60vh;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    object-fit: contain;
}

.gallery-arrow {
    background: #00334d;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.9;
    transition: background .2s;
}

.gallery-arrow:hover { background: #00798c; }
.portfolio-modal__close {
    position: absolute;
    top: 12px; right: 18px;
    font-size: 2rem;
    background: none;
    border: none;
    color: #222;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 600px) {
    .portfolio-modal__gallery img {
        max-width: 90vw;
        max-height: 36vh;
    }
    .portfolio__title-overlay { font-size: 1.1rem; padding: 6px 0; }
    .portfolio-modal__content { padding: 12px 4px 16px 4px; }
    .estendi-btn { font-size: 0.9rem; }
}

.portfolio__image-center {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    width: 100%;
    aspect-ratio: 4/3; 
    background: #efefef;
    min-height: 240px;
    max-height: 340px; 
    display: flex;
    align-items: center;
    justify-content: center;
}
.portfolio__image-center img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 4/3;  
    display: block;
    border-radius: 12px;
}



.js-slider-home-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: none;
  padding: 10px 16px;
  font-size: 1.6rem;
  cursor: pointer;
  border-radius: 50%;
  z-index: 10;
  user-select: none;
  transition: background 0.3s ease;
}
.js-slider-home-button:hover {
  background: rgba(0,0,0,0.75);
}
.js-slider-home-prev {
  left: 15px;
}
.js-slider-home-next {
  right: 15px;
}

.portfolio-modal__gallery {
    max-width: 95vw !important;
    width: auto !important; 
    margin: 15px auto !important;
    padding: 0 10px !important;
    box-sizing: border-box !important;
}

.portfolio-modal__gallery img {
    aspect-ratio: 16 / 9 !important;
    max-width: 100% !important;
    max-height: 85vh !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
} 

.gallery-arrow-wrapper {
    display: flex;
    justify-content: center;
    gap: 16px;
    width: 100%;
}

.gallery-arrow {
    background: rgba(0,51,77,0.6);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    color: white;
    font-size: 24px;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.gallery-arrow:hover {
    background: rgba(0,51,77,0.85);
}

@media (max-width: 600px) {
    .gallery-arrow {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    .gallery-arrow-wrapper {
        gap: 10px;
    }
}

/* Responsive per mobile */
@media (max-width: 600px) {
    .portfolio-modal__gallery {
        gap: 0.5rem;
    }
    .portfolio-modal__gallery img {
        max-width: 90vw;
        max-height: 45vh;
    }
    .gallery-arrow {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }
}
.portfolio-title-modern {
    color: #fff;
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    font-weight: 700;
    line-height: 1.15;
    margin: 0;
    width: 100%;
    word-break: break-word;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 10px;
    box-sizing: border-box;
    text-align: center;
    font-family: inherit;
    text-shadow: 0 4px 18px rgba(0,0,0,0.34), 0 1px 0 #111;
}

/* ========================================
   PORTFOLIO MODAL GALLERY - FIX FRECCE
   ======================================== */

.portfolio-modal__gallery {
  position: relative;
  display: flex !important;
  flex-direction: row !important; 
  flex-wrap: wrap !important; 
  align-items: center !important;
  justify-content: center !important;
  max-width: 95vw;
  margin: 1.2rem auto 0 auto;
  padding: 0 10px;
  gap: 0;
}

/* Immagine: occupa tutta la larghezza e va in alto */
.portfolio-modal__gallery img,
.portfolio-modal__gallery img#modalImage {
  width: 100% !important;
  max-width: 70vw !important;
  max-height: 60vh !important;
  object-fit: contain !important;
  border-radius: 6px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
  display: block !important;
  order: -1 !important;
  flex: 1 1 100% !important;
  margin: 0 auto 12px auto !important;
}

/* Frecce: vanno nella seconda riga, affiancate */
.gallery-arrow,
.portfolio-modal__gallery > button.left,
.portfolio-modal__gallery > button.right {
  background: rgba(0, 51, 77, 0.6) !important;
  border: none !important;
  border-radius: 50% !important;
  width: 48px !important;
  height: 48px !important;
  color: white !important;
  font-size: 24px !important;
  cursor: pointer !important;
  user-select: none !important;
  transition: background 0.3s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 8px !important;
  position: static !important;
  order: 1 !important; 
  flex-shrink: 0 !important;
}

.gallery-arrow:hover {
  background: rgba(0, 51, 77, 0.85) !important;
}

/* Responsive */
@media (max-width: 768px) {
  .portfolio-modal__gallery {
    gap: 0.5rem;
  }

  .portfolio-modal__gallery img,
  .portfolio-modal__gallery img#modalImage {
    max-width: 85vw !important;
    max-height: 50vh !important;
  }

  .gallery-arrow,
  .portfolio-modal__gallery > button {
    width: 40px !important;
    height: 40px !important;
    font-size: 20px !important;
    margin: 0 6px !important;
  }
}

@media (max-width: 480px) {
  .portfolio-modal__gallery img,
  .portfolio-modal__gallery img#modalImage {
    max-width: 90vw !important;
    max-height: 45vh !important;
  }

  .gallery-arrow,
  .portfolio-modal__gallery > button {
    width: 36px !important;
    height: 36px !important;
    font-size: 18px !important;
    margin: 0 4px !important;
  }
}

.footer-bottom-bar {
  background-color: #1e3a8a;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 0.9rem;
  font-family: 'Lato', sans-serif;
  /* Rimuovi position fixed per non essere sempre visibile */
  position: relative;
  box-shadow: 0 -3px 10px rgba(0,0,0,0.2);
}

.footer-bar-content p {
  margin: 0;
}

.footer-link {
  color: #fbbf24;
  text-decoration: none;
  margin-left: 6px;
  margin-right: 6px;
}

.footer-link:hover {
  text-decoration: underline;
  color: #f59e0b;
}

}

/* sub-footer*/

#sub-footer {
  background: linear-gradient(135deg, #4a90e2 0%, #6ba3f2 100%);
  padding: 30px 20px;
  box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.1);
  color: #444444;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  border-top: 2px solid #365f9e;
  position: relative;


}

.container-sub-footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 1200px;
  margin: 0 auto;
  gap: 30px;
}

.sub-footer-left,
.sub-footer-center,
.sub-footer-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.sub-footer-left h4,
.sub-footer-right h4 {
  font-weight: 600;
  margin-bottom: 15px;
}

.social-icons a {
  margin-right: 10px;
  display: inline-block;
  transition: transform 0.2s ease;
}

.social-icons a:hover {
  transform: scale(1.1);
}

.icon-social {
  width: 30px;
  height: 30px;
}

.logo-sub-footer {
  display: block;
  margin: 0 auto 10px auto;
  max-width: 135px;
  height: auto;
}

.desc-logo {
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.3;
  color: #444444;
}

.link-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.link-list li {
  margin-bottom: 10px;
}

.link-list a {
  color: #444444;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.link-list a:hover {
  color: #2c5ca9;
  text-decoration: underline;
}

/* Decoration: subtle diagonal stripes background overlay */
#sub-footer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: none;
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.1) 10px,
    transparent 10px,
    transparent 20px
  );
  pointer-events: none;
  z-index: 0;
}

#sub-footer > .container-sub-footer {
  position: relative;
  z-index: 1;
}

/* Responsive: su schermi piccolissimi le colonne vanno in colonna verticale */
@media (max-width: 768px) {
  .container-sub-footer {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .sub-footer-left,
  .sub-footer-center,
  .sub-footer-right {
    align-items: center;
  }
}

.sub-footer-left h4,
.sub-footer-right h4 {
  color: #2c5ca9;
}

.spacer {
  height: 50px;
  width: 100%;
}

#sub-footer h4::after {
  content: "";
  display: block;
  height: 3px; 
  width: 100%;
  background-color: orange; 
  margin-top: 5px;
  border-radius: 2px;
}




#safety-badges {
  background-color: #f6f9fc;
  padding: 30px 20px;
  text-align: center;
}

#safety-badges h3 {
  color: #2c5ca9;
  margin-bottom: 20px;
}

.badges-container {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 120px;
  font-weight: 600;
  color: #444444;
}

.badge img {
  width: 50px;
  height: 50px;
  margin-bottom: 10px;
}


.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--color-black, rgba(0,0,0,0.9));
  color: var(--color-white, white);
  padding: 1rem 1.5rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.7);
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: flex;
  justify-content: center;
}

.cookie-banner.show {
  transform: translateY(0);
}

.cookie-content {
  max-width: 1200px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.cookie-content p {
  margin: 0;
  font-size: 0.9rem;
  flex: 1 1 auto;
}

.cookie-content a {
  color: var(--color-teal-300, #32b8c6);
  text-decoration: underline;
}

.cookie-buttons {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  margin-left: 1rem;
}

.cookie-buttons button {
  cursor: pointer;
  border-radius: 4px;
  font-weight: 600;
  padding: 6px 14px;
  border: none;
}

.btn-primary {
  background-color: var(--color-teal-500, #21808d);
  color: white;
}

.btn-primary:hover {
  background-color: var(--color-teal-700, #1a686f);
}

.btn-secondary {
  background-color: var(--color-gray-700, #5f5f5f);
  color: white;
}

.btn-secondary:hover {
  background-color: var(--color-gray-900, #3a3a3a);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--color-teal-500, #21808d);
  color: var(--color-teal-500, #21808d);
  font-weight: 700;
}

.btn-outline:hover {
  background-color: var(--color-teal-500, #21808d);
  color: white;
}


/* ========================================
   titolo home
   ======================================== */

.home-title-section {
  padding: var(--space-32) var(--space-20);
  text-align: center;
  background-color: var(--color-surface);
  margin-top: var(--space-48);
}

.home-main-title {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  color: #1e3a8a;
  margin: 0;
  letter-spacing: var(--letter-spacing-tight);
  text-transform: uppercase;
  text-align: center;
  padding-bottom: var(--space-8);  
  margin-bottom: var(--space-16); 
  border-bottom: 3px solid #e67e22;
  display: inline-block;
  width: auto;
}

/* ========================================
   HOME SECTION: BADGES CON SFONDO IMMAGINI
   ======================================== */

.home-content-section {
  padding: var(--space-48) var(--space-20);
  background-color: var(--color-background);
  margin-bottom: 48px;

}

.badges-container-centered {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-32);
}

.badge-card {
  position: relative;
  padding: var(--space-24);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.3);
  min-height: 270px;
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-standard));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  /* Sfondo immagine */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: flex-end;
}

/* Overlay trasparente scuro per rendere visibile il testo */
.badge-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, 
    rgba(0, 0, 0, 0.3) 0%, 
    rgba(0, 0, 0, 0.6) 100%);
  z-index: 1;
}

/* Contenuto della card sopra l'overlay */
.badge-content {
  position: relative;
  z-index: 2;
  width: 100%;
  text-align: center;
}

.badge-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
}

/* Effetto hover sull'overlay - più scuro */
.badge-card:hover .badge-card-overlay {
  background: linear-gradient(to bottom, 
    rgba(0, 0, 0, 0.4) 0%, 
    rgba(0, 0, 0, 0.7) 100%);
}

.badge-icon-container {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-16);
}

.badge-icon {
  width: 48px;
  height: 48px;
  color: var(--color-white);
  stroke-width: 1.5;
}

.badge-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-white);
  margin: 0 0 var(--space-12) 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.badge-description {
  font-size: var(--font-size-base);
  color: var(--color-white);
  line-height: var(--line-height-normal);
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .badges-container-centered {
    grid-template-columns: 1fr;
    gap: var(--space-24);
  }

  .badge-card {
    min-height: 350px;
    padding: var(--space-20);
  }
}

@media (max-width: 480px) {
  .home-content-section {
    padding: var(--space-24) var(--space-16);
  }

  .badge-card {
    min-height: 300px;
    padding: var(--space-16);
  }

  .badge-title {
    font-size: var(--font-size-lg);
  }

  .badge-description {
    font-size: var(--font-size-sm);
  }

  .badge-icon {
    width: 40px;
    height: 40px;
  }
}

/* ========================================
   PROGETTI SECTION: FAQ CENTRATA
   ======================================== */

.faq-section {
  padding: var(--space-32) var(--space-20);
  background-color: var(--color-surface);
}

.faq-container-centered {
  max-width: 900px;
  margin: 0 auto;
}

.faq-title-section {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  margin-bottom: var(--space-24);
  padding-bottom: var(--space-16);
  border-bottom: 2px solid var(--color-primary);
  text-align: center;
}

.faq-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--color-background);
  transition: all var(--duration-normal) var(--ease-standard);
}

.faq-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.faq-question {
  width: 100%;
  padding: var(--space-16);
  border: none;
  background-color: var(--color-background);
  color: var(--color-text);
  cursor: pointer;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--duration-fast) var(--ease-standard);
}

.faq-question:hover {
  background-color: rgba(var(--color-primary-rgb, 33, 128, 141), 0.05);
  color: var(--color-primary);
}

.faq-question span {
  text-align: left;
  flex: 1;
}

.faq-icon {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
  flex-shrink: 0;
  margin-left: var(--space-12);
  transition: transform var(--duration-normal) var(--ease-standard));
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-normal) var(--ease-standard));
  background-color: rgba(var(--color-primary-rgb, 33, 128, 141), 0.03);
}

.faq-item.active .faq-answer {
  max-height: 500px;
  overflow: auto;
}

.faq-answer p {
  padding: 0 var(--space-16) var(--space-16) var(--space-16);
  margin: var(--space-16) 0 0 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .badges-container-centered {
    grid-template-columns: 1fr;
  }

  .faq-title-section {
    font-size: var(--font-size-xl);
  }

  .badge-card {
    padding: var(--space-20);
  }
}

@media (max-width: 480px) {
  .home-content-section {
    padding: var(--space-24) var(--space-16);
  }

  .faq-section {
    padding: var(--space-24) var(--space-16);
  }

  .badge-title {
    font-size: var(--font-size-lg);
  }

  .badge-description {
    font-size: var(--font-size-sm);
  }

  .faq-question {
    padding: var(--space-12);
    font-size: var(--font-size-sm);
  }

  .faq-answer p {
    font-size: var(--font-size-sm);
  }
}

/* ========================================
   FAQ: MOSTRA SOLO NELLA SEZIONE PORTFOLIO
   ======================================== */

/* Nascondi FAQ di default */
.faq-section {
  display: none;
}

/* Mostra FAQ solo quando aria-hidden è false (sezione portfolio attiva) */
#portfolio[aria-hidden="false"] ~ .faq-section {
  display: block;
}

/* O in alternativa, usa questa soluzione più robusta */
.section:not([aria-hidden="true"]) ~ .faq-section {
  display: none;
}

#portfolio ~ .faq-section {
  display: block;
}

#portfolio[aria-hidden="true"] ~ .faq-section {
  display: none;
}

/* ===== WHATSAPP BUTTON ===== */
.whatsapp-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

.whatsapp-button a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background-color: #25D366;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all var(--duration-normal) var(--ease-standard);
  animation: whatsappPulse 2s infinite;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.whatsapp-button a:hover {
  transform: scale(1.1);
  box-shadow: 0 15px 35px rgba(37, 211, 102, 0.4);
  animation: none;
}

.whatsapp-button a:active {
  transform: scale(1.05);
}

/* Animazione pulse WhatsApp */
@keyframes whatsappPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* Responsive Mobile */
@media (max-width: 768px) {
  .whatsapp-button {
    bottom: 15px;
    right: 15px;
  }

  .whatsapp-button a {
    width: 55px;
    height: 55px;
  }

  .whatsapp-button a svg {
    width: 28px;
    height: 28px;
  }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .whatsapp-button a {
    background-color: #25D366;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .whatsapp-button a:hover {
    box-shadow: 0 15px 35px rgba(37, 211, 102, 0.5);
  }
}

[data-color-scheme="dark"] .whatsapp-button a {
  background-color: #25D366;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-color-scheme="dark"] .whatsapp-button a:hover {
  box-shadow: 0 15px 35px rgba(37, 211, 102, 0.5);
}
