/* Automatiko - základ dizajnového systému (manuál v3, A4-A8, A10).
   Spoločný pre web, klientskú zónu aj administráciu. */

:root {
  --ink: #0E1F1A;
  --ink-2: #2B3A35;
  --grey: #5D6862;
  --line: #E2DCCF;
  --paper: #F6F3EC;
  --white: #FFFFFF;
  --sand: #EDE7DA;
  --signal: #FF6B2C;
  --signal-dark: #B8441A;
  --signal-light: #FFE7DA;
  --moss: #2E6B57;
  --moss-light: #DCEBE3;
  --error: #B42318;
  --error-light: #FDECEA;

  --f-head: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --f-text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --r-tag: 4px;
  --r-btn: 10px;
  --r-card: 10px;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  --content: 1200px;
  --gutter: 56px;
  --section: 96px;
  --card-pad: 28px;
  --header-h: 76px;
}

@media (max-width: 1100px) { :root { --gutter: 32px; } }
@media (max-width: 760px) { :root { --gutter: 20px; --section: 64px; --card-pad: 20px; --header-h: 64px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
img { height: auto; display: block; }
a { color: inherit; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s6) 0; }

h1, h2, h3, h4 { font-family: var(--f-head); color: var(--ink); margin: 0 0 var(--s4); font-weight: 800; letter-spacing: -0.015em; }
h1 { font-size: 68px; line-height: 1.02; }
h2 { font-size: 44px; line-height: 1.08; }
h3 { font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: -0.005em; }
h4 { font-size: 18px; line-height: 1.3; font-weight: 700; }
.h1-sm { font-size: 52px; }
.lead { font-size: 20px; line-height: 1.45; color: var(--ink-2); max-width: 62ch; }
.small { font-size: 14px; line-height: 1.5; }
.muted { color: var(--grey); }
.mono { font-family: var(--f-mono); font-weight: 500; }
.nowrap { white-space: nowrap; }
.prose { max-width: 68ch; }
.prose h2 { font-size: 30px; margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .4em; }

@media (max-width: 1100px) { h1 { font-size: 52px; } h2 { font-size: 36px; } }
@media (max-width: 760px) {
  h1 { font-size: 40px; line-height: 1.05; }
  .h1-sm { font-size: 34px; }
  h2 { font-size: 30px; }
  h3 { font-size: 20px; }
  .lead { font-size: 18px; }
}

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -60px; background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: var(--r-btn); z-index: 200; text-decoration: none; }
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid #0E1F1A; outline-offset: 2px; box-shadow: 0 0 0 6px #FFE7DA; border-radius: 4px; }

.ic { flex: none; vertical-align: middle; }

/* ------------------------------------------------------------ layout */
.wrap { max-width: calc(var(--content) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: calc(820px + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section) 0; }
.section-tight { padding: calc(var(--section) * .6) 0; }
.bg-paper { background: var(--paper); }
.bg-white { background: var(--white); }
.bg-sand { background: var(--sand); }
.bg-ink { background: var(--ink); color: var(--paper); }
.bg-ink h2, .bg-ink h3 { color: var(--paper); }
.bg-signal { background: var(--signal); color: var(--ink); }
.section-head { max-width: 760px; margin-bottom: var(--s7); }
.section-head p { color: var(--ink-2); font-size: 19px; }
.grid { display: grid; gap: 24px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } }
.stack > * + * { margin-top: var(--s4); }
.row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: var(--s4); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.mt-0 { margin-top: 0 !important; } .mt-2 { margin-top: var(--s2); } .mt-4 { margin-top: var(--s4); } .mt-5 { margin-top: var(--s5); } .mt-6 { margin-top: var(--s6); } .mt-7 { margin-top: var(--s7); }
.mb-0 { margin-bottom: 0 !important; } .mb-4 { margin-bottom: var(--s4); } .mb-6 { margin-bottom: var(--s6); }

/* ------------------------------------------------------------ tlačidlá (A8) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border-radius: var(--r-btn);
  font-family: var(--f-text); font-weight: 600; font-size: 17px; line-height: 1.2;
  text-decoration: none; border: 1.5px solid transparent; transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--signal); color: var(--ink); }
.btn-primary:hover { background: var(--ink); color: var(--paper); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: var(--paper); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: var(--ink-2); }
.bg-ink .btn-secondary { color: var(--paper); border-color: var(--paper); }
.bg-ink .btn-secondary:hover { background: var(--paper); color: var(--ink); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
@media (max-width: 760px) { .btn { min-height: 56px; } .btn-sm { min-height: 44px; } }

.link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: 4px; font-weight: 500; }
.link:hover { text-decoration-color: var(--ink); }
.linkish { background: none; border: 0; padding: 0; color: var(--signal-dark); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.btn-text { background: none; border: 0; padding: 8px 0; color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ------------------------------------------------------------ štítky */
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-tag);
  font-family: var(--f-mono); font-weight: 500; font-size: 13px; letter-spacing: .02em; line-height: 1.3;
  background: var(--sand); color: var(--ink-2); white-space: nowrap;
}
.tag-saving { background: var(--moss-light); color: var(--moss); }
.tag-signal { background: var(--signal-light); color: var(--signal-dark); }
.tag-ink { background: var(--ink); color: var(--paper); }
.tag-line { background: transparent; border: 1px solid var(--line); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* ------------------------------------------------------------ karty */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--card-pad); }
.card-sand { background: var(--sand); border-color: transparent; }
.card h3 { margin-bottom: 8px; }
.card-link { text-decoration: none; display: block; transition: border-color .15s; }
.card-link:hover { border-color: var(--ink); }

/* ------------------------------------------------------------ formuláre */
.field { display: block; margin-bottom: var(--s5); }
.field > label, .field-label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 8px; color: var(--ink); }
.field .hint { font-size: 14px; color: var(--grey); margin: -4px 0 8px; }
input:not([type]), input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], input[type="search"], input[type="date"], input[type="url"], select, textarea {
  width: 100%; min-height: 56px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--r-btn);
  background: var(--white); font-size: 17px; line-height: 1.4; color: var(--ink); appearance: none; -webkit-appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230E1F1A' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 44px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 4px var(--signal-light); }
input[disabled], select[disabled], textarea[disabled] { background: var(--paper); color: var(--grey); }
.field-error input, .field-error select, .field-error textarea, input[aria-invalid="true"] { border-color: var(--error); }
.error-text { color: var(--error); font-size: 14px; margin-top: 6px; display: flex; gap: 6px; align-items: flex-start; }
.form-note { font-size: 14px; color: var(--grey); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 18px; border-radius: var(--r-btn);
  border: 1.5px solid var(--line); background: var(--white); font-weight: 500; font-size: 16px; cursor: pointer; user-select: none;
}
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip input:focus-visible + span { outline: 3px solid #0E1F1A; outline-offset: 2px; }
.chip input:disabled + span { opacity: .6; cursor: default; }
.chip-add input { min-height: 48px; width: 150px; padding: 10px 14px; font-size: 15px; }

.alert { display: flex; gap: 12px; padding: 14px 18px; border-radius: var(--r-card); background: var(--sand); margin-bottom: var(--s5); align-items: flex-start; }
.alert-ok { background: var(--moss-light); color: var(--ink); }
.alert-warn { background: var(--signal-light); }
.alert-error { background: var(--error-light); color: var(--error); }

/* ------------------------------------------------------------ stavy (F2) */
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.status::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--grey); flex: none; }
.status-ok::before { background: var(--moss); }
.status-warn::before { background: var(--signal); }
.status-wait::before { background: var(--signal); }
.status-trial::before, .status-muted::before { background: transparent; border: 2px solid var(--grey); width: 8px; height: 8px; }
.status-trial::before { border-color: var(--moss); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--grey); vertical-align: middle; margin-right: 6px; }
.dot-ok { background: var(--moss); } .dot-warn { background: var(--signal); } .dot-muted { background: transparent; border: 2px solid var(--grey); }

/* ------------------------------------------------------------ prepínač */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; min-height: 48px; position: relative; }
.switch input { position: absolute; opacity: 0; width: 48px; height: 28px; margin: 0; }
.switch-ui { width: 48px; height: 28px; border-radius: 14px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--white); transition: transform .15s; }
.switch input:checked + .switch-ui { background: var(--moss); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid #0E1F1A; outline-offset: 2px; }

/* ------------------------------------------------------------ tabuľky */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; font-size: 15px; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-weight: 600; color: var(--grey); font-size: 13px; text-transform: none; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ FAQ (komponent 11) */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 48px 22px 0; position: relative;
  font-family: var(--f-head); font-weight: 700; font-size: 20px; line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 8px; top: 18px; font-family: var(--f-text); font-weight: 400; font-size: 28px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq .faq-a { padding: 0 0 22px; color: var(--ink-2); max-width: 68ch; }

/* ------------------------------------------------------------ chybová stránka */
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 48px 20px; }
.error-page h1 { font-size: 44px; }

/* dlhé texty tlačidiel na mobile sa zalomia, nikdy nepretečú */
@media (max-width: 760px) {
  .btn { white-space: normal; text-align: center; line-height: 1.25; padding-top: 10px; padding-bottom: 10px; max-width: 100%; }
  .hero-actions .btn { width: 100%; }
}
@media (max-width: 760px) { .tag { white-space: normal; } }
.grid > * { min-width: 0; }
