/* =============================================================
   PhoneLover Design System — Foundations
   colors_and_type.css
   Single source of truth for colours, type, spacing, radii,
   shadows, motion. Import this file first; everything in the
   system reads from these variables.
   ============================================================= */

/* -- Webfonts (Google Fonts CDN) ------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400;1,9..40,500&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ---------- Brand colour: VIOLA -------------------------------
     The single saturated signal in the system. A warm, slightly
     magenta-leaning electric purple — distinctive, modern,
     unmistakably PhoneLover. Used for primary CTAs, the heart in
     the logo, focus rings, selection, brand accents. Never used
     as a large background.
     (Variable names kept as --cuore-* for back-compat across all
     kits already shipped — only the values changed.) */
  --cuore-50:  #F4EEFF;
  --cuore-100: #E5D8FF;
  --cuore-200: #CDB1FF;
  --cuore-300: #B086FF;
  --cuore-400: #9560FB;
  --cuore-500: #7A3DEE;   /* PRIMARY — the brand colour */
  --cuore-600: #6529D6;
  --cuore-700: #501FAE;
  --cuore-800: #3B1880;
  --cuore-900: #251052;
  --cuore: var(--cuore-500);

  /* Aliases (semantic clarity in new code) */
  --viola-50: var(--cuore-50);
  --viola-100: var(--cuore-100);
  --viola-200: var(--cuore-200);
  --viola-300: var(--cuore-300);
  --viola-400: var(--cuore-400);
  --viola-500: var(--cuore-500);
  --viola-600: var(--cuore-600);
  --viola-700: var(--cuore-700);
  --viola-800: var(--cuore-800);
  --viola-900: var(--cuore-900);
  --viola: var(--cuore-500);

  /* ---------- Neutral: GRAFITE ----------------------------------
     Cool industrial grey scale. Borrowed from Apple's product
     photography palette: never warm, never blue, never muddy. */
  --grafite-50:  #F6F6F7;
  --grafite-100: #ECECEE;
  --grafite-200: #DCDCDF;
  --grafite-300: #BFBFC4;
  --grafite-400: #9A9AA1;
  --grafite-500: #74747C;
  --grafite-600: #54545B;
  --grafite-700: #3B3B40;
  --grafite-800: #26262A;
  --grafite-900: #141416;   /* almost-black */

  /* ---------- Surfaces ------------------------------------------
     Re-tuned to harmonise with Viola: cool, faintly lilac
     off-white instead of warm cream. Still warm enough to feel
     like a workshop, not a SaaS. */
  --bianco:      #FFFFFF;     /* pure white — product UI */
  --latte:       #F8F6FC;     /* faint lilac off-white — marketing pages */
  --latte-deep:  #EFEBF7;     /* a darker step — section dividers, cards on white */
  --notte:       #15101E;     /* dark surface — deep aubergine-black, never pure black */

  /* ---------- Semantic ------------------------------------------
     Desaturated so they don't fight Cuore. */
  --successo-bg:  #E7F4EC;
  --successo-fg:  #1F7A3D;
  --successo-500: #2E9E55;

  --avviso-bg:    #FBF1DD;
  --avviso-fg:    #7A5A14;
  --avviso-500:   #C99224;

  --errore-bg:    #FBE5E2;
  --errore-fg:    #9A1B12;
  --errore-500:   #D8392B;

  --info-bg:      #E5EFF7;
  --info-fg:      #1A4F80;
  --info-500:     #2E78B8;

  /* ---------- Foreground / text -------------------------------- */
  --fg-1: var(--grafite-900);  /* primary text */
  --fg-2: var(--grafite-700);  /* secondary text */
  --fg-3: var(--grafite-500);  /* tertiary / metadata */
  --fg-4: var(--grafite-400);  /* placeholder, disabled */
  --fg-on-cuore: #FFFFFF;
  --fg-on-dark:  #FFFFFF;

  /* ---------- Borders ------------------------------------------ */
  --border-1: var(--grafite-200);   /* default hairline */
  --border-2: var(--grafite-300);   /* hover / emphasised */
  --border-strong: var(--grafite-900);

  /* ---------- Type families ------------------------------------ */
  --font-sans:    'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --font-serif:   'Fraunces', ui-serif, Georgia, 'Times New Roman', serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Monaco, Consolas, monospace;

  /* ---------- Type scale (1.25 modular, capped) --------------- */
  --fs-display-2xl: 80px;   /* hero only */
  --fs-display-xl:  64px;
  --fs-display-lg:  48px;
  --fs-h1:          40px;
  --fs-h2:          32px;
  --fs-h3:          24px;
  --fs-h4:          20px;
  --fs-body-lg:     18px;
  --fs-body:        16px;
  --fs-body-sm:     14px;
  --fs-caption:     13px;
  --fs-label:       12px;   /* eyebrow / tiny */

  /* ---------- Line heights ------------------------------------- */
  --lh-display: 1.04;
  --lh-heading: 1.15;
  --lh-body:    1.55;
  --lh-tight:   1.35;

  /* ---------- Letter spacing ----------------------------------- */
  --ls-display: -0.02em;
  --ls-heading: -0.01em;
  --ls-body:    0;
  --ls-eyebrow: 0.08em;
  --ls-caps:    0.06em;

  /* ---------- Weights ------------------------------------------ */
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semibold:600;
  --fw-bold:    700;

  /* ---------- Spacing (4px base) ------------------------------- */
  --space-0:  0;
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;
  --space-9:  96px;
  --space-10: 128px;

  /* ---------- Radii -------------------------------------------- */
  --radius-xs:   4px;
  --radius-sm:   8px;     /* inputs, buttons, small cards */
  --radius-md:   12px;
  --radius-lg:   16px;    /* large cards, modals */
  --radius-xl:   24px;    /* hero blocks */
  --radius-pill: 999px;   /* badges, pills, avatars */

  /* ---------- Shadows ------------------------------------------ */
  --shadow-sm: 0 1px 2px rgba(20,20,22,0.06);
  --shadow-md: 0 8px 24px rgba(20,20,22,0.08), 0 1px 2px rgba(20,20,22,0.04);
  --shadow-lg: 0 16px 48px rgba(20,20,22,0.10), 0 2px 6px rgba(20,20,22,0.04);
  --shadow-focus: 0 0 0 2px var(--bianco), 0 0 0 4px var(--cuore);

  /* ---------- Motion ------------------------------------------- */
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --ease-std: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur-base: 200ms;
  --dur-slow: 400ms;

  /* ---------- Layout ------------------------------------------- */
  --max-content:   1200px;
  --max-app:       1440px;
  --gutter-mobile: 20px;
  --gutter-tablet: 48px;
  --gutter-desk:   80px;
  --header-h:      64px;

  /* ---------- Semantic theme tokens (LIGHT default) ------------
     Components should reference these, not raw palette tokens,
     so a [data-theme="dark"] swap re-skins everything. */
  --bg:           var(--latte);          /* page background */
  --bg-elev:      var(--bianco);         /* cards on bg */
  --bg-deep:      var(--latte-deep);     /* section dividers */
  --bg-inverse:   var(--notte);          /* dark hero blocks */
  --surface:      var(--bianco);         /* product UI base */
  --surface-2:    var(--grafite-50);     /* subtle hover/fill */
  --text:         var(--grafite-900);    /* primary */
  --text-2:       var(--grafite-700);    /* secondary */
  --text-3:       var(--grafite-500);    /* tertiary */
  --text-4:       var(--grafite-400);    /* placeholder */
  --text-on-inverse: #FFFFFF;
  --border:       var(--grafite-200);
  --border-strong-c: var(--grafite-300);
  --header-bg:    rgba(248,246,252,0.82);
  --shadow-card:  var(--shadow-sm);
  --shadow-lift:  var(--shadow-md);
}

[data-theme="dark"] {
  --bg:           #0E0A18;
  --bg-elev:      #1A1428;
  --bg-deep:      #14101F;
  --bg-inverse:   #050309;
  --surface:      #1A1428;
  --surface-2:    #221A33;
  --text:         #F5F0FF;
  --text-2:       #BFB4D6;
  --text-3:       #8A7FA3;
  --text-4:       #5C536F;
  --text-on-inverse: #FFFFFF;
  --border:       rgba(255,255,255,0.08);
  --border-strong-c: rgba(255,255,255,0.16);
  --header-bg:    rgba(14,10,24,0.78);
  --fg-1:         #F5F0FF;
  --fg-2:         #BFB4D6;
  --fg-3:         #8A7FA3;
  --fg-4:         #5C536F;
  --border-1:     rgba(255,255,255,0.08);
  --border-2:     rgba(255,255,255,0.16);
  --bianco:       #1A1428;
  --latte:        #0E0A18;
  --latte-deep:   #14101F;
  --notte:        #050309;
  --shadow-card:  0 1px 2px rgba(0,0,0,0.4);
  --shadow-lift:  0 12px 32px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.3);
  /* Slightly brighter viola in dark for contrast */
  --cuore-500:    #9560FB;
  --cuore-600:    #7A3DEE;
  --cuore-700:    #B086FF;
  --cuore-50:     rgba(149,96,251,0.12);
  --cuore-100:    rgba(149,96,251,0.18);
  --cuore-200:    rgba(149,96,251,0.28);
  --cuore-300:    rgba(149,96,251,0.40);
  --cuore-800:    #C9AFFF;
  --cuore-900:    #E5D8FF;
  /* INVERTED grafite scale: inline styles using --grafite-* now adapt automatically.
     Contrast values rivisti 2026-05-07 per migliore leggibilità (WCAG AA+ su sfondo #0E0A18). */
  --grafite-50:   #221A33;
  --grafite-100:  #2A2040;
  --grafite-200:  rgba(255,255,255,0.18);
  --grafite-300:  rgba(255,255,255,0.30);
  --grafite-400:  rgba(245,240,255,0.62);
  --grafite-500:  rgba(245,240,255,0.75);
  --grafite-600:  rgba(245,240,255,0.85);
  --grafite-700:  rgba(245,240,255,0.92);
  --grafite-800:  rgba(245,240,255,0.97);
  --grafite-900:  #F5F0FF;
  /* Status pills inverted for dark contrast */
  --successo-bg:  rgba(31,122,61,0.18);
  --successo-fg:  #6ED592;
  --errore-bg:    rgba(229,62,62,0.18);
  --errore-fg:    #FF8B8B;
  --info-bg:      rgba(122,61,238,0.18);
  --info-fg:      #C9AFFF;
  --warning-bg:   rgba(245,158,11,0.18);
  --warning-fg:   #FFD480;
}

/* ========== Dark mode polish: icon buttons + service card descriptions ========== */
html[data-theme="dark"] .pl-icon-btn,
html[data-theme="dark"] .pl-burger {
  color: rgba(255,255,255,0.92) !important;
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.16);
}
html[data-theme="dark"] .pl-icon-btn:hover { background: rgba(255,255,255,0.12); }
html[data-theme="dark"] .pl-icon-btn i,
html[data-theme="dark"] .pl-burger i { color: inherit; }
/* Lucide icons stroke colore inheritabile in dark */
html[data-theme="dark"] svg.lucide,
html[data-theme="dark"] [data-lucide] { color: currentColor; stroke: currentColor; }

/* =============================================================
   Semantic element defaults
   Apply these to actual h1, p, etc when the design system
   "owns" the document. Optional — most UI uses utility classes.
   ============================================================= */

html, body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--fg-1);
  background: var(--bianco);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, .h1 {
  font-family: var(--font-sans);
  font-size: var(--fs-h1);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  margin: 0;
}

h2, .h2 {
  font-family: var(--font-sans);
  font-size: var(--fs-h2);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  margin: 0;
}

h3, .h3 {
  font-family: var(--font-sans);
  font-size: var(--fs-h3);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-heading);
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  margin: 0;
}

h4, .h4 {
  font-family: var(--font-sans);
  font-size: var(--fs-h4);
  line-height: var(--lh-tight);
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  margin: 0;
}

.display-2xl,
.display-xl,
.display-lg {
  font-family: var(--font-sans);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-display);
  line-height: var(--lh-display);
  color: var(--fg-1);
  margin: 0;
}
.display-2xl { font-size: var(--fs-display-2xl); }
.display-xl  { font-size: var(--fs-display-xl); }
.display-lg  { font-size: var(--fs-display-lg); }

/* Editorial italic — reserved for emotional/branded moments only */
.editorial {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: var(--fw-regular);
  letter-spacing: 0;
}

p, .body {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--fg-1);
  margin: 0;
}
.body-lg { font-size: var(--fs-body-lg); line-height: 1.5; }
.body-sm { font-size: var(--fs-body-sm); line-height: 1.5; color: var(--fg-2); }
.caption { font-size: var(--fs-caption); line-height: 1.45; color: var(--fg-3); }

/* Eyebrow — tiny all-caps label above a heading */
.eyebrow {
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--cuore-700);
}

code, .mono, .sku {
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-feature-settings: 'zero', 'ss01';
  letter-spacing: 0;
}
.sku {
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--fg-2);
}

a {
  color: var(--fg-1);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { text-decoration: underline; }

::selection {
  background: var(--cuore-200);
  color: var(--fg-1);
}

:focus-visible {
  outline: 2px solid var(--cuore);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* ============================================================
   Polish service bar / trust strip — 2026-09-17
   Rende gli item della trust strip delle card leggere con
   icon-badge viola e hover, coerenti col tema PhoneLover.
   (Le product-card .pl-card hanno già border+hover+zoom, non toccate.)
   ============================================================ */
.home-trust > div {
  background: #fff !important;
  border: 1px solid var(--grafite-100, #ececf1) !important;
  border-radius: 16px !important;
  padding: 24px 22px !important;
  transition: transform .22s cubic-bezier(.2,0,0,1), box-shadow .22s ease, border-color .22s ease !important;
}
.home-trust > div:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 12px 28px rgba(86,45,137,0.10) !important;
  border-color: var(--cuore-500, #562d89) !important;
}
.home-trust > div > div:first-child {
  display: inline-flex !important;
  align-items: center; justify-content: center;
  width: 46px !important; height: 46px !important;
  background: rgba(86,45,137,0.08) !important;
  border-radius: 12px !important;
  color: var(--cuore-500, #562d89) !important;
}
.home-trust > div > div:first-child i { width: 24px !important; height: 24px !important; }
/* badges strip: icone sempre viola/leggibili */
.home-trust-badges i { color: var(--cuore-500, #562d89) !important; }
