/* Dizajn „D – tlačivo“: farby CREATIVE sites, písaný text veľkým širokým písmom Archivo */
:root {
  --ink: #262626;
  --ink-soft: #6a7071;
  --granite: #f5f7f7;
  --paper: #ffffff;
  --rule: #c9d0d0;
  --line: #dde2e2;
  --flame: #ed4f00;
  --ore: #f98200;
  --ore-text: #c25f00;
  --ore-soft: #feecd6;
  --sun: #ffc127;
  --ember: #d20000;
  --ember-soft: #fbdede;
  --moss: #3f7a26;
  --moss-soft: #e3f3da;
  --ui: "Montserrat", "Segoe UI", Arial, sans-serif;
  --display: "Archivo", "Arial Black", sans-serif;
  color-scheme: only light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--granite);
  color: var(--ink);
  font: 500 17px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
h1, h2, p { margin: 0; }
button { font: inherit; cursor: pointer; color: inherit; -webkit-tap-highlight-color: transparent; }

/* ===== Lišta ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: calc(14px + env(safe-area-inset-top)) 28px 14px;
  background: var(--paper);
}
/* Logo má v obrázku bielu dosku (okraj 8/155 šírky) – záporný okraj ho zarovná ako predtým */
.logo { width: 137px; height: auto; display: block; margin: -6px 0 -6px -6px; }
.title { font-family: var(--display); font-weight: 800; font-stretch: 115%; font-size: 23px; letter-spacing: -.005em; text-align: center; }
.admin-btn { justify-self: end; position: relative; width: 48px; height: 48px; border: 0; border-radius: 50%; background: transparent; color: #b8bfbf; }
.admin-btn svg { width: 22px; height: 22px; fill: currentColor; }
.admin-btn:active { background: var(--granite); }
.dot { position: absolute; top: 10px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--ore); }
.dot.err { background: var(--ember); }

/* ===== List s formulárom ===== */
.wrap { flex: 1; display: flex; align-items: center; padding: 0 16px; }
.sheet { width: 100%; max-width: 860px; margin: 28px auto; padding: 40px 48px 36px; background: var(--paper); border-radius: 6px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px 40px; }
.full { grid-column: 1 / -1; }

.field { margin: 0; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend { display: block; padding: 0; margin: 0; font-size: 14px; font-weight: 700; color: var(--ink-soft); transition: color .15s; }
.field small { font-weight: 500; }
.field:focus-within > label { color: var(--flame); }
.field.invalid > label { color: var(--ember); }
.field-error { margin: 6px 0 0; font-size: 14px; font-weight: 600; color: var(--ember); }
.field-error[hidden] { display: none; }

/* Pole ako tlačivo: bez rámčeka, iba linka; písaný text veľkým širokým písmom */
.line {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 8px 0 6px;
  border: 0;
  border-radius: 0;
  border-bottom: 2px solid var(--rule);
  background: transparent;
  outline: none;
  font-family: var(--display);
  font-weight: 600;
  font-stretch: 108%;
  font-size: 26px;
  line-height: 1.25;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.line:focus { border-bottom-color: var(--flame); box-shadow: 0 2px 0 0 var(--flame); }
.field.invalid .line { border-bottom-color: var(--ember); }
textarea.line { min-height: 64px; resize: vertical; font-size: 22px; }

.choice { display: flex; gap: 10px; margin-top: 12px; }
.choice label { position: relative; flex: 1; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  border-radius: 999px;
  border: 1.5px solid var(--rule);
  font-weight: 600;
  font-size: 18px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.choice .yes input:checked + span { background: var(--ore); border-color: var(--ore); }
.choice .maybe input:checked + span { background: var(--sun); border-color: var(--sun); }
.choice .no input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.choice input:focus-visible + span { box-shadow: 0 0 0 4px rgb(249 130 0 / .3); }

.save {
  display: block;
  width: 100%;
  min-height: 66px;
  margin-top: 36px;
  border: 0;
  border-radius: 22px 22px 4px 22px; /* jeden ostrý roh ako lupeň v logu */
  background: var(--flame);
  color: #fff;
  font: 700 20px var(--ui);
}
.save:active { background: var(--ember); }
.save:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.gdpr { margin-top: 14px; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.gdpr a { color: var(--ink); }

@media (max-width: 720px) {
  .topbar { grid-template-columns: 1fr auto; padding: calc(10px + env(safe-area-inset-top)) 12px 12px 16px; row-gap: 8px; }
  .logo { width: 115px; margin: -5px 0 -5px -5px; }
  .title { grid-column: 1 / -1; grid-row: 2; text-align: left; font-size: 21px; }
  .wrap { padding: 0 10px; align-items: flex-start; }
  .sheet { margin: 12px 0 24px; padding: 24px 18px 22px; }
  .grid { grid-template-columns: 1fr; gap: 26px; }
  .line { font-size: 22px; }
}

/* ===== Interný panel ===== */
input:not(.line), textarea:not(.line) {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  font: 500 18px/1.3 var(--ui);
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: 12px;
  outline: none;
}
input:not(.line):focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgb(249 130 0 / .25); }

.admin {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: calc(24px + env(safe-area-inset-top)) 16px 24px;
  background: rgb(38 38 38 / .5);
  overflow: auto;
}
.admin[hidden] { display: none; }
.admin-sheet { width: 100%; max-width: 760px; background: var(--granite); border-radius: 6px; padding: 30px 30px 26px; }
@media (max-width: 640px) { .admin-sheet { padding: 24px 18px 20px; } }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.admin-head h2 { font-family: var(--display); font-weight: 800; font-stretch: 112%; font-size: 24px; }

.btn-primary { display: block; width: 100%; min-height: 58px; border: 0; border-radius: 22px 22px 4px 22px; background: var(--flame); color: #fff; font-size: 19px; font-weight: 700; }
.btn-primary:active { background: var(--ember); }
.btn-pill { min-height: 44px; padding: 8px 20px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper); font-size: 16px; font-weight: 600; }
.btn-pill:active { background: var(--ink); color: var(--paper); }
.btn-pill-pri { background: var(--flame); border-color: var(--flame); color: #fff; }
.btn-pill-pri:active { background: var(--ember); border-color: var(--ember); }
.btn-pill-danger { border-color: var(--ember); color: var(--ember); }
.btn-pill-danger:active { background: var(--ember); border-color: var(--ember); color: #fff; }
.btn-pill[hidden] { display: none; }

.admin .field { display: block; margin-bottom: 14px; }
.admin .field > span { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.key-form { margin-bottom: 16px; padding: 14px; border: 1.5px solid var(--ember); border-radius: 8px; background: var(--paper); }
.key-form[hidden] { display: none; }
.key-form .field { margin-bottom: 10px; }

.pin { max-width: 340px; margin: 24px auto 8px; text-align: center; }
.pin-label { font-family: var(--display); font-weight: 800; font-stretch: 110%; font-size: 26px; margin-bottom: 14px; }
.pin input { text-align: center; font-size: 28px; letter-spacing: .4em; margin-bottom: 12px; }
.pin[hidden] { display: none; }
#reset-input { font-size: 16px; letter-spacing: 0; }
.link-btn { margin-top: 14px; border: 0; background: none; color: var(--ink-soft); font-size: 15px; text-decoration: underline; }
.muted-text { color: var(--ink-soft); font-size: 15px; margin-bottom: 12px; }
.form-error { margin: 0 0 12px; color: var(--ember); font-weight: 700; }

.stats { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.counts { font-weight: 600; color: var(--ink-soft); }
.pill { padding: 4px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.pill-online { background: var(--moss-soft); color: var(--moss); }
.pill-offline { background: var(--ember-soft); color: var(--ember); }
.banner { margin-bottom: 12px; padding: 12px 16px; border-radius: 8px; background: var(--ember-soft); color: var(--ember); font-weight: 700; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 8px; }
.row1 { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.who { font-weight: 700; overflow-wrap: anywhere; }
.who small { display: block; font-weight: 500; color: var(--ink-soft); }
.meta { margin-top: 4px; font-size: 15px; color: var(--ink-soft); overflow-wrap: anywhere; }
.note { margin-top: 4px; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.err { margin-top: 4px; font-size: 14px; color: var(--ember); }
.badge { flex: none; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.badge-sent { background: var(--moss-soft); color: var(--moss); }
.badge-wait { background: var(--ore-soft); color: var(--ore-text); }
.empty { color: var(--ink-soft); }

/* ===== Potvrdenie ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 30;
  transform: translate(-50%, 20px);
  padding: 14px 26px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  max-width: calc(100% - 32px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
