/* ============================================================
   VisitaSmart — Design Tokens
   Sistema iOS-inspired, refined minimalism, light mode + dark mode auto
   ============================================================ */

:root {
  /* --- Colori semantici (light mode) --- */
  --color-bg:              #FBFBFD;   /* sfondo app, off-white iOS */
  --color-surface:         #FFFFFF;   /* card, sheet, header */
  --color-surface-2:       #F2F2F7;   /* input field bg, separators */
  --color-surface-3:       #E5E5EA;   /* hover, pressed */

  --color-text:            #1C1C1E;   /* testo primario */
  --color-text-secondary:  #636366;   /* testo secondario */
  --color-text-tertiary:   #8E8E93;   /* placeholder, hint */

  --color-accent:          #007AFF;   /* iOS blue, azione primaria */
  --color-accent-pressed:  #0051D5;
  --color-success:         #34C759;   /* iOS green */
  --color-danger:          #FF3B30;   /* iOS red */
  --color-warning:         #FF9500;   /* iOS orange */

  --color-separator:       rgba(60, 60, 67, 0.12);
  --color-overlay:         rgba(0, 0, 0, 0.4);

  /* --- Tipografia --- */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
               system-ui, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", "Menlo", "Monaco", "Courier New", monospace;

  /* Type scale iOS (semantica) */
  --text-large-title:   34px;  --text-large-title-weight: 700;
  --text-title-1:       28px;  --text-title-1-weight: 700;
  --text-title-2:       22px;  --text-title-2-weight: 600;
  --text-title-3:       20px;  --text-title-3-weight: 600;
  --text-headline:      17px;  --text-headline-weight: 600;
  --text-body:          17px;  --text-body-weight: 400;
  --text-callout:       16px;  --text-callout-weight: 400;
  --text-subhead:       15px;  --text-subhead-weight: 400;
  --text-footnote:      13px;  --text-footnote-weight: 400;
  --text-caption-1:     12px;  --text-caption-1-weight: 400;
  --text-caption-2:     11px;  --text-caption-2-weight: 400;

  /* --- Spacing (multipli di 4) --- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;

  /* --- Radius --- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* --- Shadows (iOS-soft) --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 1px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.10), 0 4px 8px rgba(0, 0, 0, 0.04);

  /* --- Layout --- */
  --tabbar-height: 84px;       /* tab bar bottom (con safe-area iPhone) */
  --header-height: 56px;
  --max-content-width: 640px;  /* leggibilità su tablet/desktop */

  /* --- Motion --- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-base: 220ms;
  --duration-slow: 320ms;

  /* --- Z-index scale --- */
  --z-base: 1;
  --z-tabbar: 100;
  --z-header: 90;
  --z-modal: 1000;
  --z-toast: 2000;
}

/* --- Dark mode (auto via prefers-color-scheme) --- */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg:              #000000;
    --color-surface:         #1C1C1E;
    --color-surface-2:       #2C2C2E;
    --color-surface-3:       #3A3A3C;

    --color-text:            #FFFFFF;
    --color-text-secondary:  #EBEBF5;
    --color-text-tertiary:   #8E8E93;

    --color-accent:          #0A84FF;
    --color-accent-pressed:  #409CFF;
    --color-success:         #30D158;
    --color-danger:          #FF453A;
    --color-warning:         #FF9F0A;

    --color-separator:       rgba(84, 84, 88, 0.6);
    --color-overlay:         rgba(0, 0, 0, 0.6);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
  }

  /* Theme color meta dinamico via JS (vedi app.js) */
}
