/* -------------------------------------------------
   KyberScore – visual identity (cs‑CZ)
   ------------------------------------------------- */

/* ---- Root variables ---------------------------------------------------- */
:root {
  /* Palette */
  --color-primary: #4338ca;          /* buttons, links */
  --color-accent: #f59e0b;           /* decorative borders / highlights */
  --color-header-bg: #1e1b4b;        /* deep indigo */
  --color-bg: #ffffff;
  --color-text: #222222;

  /* Level colors (severity) */
  --level-1: #b91c1c;
  --level-2: #c2410c;
  --level-3: #a16207;
  --level-4: #15803d;
  --level-5: #047857;

  /* Typography & layout */
  --font-sans: "Segoe UI", system-ui, -apple-system,
               Roboto, sans-serif;
  --base-font-size: 17px;
  --line-height: 1.6;
  --gutter: 16px;                     /* horizontal padding */

  /* Misc */
  --focus-outline: 3px solid var(--color-primary);
}

/* ---- Dark mode ---------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #111111;
    --color-text: #eeeeee;
    --color-header-bg: #0d0a2b;      /* darker indigo for contrast */
  }
}

/* ---- Global reset ------------------------------------------------------- */
html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--base-font-size);
  line-height: var(--line-height);
}

/* ---- Focus outline ------------------------------------------------------ */
:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

/* ---- Header & navigation ------------------------------------------------ */
header {
  background: var(--color-header-bg);
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1rem;
  padding: var(--gutter) calc(var(--gutter) / 2);
}
header .brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
}
header .brand img {
  height: 32px;
  vertical-align: middle;
  margin-right: .5rem;
}
header nav {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1rem;
}
header nav a {
  color: #cbd5e1;
  text-decoration: none;
}
header nav a[aria-current],
header nav a:hover,
header nav a[aria-current="page"] {
  color: #fff;
  text-decoration: underline;
}

/* ---- Container ---------------------------------------------------------- */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---- Intro & lead ------------------------------------------------------- */
.intro h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  margin: .5rem 0;
}
.lead {
  font-size: 1.1rem;
}

/* ---- Buttons (primary) -------------------------------------------------- */
button,
a.button {
  display: inline-block;
  font: inherit;
  padding: .6rem 1.2rem;
  border: none;
  border-radius: 4px;
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  text-align: center;
}
button:hover,
a.button:hover,
button:focus,
a.button:focus {
  background: #312e81;               /* darker primary for hover/focus */
}
button[disabled],
button:disabled,
a.button[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
}

/* ---- Profile cards ------------------------------------------------------ */
.profile-card {
  border: 2px solid var(--color-accent);
  border-radius: 8px;
  padding: 1rem;
  margin: .5rem 0;
  background: transparent;
  min-height: 44px;                  /* WCAG tap target */
  display: flex;
  align-items: center;
  text-align: left;
}
.profile-card:hover,
.profile-card:focus-within {
  background: rgba(245,158,11,.08);   /* subtle amber highlight */
}

/* ---- Fieldset & form elements ------------------------------------------ */
fieldset {
  border: 2px solid var(--color-accent);
  border-radius: 6px;
  padding: .75rem;
  margin: 1rem 0;
}
legend {
  font-weight: 600;
  padding: 0 .5rem;
}
label {
  display: block;
  cursor: pointer;
}

/* Radio rows – each option wrapped in a div */
.radio-row {
  border: 1px solid #d1d5db;
  border-radius: 4px;
  margin-bottom: .5rem;
  padding: .5rem;
}
input[type=radio] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
input[type=radio]:checked + label {
  background: var(--color-primary);
  color: #fff;
}

/* ---- Step progress ------------------------------------------------------ */
.step-progress {
  margin: 1rem 0;
  font-weight: bold;
}

/* ---- Notices & warnings ------------------------------------------------- */
.notice {
  color: #b45309;
  font-weight: 600;
  min-height: 1.5em;
}
.warning {
  color: #b91c1c;
  font-weight: 600;
  border-left: 4px solid #b91c1c;
  padding-left: .75rem;
}

/* ---- Badges ------------------------------------------------------------- */
.badge {
  background: var(--color-accent);
  color: #fff;
  border-radius: 3px;
  padding: 0 .5rem;
  font-size: .8em;
  margin-left: .5rem;
}

/* ---- Area rows (scores) ------------------------------------------------- */
.area-row {
  display: flex;
  align-items: center;
  margin: .5rem 0;
}
.area-name { flex: 0 0 120px; }
.area-score {
  width: 50px;
  text-align: right;
  margin-left: .5rem;
}

/* ---- Progress element --------------------------------------------------- */
progress {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1rem;
  border-radius: .25rem;
  overflow: hidden;
}
progress::-webkit-progress-bar {
  background: #e5e7eb;
}
progress::-webkit-progress-value {
  background: var(--color-primary);
}
progress::-moz-progress-bar {
  background: var(--color-primary);
}

/* ---- Level colors ------------------------------------------------------- */
.level-1 { color: var(--level-1); }
.level-2 { color: var(--level-2); }
.level-3 { color: var(--level-3); }
.level-4 { color: var(--level-4); }
.level-5 { color: var(--level-5); }

/* ---- FAQ --------------------------------------------------------------- */
.faq details {
  border-bottom: 1px solid #94a3b855;
  padding: .5rem 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
}

/* ---- Message box -------------------------------------------------------- */
.zprava {
  border: 1px solid #94a3b8;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}
.zprava-header,
.zprava-predmet {
  font-weight: 600;
  margin-bottom: .5rem;
}
.zprava-text {
  white-space: pre-line;
}

/* ---- Correct / incorrect text ------------------------------------------ */
.spravne { color: #15803d; font-weight: 600; }
.spatne  { color: #b91c1c; font-weight: 600; }

/* ---- Footer ------------------------------------------------------------- */
footer {
  background: var(--color-header-bg);
  color: #fff;
  text-align: center;
  padding: .75rem;
}
footer a { color: inherit; }
footer .provozovatel {
  display: block;
  font-size: .85em;
}

/* ---- Cards grid ---------------------------------------------------------- */
.cards {
  display: grid;
  gap: var(--gutter);
  grid-template-columns: 1fr;
}
@media (min-width: 600px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
.card {
  border: 2px solid var(--color-accent);
  border-radius: 8px;
  padding: 1rem;
  background: transparent;
  text-decoration: none;
  color: inherit;
}
.card:hover,
.card:focus-within {
  background: rgba(245,158,11,.08);
}

/* ---- Print media -------------------------------------------------------- */
@media print {
  header nav,
  button,
  a.button,
  footer { display: none !important; }
}

/* ---- Reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* síť KyberKompas */
.sit { margin: 1rem 0; }
.sit-nazev { font-weight: 700; margin: 0 0 .25rem; }
.sit ul, ul.cards { list-style: none; padding: 0; margin: 0; }
.sit li { margin: .25rem 0; }
.co-dal { margin: 1.5rem 0; }
.co-dal .card a { font-weight: 700; }
.co-dal .card p { margin: .25rem 0 0; }

/* Brand manuál v1 (docs/brand-manual.md) – tokeny a komponenty */
:root { --color-bg:#f8f7fc; --color-surface:#fff; --color-text:#1f2937; --color-muted:#4b5563; --color-line:#e2e0f0; --color-on-primary:#fff; --color-primary:#4338ca; --color-primary-hover:#3730a3; --color-accent:#f59e0b; --color-accent-text:#b45309; --radius:12px;
  --font-sans: system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue","Noto Sans","Liberation Sans",Arial,sans-serif;
  --level-1:#b91c1c; --level-2:#c2410c; --level-3:#a16207; --level-4:#15803d; --level-5:#047857; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --color-bg:#0f0e24; --color-surface:#1a1838; --color-text:#e5e7eb; --color-muted:#9ca3af; --color-line:#2e2b55; --color-header-bg:#0f0e24; --color-primary:#a5b4fc; --color-primary-hover:#c7d2fe; --color-on-primary:#0f0e24; --color-accent:#fbbf24; --color-accent-text:#fbbf24; --level-1:#f87171; --level-2:#fb923c; --level-3:#facc15; --level-4:#4ade80; --level-5:#34d399; } }
:root[data-theme="dark"] { --color-bg:#0f0e24; --color-surface:#1a1838; --color-text:#e5e7eb; --color-muted:#9ca3af; --color-line:#2e2b55; --color-header-bg:#0f0e24; --color-primary:#a5b4fc; --color-primary-hover:#c7d2fe; --color-on-primary:#0f0e24; --color-accent:#fbbf24; --color-accent-text:#fbbf24; }
body { background: var(--color-bg); color: var(--color-text); font-family: var(--font-sans); }
a { color: var(--color-primary); }
header a, header nav a, footer a { color: inherit; }
button, a.button { min-height: 48px; padding: 0 24px; border-radius: 8px; font-weight: 600; background: var(--color-primary); color: var(--color-on-primary); border: 2px solid var(--color-primary); cursor: pointer; margin: .25rem .5rem .25rem 0; }
button:hover, a.button:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.profile-card { display: block; width: 100%; text-align: left; background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-line); border-top: 4px solid transparent; border-radius: var(--radius); padding: 16px 20px; margin: 0 0 12px; font-weight: 400; }
button.profile-card:hover, button.profile-card:focus-visible { background: var(--color-surface); border-top-color: var(--color-accent); }
header nav a[aria-current="page"] { text-decoration-color: var(--color-accent); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.card, fieldset, .zprava { background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius); }
.card { border-top: 4px solid transparent; padding: 16px 20px; }
.card:hover, .card:focus-within { border-top-color: var(--color-accent); }
.badge { background: var(--color-accent); color: #1e1b4b; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; border-radius: 999px; padding: 2px 8px; margin-left: .5rem; }
progress { height: 10px; border-radius: 999px; background: var(--color-line); }
progress::-webkit-progress-bar { background: var(--color-line); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--color-primary); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--color-primary); border-radius: 999px; }
.area-score, .step-progress { font-variant-numeric: tabular-nums; color: var(--color-muted); }
p, li { max-width: 68ch; }
.lead { color: var(--color-muted); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* KyberKompas – hlavní výzva */
.kk-box { background: var(--color-surface); border: 2px solid var(--color-primary); border-left: 8px solid var(--color-accent); border-radius: var(--radius); padding: 20px 24px; margin: 24px 0; }
.kk-box h2, .kk-box h3 { margin: .25rem 0 .5rem; }
.kk-eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-accent-text); margin: 0; }
.kk-box a.button { color: var(--color-on-primary); }

/* KyberScore v2 – grafy a hodnocení organizace */
svg .lvl-1 { fill: var(--level-1); stroke: var(--level-1); }
svg .lvl-2 { fill: var(--level-2); stroke: var(--level-2); }
svg .lvl-3 { fill: var(--level-3); stroke: var(--level-3); }
svg .lvl-4 { fill: var(--level-4); stroke: var(--level-4); }
svg .lvl-5 { fill: var(--level-5); stroke: var(--level-5); }
svg path.lvl-1, svg path.lvl-2, svg path.lvl-3, svg path.lvl-4, svg path.lvl-5, svg path.ch-track { fill: none; }
svg rect.lvl-1, svg rect.lvl-2, svg rect.lvl-3, svg rect.lvl-4, svg rect.lvl-5 { stroke: none; }
svg .ch-track { stroke: var(--color-line); fill: var(--color-line); }
svg .ch-grid { stroke: var(--color-line); fill: none; }
svg .ch-axis { stroke: var(--color-text); fill: var(--color-text); }
svg .ch-label { fill: var(--color-muted); font-family: var(--font-sans); }
svg .ch-value, svg .ch-num { fill: var(--color-text); font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
svg .ch-num { font-weight: 800; }
svg .ch-area { fill: var(--color-primary); fill-opacity: .18; stroke: var(--color-primary); stroke-width: 2; }
svg .ch-muted { fill: var(--color-line); stroke: var(--color-line); }
svg .ch-cell-id, svg .ch-cell-num { fill: #fff; font-family: var(--font-sans); }
svg .ch-cell-num { font-weight: 800; }
#app-v2 section { margin: 2rem 0; }
#app-v2 section > svg { max-width: 560px; display: block; margin: .5rem auto; }
.vysledek-hlavni svg { max-width: 360px; }
.stupen { display: inline-block; padding: .25rem .75rem; border: 2px solid var(--color-primary); border-radius: 999px; font-weight: 600; }
fieldset.otazka { padding: 1rem; margin: 0 0 1rem; }
.napoveda { color: var(--color-muted); font-size: .95rem; }
.kotvy > div, .kotvy label { display: block; }
.kotvy label { padding: .5rem .75rem; border: 1px solid var(--color-line); border-radius: 8px; margin: .25rem 0; cursor: pointer; }
.kotvy label:has(input:checked) { border-color: var(--color-primary); outline: 2px solid var(--color-primary); }
.kotvy input { accent-color: var(--color-primary); margin-right: .25rem; }
#app-v2 table { width: 100%; border-collapse: collapse; }
#app-v2 td, #app-v2 th { text-align: left; padding: .4rem; border-bottom: 1px solid var(--color-line); }
tr.chybi td:last-child { color: var(--level-1); font-weight: 700; }
tr.ok td:last-child { color: var(--level-4); font-weight: 700; }
@media print { #app-v2 section { break-inside: avoid; } }

.warning { color: var(--level-1); border-left-color: var(--level-1); }
#app-v2 .warning { font-weight: 600; }

/* Účet */
#ucet form { display: grid; gap: .5rem; max-width: 420px; margin: 1rem 0; }
#ucet input[type=email], #ucet input[type=password], #ucet input[type=text] { font: inherit; padding: .6rem .75rem; border: 1px solid var(--color-line); border-radius: 8px; background: var(--color-surface); color: var(--color-text); }
code.klic { font-size: 1.15rem; letter-spacing: .08em; word-break: break-all; }
ol.zalozni code { font-size: 1.05rem; }
.ulozeni select { font: inherit; padding: .4rem; margin: .25rem .5rem .5rem 0; }

figure.vyvoj { margin: 1rem 0; max-width: 520px; }
figure.vyvoj figcaption { font-weight: 600; margin-bottom: .25rem; }
