/* ==========================================================================
   Subpages: order form (zamow.html), regulamin.html, kontakt.html
   Loaded after style.css.
   ========================================================================== */

/* ---------- Order layout ---------- */
.order { padding-block: clamp(2.5rem, 5vw, 4.5rem) clamp(4rem, 8vw, 7rem); }
.order__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.order__head .display { margin-top: .8rem; }
.order__head .lead { margin-top: 1rem; }
.order__aside { position: sticky; top: 98px; }

/* ---------- Form ---------- */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form { margin-top: 2.5rem; }
.form__section { border: 0; padding: 0; margin: 0 0 3rem; min-width: 0; }
.form__legend {
  display: flex; align-items: center; gap: .8rem; padding: 0; margin-bottom: 1.4rem;
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 600;
}
.form__legend em, .field__label em, .check em { color: var(--orange); font-style: normal; }
.form__num {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 1.05rem; background: var(--paper); border: 1px solid var(--line);
}
.form__intro { margin: -.6rem 0 1.2rem; }
.form__row { display: grid; gap: 1rem 1.2rem; }
.form__row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form__row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form__row--zip { grid-template-columns: 160px minmax(0, 1fr); }
.form__row + .form__row, .form__row + .field, .field + .field, .dropzone + .form__row, .field + .check { margin-top: 1.1rem; }
.form__row > .field { margin-top: 0; }

.field { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.field__label { font-size: .82rem; font-weight: 600; letter-spacing: .02em; color: var(--ink-2); }
.field__hint { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  font: inherit; font-size: 1rem; color: var(--ink);
  padding: .8em 1em; border-radius: 6px; border: 1px solid var(--line); background: var(--paper);
  transition: border-color .2s, box-shadow .2s; width: 100%;
}
.field textarea { resize: vertical; min-height: 5.5em; }
.field input::placeholder, .field textarea::placeholder { color: #a79d92; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(238, 106, 36, .18); }
.field input.is-invalid, .field textarea.is-invalid { border-color: #c8412a; box-shadow: 0 0 0 3px rgba(200, 65, 42, .14); }
.field input.is-auto { background: #fff6ee; }
.link { color: var(--orange); text-decoration: underline; text-underline-offset: 3px; }

.check { display: flex; gap: .8rem; align-items: flex-start; font-size: .92rem; color: var(--ink-2); cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: .15rem 0 0; accent-color: var(--orange); }
.check.is-invalid { color: #c8412a; }

/* ---------- GPX dropzone ---------- */
.dropzone {
  position: relative; display: flex; gap: 1rem; align-items: center;
  padding: 1.4rem 1.5rem; border: 1.5px dashed var(--line); border-radius: 10px; background: var(--paper);
  cursor: pointer; transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.is-over { border-color: var(--orange); background: #fff8f2; outline: 0; }
.dropzone__input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; } /* wybór pliku odpala JS po kliknięciu w strefę */
.dropzone__icon { width: 34px; height: 34px; flex: none; fill: none; stroke: var(--orange); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dropzone__text { font-size: .98rem; }
.dropzone__text .small { margin-top: .3rem; }
.dropzone.has-file .dropzone__text, .dropzone.has-file .dropzone__icon, .dropzone.has-file .dropzone__input { display: none; }
.dropzone__file { display: flex; align-items: center; gap: 1rem; width: 100%; flex-wrap: wrap; }
.dropzone__name { font-weight: 600; }
.dropzone__meta { color: var(--muted); font-size: .88rem; }
.dropzone__remove {
  margin-left: auto; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
  font-size: 1.2rem; line-height: 1; display: grid; place-items: center; background: var(--cream);
}
.dropzone__remove:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }

/* rozwijana podpowiedź wewnątrz dropzone */
.hint { margin-top: .6rem; font-size: .9rem; color: var(--ink-2); }
.hint summary {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; list-style: none;
  color: var(--orange); font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.hint summary::-webkit-details-marker { display: none; }
.hint summary::before { content: "?"; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; background: var(--orange-soft); text-decoration: none; }
.hint summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 3px; }
.hint__body { margin-top: .6rem; padding: .9rem 1.1rem; border-left: 3px solid var(--orange); background: var(--cream); border-radius: 0 6px 6px 0; cursor: default; }
.hint__body p + p { margin-top: .6rem; }

/* ---------- Template picker ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
.tpl { position: relative; display: block; cursor: pointer; }
.tpl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tpl__frame {
  display: block; padding: 6px; border-radius: 3px;
  outline: 3px solid transparent; outline-offset: 4px;
  transition: transform .35s var(--ease-out), outline-color .2s;
}
.tpl__frame .frame__mat { display: block; padding: 5%; }
.tpl:hover .tpl__frame { transform: translateY(-3px); }
.tpl input:checked + .tpl__frame { outline-color: var(--orange); }
.tpl input:focus-visible + .tpl__frame { outline-color: var(--ink); }
.tpl__name { display: block; margin-top: .8rem; font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; }
.tpl input:checked ~ .tpl__name::after { content: " \2713"; color: var(--orange); }
.tpl__desc { display: block; font-size: .82rem; color: var(--muted); }

/* ---------- Submit / done ---------- */
.form__footer { padding-top: 1rem; border-top: 1px solid var(--line-soft); }
.form__footer .small { margin-top: 1rem; }
.form__error { margin-bottom: 1rem; padding: .8rem 1rem; border-radius: 6px; background: #fbe6e1; color: #8f2a19; font-size: .92rem; }
.btn--lg { padding: 1.05em 1.9em; font-size: 1.05rem; }
.btn[disabled] { opacity: .6; pointer-events: none; }

.form__done { margin-top: 2.5rem; padding: 2.5rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.form__done .display { margin-top: .4rem; }
.form__done .lead { margin: 1rem 0 1.8rem; }

/* ---------- Live preview ---------- */
.preview { padding: 1.4rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.preview__frame { transform: rotate(-1.5deg); }
.preview__tpl { margin-top: 1.4rem; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.preview__tpl strong { color: var(--ink); }
.preview__specs { margin-top: .4rem; }
.preview__specs .spec { padding: .45rem 0; font-size: .95rem; }
.preview__specs dd.is-empty { color: #b3a99d; font-style: italic; }
.preview__note { margin: 1.4rem 0 .4rem .4rem; font-size: 1.7rem; }

/* ---------- Simple text pages ---------- */
.page { padding-block: clamp(2.5rem, 5vw, 4.5rem) clamp(4rem, 8vw, 7rem); }
.page__inner { max-width: 720px; }
.page .display { margin-top: .8rem; }
.page .lead { margin-top: 1rem; }
.prose { margin-top: 2.5rem; }
.prose h2 { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; margin: 2.2rem 0 .7rem; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--ink-2); }
.prose p + p { margin-top: .8rem; }
.prose ol { list-style: decimal; padding-left: 1.4rem; display: grid; gap: .4rem; }
.placeholder { padding: 1rem 1.2rem; border-left: 3px solid var(--orange); background: var(--paper); color: var(--muted); font-style: italic; }

.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; margin-top: 2.5rem; }
.contact-card { padding: 1.5rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.contact-card h2 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; margin-bottom: .5rem; }
.contact-card p { color: var(--ink-2); font-size: .95rem; }
.contact-card a { color: var(--orange); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .order__grid { grid-template-columns: 1fr; }
  .order__aside { position: static; order: -1; }
  .preview { display: grid; grid-template-columns: 200px 1fr; gap: 0 1.4rem; align-items: center; }
  .preview__note { display: none; }
  .preview__tpl { margin-top: 0; }
}
@media (max-width: 720px) {
  .form__row--2, .form__row--3, .form__row--zip { grid-template-columns: 1fr; }
  .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .preview { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .form__done { padding: 1.6rem; }
}
