/* ============================================
   ASSILEX Design System — Stile LEXIA
   ============================================ */

/* --- CSS Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { line-height: 1.6; }
img, video { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* --- CSS Variables — Design Tokens --- */
:root {
  /* Palette — Consulenza (Blu Navy) */
  --primary: #1a3a5c;
  --primary-light: #2a5a8c;
  --primary-dark: #0d2440;
  --primary-extra-light: #eef3f8;
  --accent: #c8a86e;
  --accent-light: #e0c992;

  /* Palette — Consumatori (Verde) — override in consumatori variant */
  /* --primary: #1b6b4a;
     --primary-light: #28956a;
     --primary-dark: #0f4530;
     --primary-extra-light: #eef8f3;
     --accent: #c8a86e; */

  /* Neutrali (identici a Lexia) */
  --dark: #1b2838;
  --darker-grey: #313537;
  --medium-grey: #828282;
  --medium-grey-2: #707070;
  --light-grey: #e4e4e3;
  --light-bg: #f8f7f7;
  --white: #ffffff;
  --black: #272727;

  /* Tipografia */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-light: 300;
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Font Sizes — Fluid */
  --text-xs: clamp(0.7rem, 0.8vw, 0.75rem);
  --text-sm: clamp(0.8rem, 0.9vw, 0.875rem);
  --text-base: clamp(0.9rem, 1vw, 1rem);
  --text-lg: clamp(1rem, 1.2vw, 1.125rem);
  --text-xl: clamp(1.1rem, 1.5vw, 1.25rem);
  --text-2xl: clamp(1.3rem, 2vw, 1.5rem);
  --text-3xl: clamp(1.5rem, 2.5vw, 1.875rem);
  --text-4xl: clamp(1.8rem, 3vw, 2.25rem);
  --text-5xl: clamp(2.2rem, 4vw, 3rem);
  --text-6xl: clamp(2.8rem, 5vw, 3.75rem);
  --text-7xl: clamp(3.2rem, 6vw, 4.5rem);
  --text-hero: clamp(3rem, 7vw, 5rem);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;
  --section-padding: clamp(80px, 10vw, 140px);
  --container-max: 1280px;
  --container-padding: clamp(24px, 5vw, 80px);

  /* Layout */
  --header-height: 70px;
  --border-radius: 0;
  --border-radius-sm: 4px;

  /* Transizioni */
  --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-fast: all 0.2s ease;
  --transition-slow: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* Ombre */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);

  /* Z-index */
  --z-header: 1000;
  --z-menu-overlay: 1100;
  --z-modal: 1200;
}

/* --- Consumatori Color Override --- */
body.site-consumatori {
  --primary: #1b6b4a;
  --primary-light: #28956a;
  --primary-dark: #0f4530;
  --primary-extra-light: #eef8f3;
}

/* --- Typography --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  color: var(--darker-grey);
  background-color: var(--white);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-light);
  line-height: 1.15;
  color: var(--black);
  letter-spacing: -0.02em;
}

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

p {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--darker-grey);
  max-width: 680px;
}

.text-light { font-weight: var(--font-light); }
.text-medium { font-weight: var(--font-medium); }
.text-semibold { font-weight: var(--font-semibold); }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.15em; }
.text-center { text-align: center; }
.text-white { color: var(--white); }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }

/* --- Layout Utilities --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.container-wide {
  max-width: 1440px;
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.section {
  padding-top: var(--section-padding);
  padding-bottom: var(--section-padding);
}

.section-dark {
  background-color: var(--dark);
  color: var(--white);
}

.section-dark h2,
.section-dark h3,
.section-dark h4,
.section-dark p {
  color: var(--white);
}

.section-light {
  background-color: var(--light-bg);
}

.section-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
}

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

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2xl);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2xl);
}

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

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

/* --- Responsive --- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-4,
  .grid-3,
  .grid-2 { grid-template-columns: 1fr; }
  
  :root {
    --header-height: 60px;
    --section-padding: 60px;
  }
}

/* --- Selection --- */
::selection {
  background-color: var(--primary);
  color: var(--white);
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--light-bg); }
::-webkit-scrollbar-thumb { background: var(--medium-grey); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--darker-grey); }
