/* ============================================================================
   EUREKA · Public design tokens (the "skin")  — LAYER 1 of 3
   ----------------------------------------------------------------------------
   SINGLE SOURCE OF TRUTH for every visual decision on the public web app / PWA.
   Components (ui.css) and pages reference ONLY these tokens — never raw colours
   or pixel values. To restyle the whole product, edit this file; markup and
   logic stay untouched. This is also what lets the Capacitor APP re-skin.
   Mobile-first: values are tuned for phones and scale up.
   ============================================================================ */

:root {
  color-scheme: light;

  /* ---- Brand palette (raw colours; reference via the semantic tokens below) */
  --brand-orange: #f58220;
  --brand-orange-dark: #d96f1b;
  --brand-orange-soft: #fff4eb;

  /* Highlight / secondary accent (raw) — independent of the primary brand. */
  --brand-highlight: #ea580c;
  --brand-highlight-dark: #c2410c;
  --brand-highlight-soft: #fff4ed;

  /* ---- Semantic colour roles ------------------------------------------------ */
  --color-bg: #f7f8fa;          /* page background                              */
  --color-surface: #ffffff;     /* cards, panels                               */
  --color-surface-2: #f3f4f6;   /* subtle raised / inset areas                 */
  --color-ink: #111827;         /* primary text (body)                         */
  --color-heading: var(--color-ink); /* headings (titles); default = body text */
  --color-muted: #6b7280;       /* secondary text, labels                      */
  --color-line: #e5e7eb;        /* borders, dividers                           */
  --color-map-sea: #cfe0f0;     /* mare della mappa ricerca (/cerca)           */

  --color-accent: var(--brand-orange);
  --color-accent-strong: var(--brand-orange-dark);
  --color-accent-soft: var(--brand-orange-soft);
  --color-premium: var(--brand-orange);

  /* Secondary "highlight" accent — perfect-match badge, recovery notice/counter, etc. */
  --color-highlight: var(--brand-highlight);
  --color-highlight-strong: var(--brand-highlight-dark);
  --color-highlight-soft: var(--brand-highlight-soft);
  --color-on-highlight: #ffffff;

  /* Cobalto — 2° colore del marchio (CTA, titoli, focus, bordi). Scala completa così le
     pagine smettono di hardcodare #0047AB e le sue varianti. Dark: vedi theme-dark.css. */
  --color-cobalt: #0047AB;
  --color-cobalt-hover: #1560d8;
  --color-cobalt-strong: #003a91;
  --color-cobalt-soft: #eaf1ff;
  --color-cobalt-muted: #33507c;
  --color-cobalt-ring: rgba(0, 71, 171, .25);

  /* Testo/superfici extra usati sparsi nelle pagine (prima hardcoded). */
  --color-ink-soft: #374151;       /* testo scuro "morbido" (piu' chiaro di ink, piu' scuro di muted) */
  --color-surface-raised: #ffffff; /* superfici in rilievo */
  --color-surface-sunken: #f6f6f6; /* superfici incassate */

  --color-success: #087443;
  --color-success-soft: #ecfdf5;
  --color-danger: #b42318;
  --color-danger-soft: #fef2f2;
  --color-info: #2563eb;
  --color-info-soft: #eff6ff;
  --color-warning: #9a3412;       /* warning/notice text */
  --color-warning-soft: #fff7ed;  /* warning/notice background */
  --color-warning-border: #fed7aa;/* warning/notice border */

  --color-on-accent: #ffffff;   /* text/icons on an accent fill                */

  /* Plan colours (mailbox plan badges/chips) — themeable. Plans: SMART/ICON/EUREKA. */
  --color-plan-smart: #2B7FE8;
  --color-plan-icon: #1230B0;
  --color-plan-eureka: var(--brand-orange);

  /* ---- Typography ----------------------------------------------------------- */
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --text-xs: 14px; /* floor minimo testo (Ale): mai sotto 14px */
  --text-sm: 14px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: clamp(26px, 4.2vw, 34px);
  --text-display: clamp(28px, 4.8vw, 44px); /* hero headline */

  --font-normal: 400;
  --font-medium: 600;
  --font-bold: 800;
  --font-black: 900;

  --leading-tight: 1.1;
  --leading-snug: 1.3;
  --leading-normal: 1.5;

  /* ---- Spacing scale (4px base) -------------------------------------------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* ---- Radius --------------------------------------------------------------- */
  --radius-sm: 10px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  /* ---- Borders ---- */
  --border-width: 1px;

  /* ---- Elevation / shadow --------------------------------------------------- */
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.05);
  --shadow-md: 0 8px 24px rgba(17, 24, 39, 0.06);
  --shadow-lg: 0 16px 40px rgba(17, 24, 39, 0.08);

  /* ---- Motion --------------------------------------------------------------- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 120ms;
  --dur-mid: 220ms;

  /* ---- Layout --------------------------------------------------------------- */
  --content-narrow: 520px;   /* search / focused single-column flows           */
  --content-wide: 1040px;    /* richer pages                                   */
  --content-app: 1320px;     /* app-like dashboards (the customer user area)   */
  --page-pad-x: 18px;

  /* ---- Control sizing (touch-friendly for the APP) ------------------------- */
  --control-h: 56px;         /* primary inputs/buttons on mobile               */
  --tap-min: 44px;           /* minimum touch target                           */

  /* ---- z-index scale -------------------------------------------------------- */
  --z-header: 100;
  --z-sticky: 90;
  --z-overlay: 1000;
  --z-toast: 1100;
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur-mid: 0ms; }
}
