/* Moja Ruka design tokens, direction "Crvena i žuta" (design/direction.md, approved 2026-11-26),
   restyled in M16 (Harun, 2026-11-28): the logo's red and yellow, a red top on every screen,
   the wallpaper of topic icons behind the content, rounder cards (design/screens.md).
   Edit only this file to change the whole look; design/tokens.css is the same file kept with
   the design notes. --color-top is repeated in app/core/templates.py (manifest and the
   phone's status bar; a test compares them). Organization colours (content, not tokens) are in app.css. Light is the main theme; dark follows the
   phone setting. Components use only these variables. */
:root {
  color-scheme: light;

  --color-paper: #faf5f2; /* the page, under the wallpaper */
  --color-surface: #ffffff;
  --color-raised: #ffffff;
  --color-ink: #1c1414;
  --color-muted: #5a4e4e;
  --color-line: #e4dcd6;
  --color-field: #7a6e6e;
  --color-brand: #af101d; /* the logo's red */
  --color-on-brand: #ffffff;
  --color-on-org: #ffffff; /* text on an organization's colour (logo squares), both themes */
  --color-brand-soft: #fce8eb;
  --color-accent: #f8ad1e; /* the logo's yellow: only the one main button of a screen */
  --color-on-accent: #1c1414;
  --color-error: #7a0c1c;
  --color-error-soft: #f6dfe2;
  /* A soft yellow for things the organizer does in one go ("Označi sve odjednom"). */
  --color-accent-soft: #fff3d1;
  --color-accent-line: #d18f00; /* the pressed edge under the yellow button */
  /* The red top of every screen (app bar and the screen's title block). */
  --color-top: #af101d;
  --color-on-top: #ffffff;
  --color-top-accent: #f8ad1e; /* one word of a big title on the top ("danas?"), 3:1 */
  /* Marks of other services, only for their icons (same in both themes). */
  --color-telegram: #229ed9;
  --color-telegram-strong: #17698f; /* white text on it: 5.6:1 */
  --color-viber: #7360f2;
  --color-whatsapp: #25d366;

  --font-heading: "Zilla Slab", Rockwell, "Roboto Slab", Georgia, serif;
  --font-text: Onest, "Segoe UI", system-ui, sans-serif;

  --size-small: 0.8125rem; /* 13 */
  --size-body: 1rem; /* 16 */
  --font-size-body: 16px;
  --size-lead: 1.1875rem; /* 19 */
  --size-h3: 1.4375rem; /* 23 */
  --size-h2: 1.875rem; /* 30 */
  --size-h1: 2.5rem; /* 40 */
  --size-display: 3.5rem; /* 56 */
  --leading-text: 1.6;
  --leading-heading: 1.15;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  --radius: 6px; /* small things: tags, chips */
  --radius-control: 12px; /* buttons, fields, day chips, tabs */
  --radius-card: 16px; /* action cards and white panels on the wallpaper */
  --radius-sheet: 22px; /* the top of bottom sheets and of the list over the red top */
  --radius-round: 999px;
  --border: 1px solid var(--color-line);
  --border-field: 1px solid var(--color-field);
  --focus-ring: 3px solid var(--color-brand);
  --shadow-bar: 0 -1px 0 var(--color-line), 0 -6px 16px rgb(28 20 20 / 0.08);
  --shadow-panel: 0 0 0 1px var(--color-line); /* a white panel on the wallpaper */
  --shadow-logo: 0 0 0 3px var(--color-surface), 0 2px 8px rgb(0 0 0 / 0.18);
  --shadow-lift: 0 6px 16px rgb(0 0 0 / 0.12); /* a white card on the red top */
  --shadow-on-top: 0 0 0 3px rgb(255 255 255 / 0.5); /* a ring around a picture on the red */

  /* "Tapeta od ikonica tema" (variant 3), drawn by scripts/make_brand_assets.py. */
  --wallpaper: url("../img/tapeta.svg");

  /* A full action: its card turns this grey (white text on it: 5.3:1), both themes. */
  --color-full-card: #776b6b;

  /* Topic patterns on the coloured part of an action card (white lines, the same in both
     themes). Each topic picks one in app.css; the organization's colour is under it. */
  --pat-dots: radial-gradient(rgb(255 255 255 / 0.22) 2px, transparent 2.5px) 0 0 / 12px 12px;
  --pat-zigzag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='12'%3E%3Cpath d='M0 9 L6 3 L12 9 L18 3 L24 9' fill='none' stroke='white' stroke-opacity='.25' stroke-width='2.5'/%3E%3C/svg%3E") 0 0 / 24px 12px;
  --pat-stripes: repeating-linear-gradient(-45deg, rgb(255 255 255 / 0.16) 0 6px, transparent 6px 14px);
  --pat-paws: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Cg fill='white' fill-opacity='.22'%3E%3Ccircle cx='6' cy='6' r='1.8'/%3E%3Ccircle cx='10' cy='3.5' r='1.8'/%3E%3Ccircle cx='14' cy='6' r='1.8'/%3E%3Cellipse cx='10' cy='10' rx='3.2' ry='2.6'/%3E%3Ccircle cx='24' cy='24' r='1.8'/%3E%3Ccircle cx='28' cy='21.5' r='1.8'/%3E%3Ccircle cx='32' cy='24' r='1.8'/%3E%3Cellipse cx='28' cy='28' rx='3.2' ry='2.6'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 36px 36px;
  --pat-waves: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='16'%3E%3Cpath d='M0 8 Q8 0 16 8 T32 8' fill='none' stroke='white' stroke-opacity='.25' stroke-width='2.5'/%3E%3C/svg%3E") 0 0 / 32px 16px;
  --pat-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Cpath d='M11 6v10M6 11h10' stroke='white' stroke-opacity='.24' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") 0 0 / 22px 22px;
  --pat-grid: linear-gradient(rgb(255 255 255 / 0.15) 1.5px, transparent 1.5px) 0 0 / 16px 16px, linear-gradient(90deg, rgb(255 255 255 / 0.15) 1.5px, transparent 1.5px) 0 0 / 16px 16px;
  --pat-rings: radial-gradient(circle, transparent 3.5px, rgb(255 255 255 / 0.2) 4px 6px, transparent 6.5px) 0 0 / 18px 18px;
  --pat-chevrons: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='14'%3E%3Cpath d='M3 10l7-6 7 6' fill='none' stroke='white' stroke-opacity='.24' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 0 0 / 20px 14px;
  --pat-confetti: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Cg stroke='white' stroke-opacity='.26' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M5 8l4-3M20 6l3 4M14 18l-4 3M24 22l3-3'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 30px 30px;
  --pat-checks: conic-gradient(rgb(255 255 255 / 0.12) 25%, transparent 0 50%, rgb(255 255 255 / 0.12) 0 75%, transparent 0) 0 0 / 20px 20px;
  --pat-specks: radial-gradient(rgb(255 255 255 / 0.2) 1.5px, transparent 2px) 0 0 / 10px 10px;

  --tap-target: 44px;
  --tap-primary: 48px;
  --reading-width: 38rem;
  --page-width: 72rem;

  --motion-press: 100ms;
  --motion-state: 160ms;
  --motion-exit: 110ms;
  --motion-joy: 300ms; /* the check that draws itself */
  --motion-celebrate: 600ms; /* the flip of a milestone */
  --motion-page: 320ms; /* one page into the next, the opening screen lifting */
  --motion-loop: 900ms; /* one wave of the hand ("Šaljem…", the opening screen) */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-back: cubic-bezier(0.3, 1.5, 0.5, 1); /* a small overshoot: a sticker landing */
}

/* Dark theme (Harun, 2026-11-26): light is the default. The person chooses in "Izgled":
   data-theme="dark" always, data-theme="system" follows the phone. Same values twice. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --color-paper: #140e0f;
  --color-surface: #1e1617;
  --color-raised: #271d1e;
  --color-ink: #f1e9e9;
  --color-muted: #bbaaab;
  --color-line: #3d2f30;
  --color-field: #8f8081;
  --color-brand: #ff8a94;
  --color-on-brand: #140e0f;
  --color-brand-soft: #3a1d22;
  --color-accent: #ffc94d;
  --color-on-accent: #140e0f;
  --color-error: #ffb3bb;
  --color-error-soft: #4a1d24;
  --color-accent-soft: #33280f;
  --color-accent-line: #8a6a12;
  --color-top: #4a1219;
  --color-on-top: #f1e9e9;
  --color-top-accent: #ffc94d;
  --shadow-bar: 0 -1px 0 var(--color-line);
  --shadow-panel: 0 0 0 1px var(--color-line);
  --shadow-logo: 0 0 0 3px var(--color-surface);
  --wallpaper: url("../img/tapeta-dark.svg");
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --color-paper: #140e0f;
    --color-surface: #1e1617;
    --color-raised: #271d1e;
    --color-ink: #f1e9e9;
    --color-muted: #bbaaab;
    --color-line: #3d2f30;
    --color-field: #8f8081;
    --color-brand: #ff8a94;
    --color-on-brand: #140e0f;
    --color-brand-soft: #3a1d22;
    --color-accent: #ffc94d;
    --color-on-accent: #140e0f;
    --color-error: #ffb3bb;
    --color-error-soft: #4a1d24;
    --color-accent-soft: #33280f;
    --color-accent-line: #8a6a12;
    --color-top: #4a1219;
    --color-on-top: #f1e9e9;
    --color-top-accent: #ffc94d;
    --shadow-bar: 0 -1px 0 var(--color-line);
    --shadow-panel: 0 0 0 1px var(--color-line);
    --shadow-logo: 0 0 0 3px var(--color-surface);
    --wallpaper: url("../img/tapeta-dark.svg");
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-press: 0ms;
    --motion-state: 0ms;
    --motion-exit: 0ms;
    --motion-joy: 0ms;
    --motion-celebrate: 0ms;
    --motion-page: 0ms;
  }
}
