/* --- Písmo: Inter, self-hostované (CSP nedovoluje externí zdroje).
       Latin-ext subset je nutný kvůli české diakritice. ------------------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/inter-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/inter-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Barvy a proměnné.
       Záměrně jen světlý režim: klienti sem chodí jednorázově a konzistentní,
       čistý vzhled buduje důvěru víc než respektování tmavého motivu. -------- */
:root {
  color-scheme: light;

  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-2: #f6f6fa;
  --border: #e7e8f0;
  --border-strong: #d5d7e3;

  --text: #171923;
  --muted: #555b6b;
  --faint: #6d7484;

  --primary: #5b4aec;
  --primary-hover: #4a39d8;
  --primary-soft: #edeafd;

  --green: #0e7a46;
  --green-soft: #e0f5e9;
  --amber: #935e05;
  --amber-soft: #fdf1d7;
  --red: #c53030;
  --red-soft: #fdecec;

  --r-card: 14px;
  --r-field: 10px;
  --shadow-card: 0 1px 3px rgba(23, 25, 35, .06), 0 1px 2px rgba(23, 25, 35, .04);
  --focus-ring: 0 0 0 3px rgba(91, 74, 236, .18);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 2.5rem 1rem 3.5rem;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: 640px; margin: 0 auto; }

/* --- Hlavička ---------------------------------------------------------- */
.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 2rem;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--primary);
  display: grid;
  place-items: center;
  flex: none;
}
.brand-mark svg { width: 17px; height: 17px; stroke: #fff; }
.brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }

.brand-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 500;
  white-space: nowrap;
}
.brand-pill svg { width: 13px; height: 13px; stroke: var(--green); flex: none; }

.page-head { margin-bottom: 1.4rem; }
.eyebrow {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 .45rem;
}
h1 { font-size: 1.65rem; margin: 0 0 .45rem; letter-spacing: -.025em; font-weight: 700; line-height: 1.25; }
h2 { font-size: 1.05rem; margin: 0; font-weight: 600; letter-spacing: -.01em; }
.sub { color: var(--muted); margin: 0; }

/* --- Karty ------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 1.6rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-card);
}
.card-top {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: 1.3rem;
}
.card-top .grow { flex: 1; min-width: 0; }
.card-top .sub { font-size: .88rem; margin-top: .1rem; }

.section-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 .65rem;
}

.divider { height: 1px; background: var(--border); margin: 1.4rem 0; border: 0; }

/* --- Ikonové dlaždice --------------------------------------------------- */
.iconchip {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--primary-soft);
}
.iconchip svg { width: 18px; height: 18px; stroke: var(--primary); }
.iconchip.green { background: var(--green-soft); }
.iconchip.green svg { stroke: var(--green); }
.iconchip.amber { background: var(--amber-soft); }
.iconchip.amber svg { stroke: var(--amber); }
.iconchip.red { background: var(--red-soft); }
.iconchip.red svg { stroke: var(--red); }
.iconchip.sm { width: 30px; height: 30px; border-radius: 8px; }
.iconchip.sm svg { width: 15px; height: 15px; }

svg { fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* --- Formulářová pole --------------------------------------------------- */
.field { margin-bottom: 1.3rem; }
.field:last-child { margin-bottom: 0; }
label { display: block; font-weight: 600; margin-bottom: .45rem; font-size: .92rem; }
.req { color: var(--red); }
.opt { color: var(--faint); font-weight: 400; font-size: .82rem; }
.hint { color: var(--muted); font-size: .84rem; margin-top: .4rem; display: block; line-height: 1.5; }

input[type="text"], input[type="password"], textarea {
  width: 100%;
  padding: .7rem .85rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-field);
  font: inherit;
  font-size: 16px; /* pod 16 px iOS Safari při fokusu zoomuje */
  transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: #9aa0b0; }
textarea {
  resize: vertical;
  min-height: 136px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.65;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

/* pole s heslem + tlačítko oka */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 2.9rem; }
.pwd-toggle {
  position: absolute;
  top: 50%;
  right: .35rem;
  transform: translateY(-50%);
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.pwd-toggle svg { width: 18px; height: 18px; stroke: var(--faint); }
.pwd-toggle:hover svg { stroke: var(--text); }
.pwd-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* --- Chipy pro volbu platnosti ------------------------------------------ */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label {
  margin: 0;
  padding: .5rem .95rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: .89rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  background: var(--surface);
  transition: border-color .12s, background .12s, color .12s;
  user-select: none;
}
.chips label:hover { border-color: var(--primary); color: var(--text); }
.chips input:checked + label {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.chips input:focus-visible + label { box-shadow: var(--focus-ring); }

/* --- Přepínač ----------------------------------------------------------- */
.switch-row {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1rem 1.05rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-field);
  cursor: pointer;
}
.switch-row .grow { flex: 1; min-width: 0; }
.switch-row strong { display: block; font-size: .92rem; font-weight: 600; }
.switch-row .hint { margin-top: .15rem; }
.switch { position: relative; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.track {
  display: block;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background .15s;
}
.track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transition: transform .15s;
}
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: var(--focus-ring); }

/* --- Tlačítka ----------------------------------------------------------- */
button {
  padding: .7rem 1.3rem;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: var(--r-field);
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}
button svg { width: 16px; height: 16px; stroke: currentColor; flex: none; }
button:hover:not(:disabled) { background: var(--primary-hover); }
button:disabled { opacity: .55; cursor: not-allowed; }
button:focus-visible { outline: none; box-shadow: var(--focus-ring), 0 0 0 1px #fff inset; }
button.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
button.secondary:hover:not(:disabled) { background: var(--surface-2); }
button.secondary.copied { color: var(--green); border-color: var(--green); }
button.danger { background: transparent; color: var(--red); border: 1px solid var(--border-strong); }
button.danger:hover:not(:disabled) { background: var(--red-soft); border-color: var(--red); }
button.small { padding: .45rem .85rem; font-size: .87rem; }
button.big { width: 100%; padding: .85rem 1.3rem; font-size: 1rem; min-height: 3rem; }

.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row-actions { margin-top: 1.4rem; }
.spacer { flex: 1; }

/* --- Hlášky -------------------------------------------------------------- */
.banner {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .85rem 1.05rem;
  border-radius: var(--r-field);
  margin-bottom: 1rem;
  font-size: .9rem;
  border: 1px solid transparent;
}
.banner.ok { background: var(--green-soft); color: var(--green); border-color: rgba(14, 122, 70, .25); }
.banner.err { background: var(--red-soft); color: var(--red); border-color: rgba(197, 48, 48, .25); }
.banner.warn { background: var(--amber-soft); color: var(--amber); border-color: rgba(147, 94, 5, .25); }
[hidden] { display: none !important; }

/* --- Výsledek: odkaz ------------------------------------------------------ */
.linkbox { display: flex; gap: .55rem; margin-bottom: 1.15rem; }
.linkbox input {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  background: var(--surface-2);
  color: var(--text);
}
.linkbox button { flex: none; }

.facts { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.facts li {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 0;
  font-size: .92rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.facts li:last-child { border-bottom: 0; }
.facts strong { color: var(--text); font-weight: 600; }

.notebox {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  background: var(--amber-soft);
  border: 1px solid rgba(147, 94, 5, .2);
  padding: .9rem 1.05rem;
  border-radius: var(--r-field);
  color: var(--amber);
  font-size: .88rem;
  line-height: 1.55;
  margin-bottom: 1.3rem;
}
.notebox svg { width: 17px; height: 17px; flex: none; margin-top: .15rem; stroke: var(--amber); }
.notebox strong { font-weight: 700; }

.infobox {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  background: var(--primary-soft);
  border: 1px solid rgba(91, 74, 236, .18);
  padding: .9rem 1.05rem;
  border-radius: var(--r-field);
  color: #453aa8;
  font-size: .88rem;
  line-height: 1.55;
  margin-bottom: 1.4rem;
}
.infobox svg { width: 17px; height: 17px; flex: none; margin-top: .15rem; stroke: var(--primary); }
.infobox strong { color: #32277e; font-weight: 600; }

pre.secret {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-field);
  padding: 1.05rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 1.1rem;
  user-select: all;
}

/* --- Kroky "jak to funguje" ---------------------------------------------- */
.steps {
  list-style: none;
  display: flex;
  gap: .5rem;
  padding: 0;
  margin: 1.2rem 0 0;
}
.steps li {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.45;
}
.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--faint);
  font-size: .72rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: none;
  margin-top: .05rem;
}

/* neviditelný pomocník pro záložní kopírování do schránky */
.copy-helper {
  position: fixed;
  top: -100px;
  left: 0;
  opacity: 0;
  pointer-events: none;
}

.state { text-align: center; padding: 1.5rem 0 .5rem; }
.state .iconchip { margin: 0 auto .9rem; width: 46px; height: 46px; border-radius: 13px; }
.state .iconchip svg { width: 22px; height: 22px; }
.state h2 { margin-bottom: .4rem; }
.state .sub { font-size: .92rem; }

footer {
  margin-top: 1.8rem;
  color: var(--faint);
  font-size: .81rem;
  text-align: center;
  line-height: 1.6;
}

@media (max-width: 560px) {
  body { padding: 1.5rem 1rem 3rem; }
  .card { padding: 1.3rem; }
  h1 { font-size: 1.4rem; }
  .brand { margin-bottom: 1.5rem; }
  .brand-pill { display: none; } /* na malém displeji jen zavazí */
  .linkbox { flex-direction: column; }
  .linkbox button { width: 100%; }
  .linkbox input { font-size: 16px; } /* proti iOS zoomu při fokusu */
  .steps { flex-direction: column; gap: .65rem; margin-top: 1rem; }
}
