/* Gestia design tokens: the single source of every value app.css uses.
   Values follow the Light SaaS design system (Crimson Blaze accent, Chord
   neutrals, Fixel type, four depth levels).

   Colors are Gestia's own. Brand roles point at the variables core/themes.py
   injects per business (--accent, --soft, ...), so they are declared on body,
   where those variables live; a token declared on :root would freeze the
   default palette. Everything that is not a color is declared on :root. */

:root {
  /* Spacing (px) */
  /* Pages use 90% of the desktop width: 5% on each side. Phones use space-lg. */
  --page-gutter:5%;
  --space-xs:4px; --space-sm:8px; --space-md:12px; --space-lg:16px; --space-xl:24px; --space-2xl:32px;

  /* Radius: containers, nested elements (buttons, items, rows), pills */
  --radius-xl:20px; --radius-md:12px; --radius-full:9999px;

  /* Layout */
  --sidebar-width:248px; --content-max:100%; /* no cap: the page gutter sets the width */ --control-h:36px; --icon-box:32px; --icon-size:16px; --icon-stroke:1.75;
  /* Touch screens keep 44px controls, the minimum comfortable tap target. */
  --control-h-touch:44px;

  /* Typography: Fixel stays the UI font (the business style promises the font never changes). */
  --font-sans:"Fixel Text",system-ui,-apple-system,"Segoe UI",sans-serif;
  --font-display:"Fixel Display","Fixel Text",system-ui,sans-serif;
  --font-mono:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
  --text-display:700 32px/40px var(--font-display); --tracking-display:-0.02em;
  --text-display-sm:700 24px/30px var(--font-display); /* page titles on phones */
  --text-title:500 20px/28px var(--font-display); --tracking-title:-0.01em;
  --text-heading:500 16px/24px var(--font-display);
  --text-body:400 14px/22px var(--font-sans);
  --text-body-sm:400 13px/20px var(--font-sans);
  --text-caption:500 12px/16px var(--font-sans); --tracking-caption:0.01em;
  --text-data:500 13px/20px var(--font-mono);

  /* Shadows by level (Light SaaS). */
  --shadow-1:0 1px 2px #0107081f;
  --shadow-2:0 8px 24px -12px #0107082e;
  --shadow-3:0 16px 40px -16px #01070847;

  /* Motion */
  --ease:cubic-bezier(0.2, 0, 0, 1);
  --motion-color:150ms; --motion-lift:200ms; --motion-fade:250ms; --motion-spin:800ms;

  /* Glass and grain */
  --glass-blur:16px;
  --grain:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
}

/* Brand palette. These are only the fallback; core/themes.py sets them per
   business on <body>, and body[data-theme="gestia"] below is Gestia's own
   look for pages without a business. */
:root { --ink:#010708; --muted:#4f5a66; --line:#2432421f; --soft:#f4f5f6; --accent:#721514; --accent-dark:#5a100f; }
/* Charts: the brand plus soft companions. Declared on :root as before. */
:root { --chart-1:var(--accent); --chart-2:var(--secondary, #b9706e); --chart-3:#243242; --chart-4:#7a8794; --chart-5:#c9a29f; }

@media (pointer:coarse) { :root { --control-h:var(--control-h-touch); } }
@media (prefers-reduced-motion:reduce) { :root { --motion-color:0ms; --motion-lift:0ms; --motion-fade:0ms; --motion-spin:0ms; } }

body {
  /* Levels: 0 background, 1 bars and panels, 2 cards, 3 hover and raised controls. */
  --color-bg:var(--soft);
  /* Surfaces stay white, as before; the Chord greys are only accents (hover, chips, avatars). */
  --color-surface-1:#ffffff;
  --color-surface-2:#ffffff;
  --color-surface-3:#f0f1f2; /* hover, secondary buttons, neutral badges, avatars */
  --color-surface-tint:#fafafa; /* week days, service picker: off the four levels */
  --color-overlay:#ffffffd1; /* glass, overlays only (with --glass-blur) */
  --color-scrim:#01070866;

  --color-border-subtle:var(--line);
  --color-border-strong:#24324238;
  --color-grid-line:#2432420f;

  --color-text-primary:var(--ink);
  --color-text-secondary:#243242; /* Chord Midnight */
  --color-text-muted:var(--muted);
  --color-text-faint:#8a939c;
  --color-text-agenda:#243242;
  --color-text-lead:#243242;
  --color-on-strong:#ffffff;

  --color-accent:var(--accent);
  --color-accent-hover:var(--accent-dark);
  --color-accent-soft:var(--accent-soft);
  --color-accent-line:var(--accent-line);
  --color-accent-tint:var(--accent-hover); /* existing light tint used as a hover background */
  --color-on-accent:var(--on-accent, #ffffff);
  --color-accent-shadow:var(--accent-shadow);
  --shadow-glow:0 0 0 1px color-mix(in srgb, var(--color-accent) 35%, transparent), 0 12px 32px -12px color-mix(in srgb, var(--color-accent) 35%, transparent);

  /* States (Light SaaS): always paired with a word or an icon. Variants alias the base tones. */
  --color-success:#0b5d29; --color-success-soft:#0b5d291f;
  --color-success-strong:var(--color-success); --color-success-text:var(--color-success); --color-success-mark:var(--color-success);
  --color-success-soft-2:var(--color-success-soft); --color-success-soft-3:var(--color-success-soft); --color-success-soft-4:#0b5d2912;
  --color-positive:var(--color-success); --color-trend-up:var(--color-success); --color-done-line:#0b5d2973;
  --color-info:#243242; --color-info-soft:#2432421a;
  --color-warning:#843b04; --color-warning-soft:#843b041f;
  --color-warning-strong:var(--color-warning); --color-warning-soft-2:#843b0414;
  --color-warning-line:#843b0459; --color-warning-tint:#843b040d; --color-warning-text:var(--color-warning);
  --color-danger:#a50f33; --color-danger-soft:#a50f331f;
  --color-danger-text:var(--color-danger); --color-danger-strong:var(--color-danger); --color-negative:var(--color-danger); --color-danger-alert:var(--color-danger);
  --color-danger-line:#a50f3373; --color-danger-panel-line:#a50f3340; --color-danger-tint:#a50f330d;
  --color-neutral:#243242; --color-neutral-soft:#e6e7e8;
  --color-notify:#e5484d; /* unread counts and the agenda's current-time line */

  /* Professional colors in the agenda */
  --pro-0:#22c55e; --pro-0-bg:#c9f2dc; --pro-1:#1f1f22; --pro-1-bg:#e9e9e9; --pro-2:#c4955a; --pro-2-bg:#f5e9d7;
  --pro-3:#3b82f6; --pro-3-bg:#dce8fd; --pro-4:#e5487a; --pro-4-bg:#fbe0ea; --pro-5:#8b5cf6; --pro-5-bg:#ebe3fd;

  --color-heat-base:#f0f1f2;

  /* Fixed surfaces that do not follow the brand */
  --color-landing-dark:#010708; --color-landing-dark-text:#e6e7e8; --color-landing-band:#f0f1f2;
  --color-hero-eyebrow:#e6e7e8; --color-hero-text:#fafafa; --color-hero-rule:#ffffff44;
  --color-booking-line:var(--color-accent-line); --color-booking-tint:var(--color-accent-tint); --color-booking-step:#e6e7e8; --color-onboarding-step:var(--color-accent-soft);
  --color-stamp-line:#24324238; --color-loyalty-fallback:#f0f1f2;
  --color-google-line:#747775; --color-google-text:#1f1f1f; --color-google-hover:#f8faff; --color-google-shadow:#3c40434d;
  --color-image-shadow:#0005; --color-chip-line:#0002; --color-chip-shadow:#0003;
  --color-gestia-ink:#010708;
}

/* Gestia's own look (no business active): Light SaaS, Chord neutrals and Crimson Blaze.
   Tints are the ones core/themes.py derives from the secondary #b9706e, like the old green ones. */
body[data-theme="gestia"] { --ink:#010708; --muted:#4f5a66; --line:#2432421f; --soft:#f4f5f6; --accent:#721514; --accent-dark:#5a100f; --on-accent:#ffffff; --secondary:#b9706e; --accent-soft:#f0e0df; --accent-line:#d2a2a1; --focus:#dcb8b7; --accent-hover:#f5ebeb; --accent-shadow:#72151426; }
