/*
  Designove tokeny aplikace.

  Appka se pouziva venku, casto na primem slunci a v rukavici, takze
  zakladni pravidla jsou: vysoky kontrast textu, velke dotykove cile
  (minimalne 48 px) a zadne tenke sedive pismo na sedivem pozadi.
*/

:root {
  color-scheme: light dark;

  /* --- barvy znacky --------------------------------------------------- */
  --forest-900: #0f2119;
  --forest-800: #163024;
  --forest-700: #1f4032;
  --forest-600: #2a5a47;
  --forest-500: #35785e;
  --forest-400: #4e9b7d;
  --forest-300: #7cbfa4;
  --forest-100: #d9ece2;

  --amber-600: #b96a12;
  --amber-500: #d98324;
  --amber-300: #f2b134;
  --amber-100: #fbeacb;

  --danger-600: #a32c22;
  --danger-500: #c9432f;
  --danger-100: #f8dedb;

  --info-500: #1f7ae0;

  /* --- plochy a text -------------------------------------------------- */
  --bg: #f4f2ed;
  --surface: #ffffff;
  --surface-2: #efece5;
  --surface-3: #e3dfd6;
  --surface-inverse: var(--forest-800);

  --text: #16211c;
  --text-muted: #55625b;
  --text-inverse: #f6f8f6;

  --border: #d6d1c6;
  --border-strong: #b7b0a2;

  /*
    Barva textu na barevne plose (pilulky, bannery, zvyraznene polozky).
    Musi se prepinat spolu s rezimem: v tmavem rezimu jsou plochy
    --forest-100 a spol. tmave, takze tmavy znackovy odstin by na nich
    zmizel. Presne to se stalo u stavu stromu, kde vysel kontrast 1.09:1.
  */
  --on-forest-tint: #1a3a2c;
  --on-amber-tint: #7a4508;
  --on-danger-tint: #8f2119;

  --accent: var(--forest-600);
  --accent-text: #ffffff;

  /* --- rozmery -------------------------------------------------------- */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-full: 999px;

  --tap: 48px;
  --topbar-height: 60px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --shadow-1: 0 1px 2px rgba(15, 33, 25, 0.08), 0 2px 8px rgba(15, 33, 25, 0.06);
  --shadow-2: 0 4px 12px rgba(15, 33, 25, 0.12), 0 12px 32px rgba(15, 33, 25, 0.14);
  --shadow-3: 0 8px 24px rgba(15, 33, 25, 0.18), 0 24px 60px rgba(15, 33, 25, 0.22);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-numeric: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  /* Bezpecne zony na telefonech s vyrezem. */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  --z-map: 1;
  --z-map-ui: 400;
  --z-sheet: 600;
  --z-fab: 650;
  --z-drawer: 800;
  --z-modal: 900;
  --z-toast: 1000;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101713;
    --surface: #18211c;
    --surface-2: #202b25;
    --surface-3: #2a382f;
    --surface-inverse: #0b120e;

    --text: #e8efe9;
    --text-muted: #a3b3a9;
    --text-inverse: #f6f8f6;

    --border: #2f3d35;
    --border-strong: #43554a;

    --accent: var(--forest-400);
    --accent-text: #08130d;

    --forest-100: #24382e;
    --amber-100: #3a2c14;
    --danger-100: #3b1d19;

    --on-forest-tint: #a8dcc2;
    --on-amber-tint: #f7c766;
    --on-danger-tint: #f5b8ae;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-2: 0 4px 14px rgba(0, 0, 0, 0.55);
    --shadow-3: 0 10px 40px rgba(0, 0, 0, 0.65);
  }
}

/* Uzivatel si muze rezim vynutit v nastaveni aplikace. */
:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101713;
  --surface: #18211c;
  --surface-2: #202b25;
  --surface-3: #2a382f;
  --surface-inverse: #0b120e;
  --text: #e8efe9;
  --text-muted: #a3b3a9;
  --border: #2f3d35;
  --border-strong: #43554a;
  --accent: var(--forest-400);
  --accent-text: #08130d;
  --forest-100: #24382e;
  --amber-100: #3a2c14;
  --danger-100: #3b1d19;
  --on-forest-tint: #a8dcc2;
  --on-amber-tint: #f7c766;
  --on-danger-tint: #f5b8ae;
}
