/* ==========================================================================
   Komponenty: štítky, miesta na fotky, formulárové prvky, režim kontroly
   ========================================================================== */

/* ---------- Štítky ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 10px;
  border: 1px solid rgba(18, 19, 15, .16);
  background: rgba(255, 255, 255, .6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 0 rgba(255, 107, 53, .5);
  animation: ping 2.4s ease-out infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(255, 107, 53, .55); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(255, 107, 53, 0); }
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 8px 11px;
  border: 1px solid rgba(18, 19, 15, .14);
  background: rgba(255, 255, 255, .5);
}

.dotchip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.dotchip::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c);
  border: 1px solid rgba(18, 19, 15, .25);
}

/* ---------- Miesto na fotku ---------- */
/* Prázdny rám ukazuje, akú fotku dodať. Keď súbor existuje, zobrazí sa fotka. */

.ph {
  --ph-ink: 18, 19, 15;
  --ph-bg: rgba(255, 255, 255, .55);
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--ratio, 4 / 3);
  background:
    repeating-linear-gradient(135deg, rgba(var(--ph-ink), .045) 0 1px, transparent 1px 11px),
    var(--ph-bg);
  border: 1px solid rgba(var(--ph-ink), .14);
  color: rgb(var(--ph-ink));
  container-type: inline-size;
}
.ph--dark { --ph-ink: 242, 245, 236; --ph-bg: rgba(255, 255, 255, .04); }

.ph__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity .7s ease, transform 1.2s var(--ease-out);
}
.ph.is-filled { border-color: transparent; background: rgba(var(--ph-ink), .06); }
.ph.is-filled .ph__img { opacity: 1; transform: none; }

.ph__empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: clamp(12px, 5cqi, 22px);
  opacity: 0;
  transition: opacity .4s ease;
}
.ph.is-empty .ph__empty { opacity: 1; }
.ph.is-filled .ph__empty { display: none; }

/* rohové značky hľadáčika */
.ph__empty::before,
.ph__empty::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 0 solid rgba(var(--ph-ink), .5);
}
.ph__empty::before { top: 8px; left: 8px; border-width: 1.5px 0 0 1.5px; }
.ph__empty::after { bottom: 8px; right: 8px; border-width: 0 1.5px 1.5px 0; }

.ph__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.ph__id {
  background: rgb(var(--ph-ink));
  color: var(--cream);
  padding: 3px 7px;
  font-weight: 500;
}
.ph--dark .ph__id { color: var(--ink); }
.ph__ratio { opacity: .6; padding-top: 3px; }

.ph__mid { display: grid; gap: 8px; align-content: center; max-width: 42ch; }
.ph__icon { width: 26px; height: 26px; opacity: .55; }
.ph__icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; }
.ph__title { font-size: clamp(14px, 5.5cqi, 19px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.ph__desc { font-size: 13px; line-height: 1.45; opacity: .75; text-wrap: pretty; }

.ph__file {
  font-family: var(--f-mono);
  font-size: 10.5px;
  line-height: 1.5;
  opacity: .68;
  border-top: 1px dashed rgba(var(--ph-ink), .3);
  padding-top: 8px;
  word-break: break-all;
}

@container (max-width: 250px) {
  .ph__desc { display: none; }
  .ph__icon { width: 20px; height: 20px; }
}
@container (max-width: 170px) {
  .ph__file, .ph__ratio { display: none; }
}

/* ---------- Režim kontroly (?kontrola) ---------- */

.review .ph.is-filled::after {
  content: attr(data-n);
  position: absolute;
  left: 10px; top: 10px;
  z-index: 3;
  background: var(--lime);
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
}
.review [data-overit] {
  outline: 1.5px dashed #E0301E;
  outline-offset: 3px;
  background-color: rgba(255, 213, 0, .22);
  position: relative;
}

.review-bar {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 95;
  max-width: min(420px, calc(100vw - 32px));
  background: var(--ink);
  color: var(--cream);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
}
.review-bar strong { color: var(--lime); font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; display: block; margin-bottom: 6px; }
.review-bar p { margin: 0 0 4px; }
.review-bar mark { background: rgba(255, 213, 0, .3); color: inherit; outline: 1.5px dashed #FF6B4A; padding: 0 3px; }
.review-bar a { color: var(--lime); text-decoration: underline; }

/* ---------- Formulár ---------- */

.form { display: grid; gap: 18px; }
.form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 560px) { .form__grid { grid-template-columns: 1fr; } }

.field { display: grid; gap: 7px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field__label {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.field__label small { text-transform: none; letter-spacing: 0; }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid rgba(18, 19, 15, .16);
  border-radius: 0;
  background: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
  appearance: none;
}
.field textarea { resize: vertical; min-height: 88px; }
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 40px;
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--ink); box-shadow: 4px 4px 0 var(--lime-pale); }
.field.is-invalid input { border-color: #C8321E; }
.field__err { font-size: 12.5px; color: #B42A18; min-height: 0; }
.field__err:empty { display: none; }

.check {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check__box {
  width: 22px;
  height: 22px;
  flex: none;
  border: 1.5px solid var(--ink);
  background: #fff;
  display: grid;
  place-items: center;
  transition: background .2s ease;
}
.check__box::after {
  content: '';
  width: 10px;
  height: 6px;
  border: solid var(--ink);
  border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg) scale(0);
  transition: transform .25s var(--ease-spring);
}
.check input:checked + .check__box { background: var(--lime); }
.check input:checked + .check__box::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.check input:focus-visible + .check__box { outline: 2px solid var(--ink); outline-offset: 3px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form__status { font-size: 14px; font-weight: 600; color: #B42A18; }
.form__status:empty { display: none; }
.form__note {
  font-family: var(--f-mono);
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--muted-2);
}

/* ---------- Prepínač a posuvníky (kalkulačka) ---------- */

.switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid rgba(250, 247, 238, .22);
  margin-bottom: 26px;
}
.switch button {
  border: 0;
  background: transparent;
  color: rgba(250, 247, 238, .7);
  padding: 11px 16px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  transition: background .25s ease, color .25s ease;
}
.switch button small { font-family: var(--f-mono); font-size: 10.5px; font-weight: 400; opacity: .75; }
.switch button[aria-checked='true'] { background: var(--cream); color: var(--ink); }

.range { display: block; margin-bottom: 26px; }
.range__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-family: var(--f-mono);
  font-size: 12.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(250, 247, 238, .62);
}
.range__head output {
  font-family: var(--f-sans);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
  text-transform: none;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.range__hint {
  display: block;
  margin-top: 10px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: rgba(250, 247, 238, .45);
}

.range__input {
  --p: 50%;
  width: 100%;
  height: 28px;
  margin: 12px 0 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.range__input::-webkit-slider-runnable-track {
  height: 6px;
  background: linear-gradient(90deg, var(--lime) var(--p), rgba(250, 247, 238, .16) var(--p));
}
.range__input::-moz-range-track { height: 6px; background: rgba(250, 247, 238, .16); }
.range__input::-moz-range-progress { height: 6px; background: var(--lime); }
.range__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -9px;
  background: var(--lime);
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 1.5px var(--lime);
  transition: transform .2s var(--ease-spring);
}
.range__input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 0;
  background: var(--lime);
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 1.5px var(--lime);
}
.range__input:active::-webkit-slider-thumb { transform: scale(1.18); }
.range__input:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }

@container (max-width: 150px) {
  .ph__title { display: none; }
  .ph__mid { justify-items: center; }
  .ph__top { justify-content: center; }
  .ph__id { font-size: 9.5px; letter-spacing: .06em; }
}

a[href^="tel:"] { white-space: nowrap; }

/* prvky viditeľné len v režime kontroly (chýbajúce firemné údaje) */
html:not(.review) .review-only { display: none !important; }
