:root {
    --blue: #7FB8E0;        /* bledomodrá z loga */
    --blue-soft: #E6F1FA;
    --blue-deep: #2F6F9F;   /* tmavší odtieň pre text a fokus */
    --grey: #6B7280;
    --grey-light: #D5D9DE;
    --grey-bg: #F3F4F6;
    --ink: #1F2933;
    --white: #FFFFFF;
    --error: #B42318;
    --radius: 6px;
  }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    font-family: "Barlow", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--grey-bg);
  }

  /* Hlavička */
  header {
    background: var(--white);
    border-bottom: 4px solid var(--blue);
  }
  .header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .logo {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--blue);
    display: grid; place-items: center;
    color: var(--white);
    font-family: "Barlow Semi Condensed", sans-serif;
    font-weight: 700;
  }
  header h1 {
    margin: 0;
    font-family: "Barlow Semi Condensed", sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
  }
  header p { margin: 0; color: var(--grey); font-size: 0.95rem; }

  /* Rozloženie */
  .layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 80px;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    align-items: start;
  }

  /* Bočná navigácia */
  nav {
    position: sticky;
    top: 24px;
  }
  nav ol {
    list-style: none;
    margin: 0; padding: 0;
    counter-reset: step;
    border-left: 2px solid var(--grey-light);
  }
  nav li { counter-increment: step; }
  nav a {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    margin-left: -2px;
    border-left: 2px solid transparent;
    color: var(--grey);
    text-decoration: none;
    font-weight: 500;
  }
  nav a::before {
    content: counter(step);
    width: 22px; height: 22px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--grey-light);
    color: var(--white);
    font-size: 0.8rem;
    display: grid; place-items: center;
  }
  nav a:hover { color: var(--ink); }
  nav a.active {
    color: var(--blue-deep);
    border-left-color: var(--blue);
  }
  nav a.active::before { background: var(--blue); }
  nav a.done::before { content: "✓"; background: var(--blue-deep); }

  /* Bloky formulára */
  fieldset {
    margin: 0 0 24px;
    padding: 0;
    border: 1px solid var(--grey-light);
    border-radius: var(--radius);
    background: var(--white);
    scroll-margin-top: 24px;
  }
  legend {
    float: left;
    width: 100%;
    padding: 16px 24px;
    background: var(--blue-soft);
    border-bottom: 1px solid var(--grey-light);
    border-radius: var(--radius) var(--radius) 0 0;
    font-family: "Barlow Semi Condensed", sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--blue-deep);
  }
  legend span {
    display: block;
    font-family: "Barlow", sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--grey);
  }
  .grid {
    clear: both;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 18px 20px;
    padding: 24px;
  }
  .f { grid-column: span 2; display: flex; flex-direction: column; gap: 6px; }
  .f.w3 { grid-column: span 3; }
  .f.w4 { grid-column: span 4; }
  .f.w6 { grid-column: span 6; }

  label { font-weight: 500; font-size: 0.95rem; }
  label .req { color: var(--blue-deep); }

  input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    font: inherit;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--grey-light);
    border-radius: var(--radius);
    transition: border-color .15s, box-shadow .15s;
  }
  textarea { min-height: 90px; resize: vertical; }
  input:hover, select:hover, textarea:hover { border-color: var(--grey); }
  input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--blue-deep);
    box-shadow: 0 0 0 3px var(--blue-soft);
  }

  /* Pole s jednotkou */
  .unit { position: relative; }
  .unit input { padding-right: 56px; }
  .unit::after {
    content: attr(data-unit);
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--grey);
    font-size: 0.9rem;
    pointer-events: none;
  }

  .hint { font-size: 0.85rem; color: var(--grey); }
  .error-msg { font-size: 0.85rem; color: var(--error); display: none; }
  .invalid input, .invalid select { border-color: var(--error); }
  .invalid .error-msg { display: block; }

  /* Päta s tlačidlami */
  .actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 8px;
  }
  button {
    font: inherit;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--radius);
    cursor: pointer;
    border: 1px solid transparent;
  }
  .btn-primary { background: var(--blue-deep); color: var(--white); }
  .btn-primary:hover { background: #255B83; }
  .btn-secondary { background: var(--white); color: var(--grey); border-color: var(--grey-light); }
  .btn-secondary:hover { color: var(--ink); border-color: var(--grey); }
  button:focus-visible, nav a:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
  }

  .toast {
    position: fixed;
    bottom: 24px; right: 24px;
    padding: 14px 20px;
    background: var(--ink);
    color: var(--white);
    border-radius: var(--radius);
    border-left: 4px solid var(--blue);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .2s, transform .2s;
    pointer-events: none;
  }
  .toast.show { opacity: 1; transform: none; }

  /* Mobil */
  @media (max-width: 860px) {
    .layout { grid-template-columns: 1fr; padding-top: 16px; }
    nav { display: none; }
    .f, .f.w3, .f.w4 { grid-column: span 6; }
    .grid { padding: 18px; }
    legend { padding: 14px 18px; }
    .actions { flex-direction: column-reverse; }
    button { width: 100%; }
  }
  @media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
  }
  html { scroll-behavior: smooth; }