/*
 * Brand design tokens (light theme in :root, dark theme in :root[data-theme='dark'] at the end).
 * Single source of truth for every colour and the font stack.
 * The product name lives in brand/brand.json, not here.
 * To change the brand colour edit --color-primary below (and the fill in
 * logo-mark.svg / favicon.svg, which cannot read CSS variables).
 * Contrast ratios: .team/07-build-fe.md "UI yenileme Faz 1-2" (WCAG 2.1 AA, computed).
 */
:root {
  /* Brand colour (aubergine). Everything else derives from this one value. */
  --color-primary: #714B67;
  --color-primary-hover: color-mix(in srgb, var(--color-primary) 80%, #000000);   /* #5B3C52 */
  --color-primary-active: color-mix(in srgb, var(--color-primary) 64%, #000000);  /* darker still */
  --color-primary-tint: color-mix(in srgb, var(--color-primary) 8%, #FFFFFF);     /* soft fills, selected rows */
  --color-on-primary: #FFFFFF;     /* text on primary buttons */
  /* Fills (buttons, selected tabs, stage bar) split from --color-primary so dark can use a light tint for text and a deep one for fills. */
  --color-primary-fill: var(--color-primary);
  --color-primary-fill-hover: var(--color-primary-hover);
  --color-primary-fill-active: var(--color-primary-active);

  /* Neutrals */
  --color-bg: #F8FAFC;             /* page background */
  --color-surface: #FFFFFF;        /* cards, table rows, sidebar */
  --color-raised: #FFFFFF;         /* dialogs */
  --color-drawer: #F8FAFC;         /* firm card drawer floor */
  --color-border: #E2E8F0;         /* card and divider hairlines */
  --color-border-strong: #64748B;  /* form controls, badge outlines: >= 3:1 */
  --color-text: #0F172A;           /* headings, primary text */
  --color-text-muted: #475569;     /* secondary text, table headers, dates, sources */

  /* Soft card depth */
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04);

  color-scheme: light;

  /* Legacy names kept as aliases so styles.css keeps working. */
  --color-accent: var(--color-primary);
  --color-accent-hover: var(--color-primary-hover);
  --color-on-accent: var(--color-on-primary);

  /* Focus ring: use with outline-offset: 2px so it sits on bg/surface */
  --color-focus: var(--color-primary);
  --focus-ring: 2px solid var(--color-focus);
  --focus-offset: 2px;

  /* Pastel status pairs (background + text). Always paired with a word, never colour alone. */
  --badge-neutral-bg: #F1F5F9;     /* draft, waiting */
  --badge-neutral-fg: #475569;
  --badge-info-bg: #E0F2FE;        /* in progress */
  --badge-info-fg: #0369A1;
  --badge-success-bg: #DCFCE7;     /* approved, done, won */
  --badge-success-fg: #15803D;
  --badge-warning-bg: #FEF3C7;     /* warning, partial, late */
  --badge-warning-fg: #B45309;
  --badge-danger-bg: #FFE4E6;      /* cancelled, rejected, failed */
  --badge-danger-fg: #BE123C;

  /* Rating badges: always icon + text label ("Yüksek" / "Orta" / "Düşük") */
  --color-rating-high: var(--badge-success-fg);
  --color-rating-high-bg: var(--badge-success-bg);
  --color-rating-mid: var(--badge-warning-fg);
  --color-rating-mid-bg: var(--badge-warning-bg);
  --color-rating-low: var(--badge-neutral-fg);
  --color-rating-low-bg: var(--badge-neutral-bg);

  /* Legal-risk warning: warning icon + full text, never shortened */
  --color-warning: #9A3412;
  --color-warning-bg: #FDECE0;

  /* "Aranmasın" label: prohibition icon + text */
  --color-do-not-call: #BE123C;
  --color-do-not-call-bg: #FFE4E6;

  /* Status */
  --color-success: var(--badge-success-fg);
  --color-success-bg: var(--badge-success-bg);
  --color-error: var(--badge-danger-fg);
  --color-error-bg: var(--badge-danger-bg);

  /* Typography: self-hosted Inter (web/src/fonts.css), system fonts as fallback */
  --font-sans: "Inter Variable", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --font-size-base: 1rem;          /* 16px body */
  --font-size-small: 0.875rem;     /* 14px meta text; keep >= 14px */
  --font-size-title: 1.25rem;      /* top-bar name and screen titles */
  --font-weight-regular: 400;
  --font-weight-bold: 600;
  --line-height: 1.5;
  --radius: 6px;
}

/*
 * Dark theme. <html data-theme="dark"> is set by brand/theme.js (before first paint) and web/src/theme.ts.
 * Depth comes from lighter surfaces and borders, not shadows. Contrast ratios (WCAG 2.1 AA, computed with
 * scripts/theme-contrast.mjs): see .team/07-build-fe.md "Koyu tema".
 */
:root[data-theme='dark'] {
  color-scheme: dark;

  --color-primary: #D4AACA;                 /* text, links, focus ring on dark */
  --color-primary-hover: #E6C9DE;
  --color-primary-active: #EFDAE9;
  --color-primary-fill: #7A5170;            /* buttons, selected tabs: white text 7.2:1 */
  --color-primary-fill-hover: #8A5E7F;
  --color-primary-fill-active: #6A4560;
  --color-primary-tint: color-mix(in srgb, #D4AACA 14%, var(--color-surface));
  --color-on-primary: #FFFFFF;

  --color-bg: #0E1116;
  --color-surface: #171B22;
  --color-raised: #1E242D;
  --color-drawer: #12161C;
  --color-border: #2A313C;
  --color-border-strong: #8D98A8;
  --color-text: #E8ECF1;
  --color-text-muted: #A9B3C1;

  --shadow-card: none;

  --badge-neutral-bg: #252B35;
  --badge-neutral-fg: #BAC3D0;
  --badge-info-bg: #12293D;
  --badge-info-fg: #7FC6F0;
  --badge-success-bg: #13301F;
  --badge-success-fg: #72D796;
  --badge-warning-bg: #38290D;
  --badge-warning-fg: #F2B957;
  --badge-danger-bg: #3E1822;
  --badge-danger-fg: #FF93A9;

  --color-warning: #F5A872;
  --color-warning-bg: #3A2314;

  --color-do-not-call: #FF93A9;
  --color-do-not-call-bg: #3E1822;
}

