/* WSS Forms & Mail v0.1.0: self-contained, low-specificity design tokens. */
.wss-forms {
  --wss-form-ink: #4a1b2b;
  --wss-form-gold: #bd9161;
  --wss-form-paper: #fff9f4;
  display: grid;
  gap: 14px;
  color: var(--wss-form-ink);
  width: 100%;
  max-width: 100%;
  position: relative;
  box-sizing: border-box;
}
.wss-forms *,
.wss-forms *::before,
.wss-forms *::after { box-sizing: border-box; }
.wss-forms__row { display: grid; gap: 5px; min-width: 0; }
.wss-forms__row label { font: 600 13px/1.35 inherit; font-size: 13px; font-weight: 600; }
.wss-forms__row input,
.wss-forms__row textarea {
  min-height: 44px; width: 100%; max-width: 100%;
  padding: 10px 12px; border: 1px solid #d8b99d;
  border-radius: 3px; background: var(--wss-form-paper);
  font: inherit; color: var(--wss-form-ink);
  resize: vertical;
}
.wss-forms__row input:focus-visible,
.wss-forms__row textarea:focus-visible,
.wss-forms__submit:focus-visible {
  outline: 2px solid var(--wss-form-gold); outline-offset: 3px;
}
.wss-forms__consent { display: flex; align-items: start; gap: 9px; font-size: 12px; line-height: 1.5; }
.wss-forms__consent input { flex: 0 0 auto; margin-top: 3px; accent-color: var(--wss-form-ink); }
.wss-forms__consent a { color: inherit; text-decoration: underline; }
.wss-forms__submit {
  cursor: pointer; border: 1px solid var(--wss-form-gold);
  background: #601b30; color: #fff8f2;
  padding: 12px 24px; min-height: 44px; width: fit-content; max-width: 100%;
  font: 600 13px/1.35 inherit; font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; border-radius: 2px;
}
.wss-forms__submit:hover { background: #79233d; }
.wss-forms__submit:disabled { opacity: .65; cursor: wait; }
.wss-forms__result:not([hidden]) { padding: 8px 0; margin: 0; font-size: 14px; }
.wss-forms__product { margin: 0; font-weight: 600; }
.wss-forms__trap {
  position: absolute !important; inset-inline-start: -10000px !important;
  top: auto !important; width: 1px !important; height: 1px !important;
  overflow: hidden !important; opacity: 0 !important;
  clip-path: inset(50%) !important; pointer-events: none !important;
}
@media (max-width: 600px) {
  .wss-forms { gap: 12px; }
  .wss-forms__submit { width: 100%; }
}

/* A successful AJAX/POST request replaces the complete form, not just the
   button. Explicit hidden selectors outrank the form's display:grid rule. */
.wss-forms__widget { width: 100%; min-width: 0; }
.wss-forms[hidden],
.wss-forms__confirmation[hidden],
.wss-forms__confirmation-reference[hidden] { display: none !important; }
.wss-forms__confirmation {
  --wss-form-ink: #4a1b2b;
  --wss-form-gold: #bd9161;
  color: var(--wss-form-ink);
  border: 1px solid #e3c6a6;
  background: linear-gradient(160deg, #fffaf6, #f9eee5);
  box-shadow: inset 0 0 0 5px rgba(189, 145, 97, .08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: clamp(24px, 6vw, 40px) clamp(18px, 4vw, 32px);
  text-align: center;
  min-height: 235px;
  max-width: 100%;
  box-sizing: border-box;
}
.wss-forms__confirmation:focus { outline: none; }
.wss-forms__confirmation-seal {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--wss-form-gold);
  border-radius: 50%;
  color: #8b673e;
  font: 500 26px/1 Georgia, serif;
}
.wss-forms__confirmation-title {
  margin: 0;
  color: #642135;
  font: 500 clamp(22px, 4vw, 27px)/1.2 Georgia, 'Times New Roman', serif;
}
.wss-forms__confirmation-copy,
.wss-forms__confirmation-product {
  max-width: 370px;
  margin: 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
}
.wss-forms__confirmation-product {
  font-weight: 600;
  color: #8f673b;
}
.wss-forms__confirmation-reference {
  border-top: 1px solid #dfc8ac;
  padding: 12px 0 0;
  margin: 8px 0 0;
  font-size: 13px;
  color: #785067;
}
.wss-forms__confirmation-reference strong { color: #642135; font-size: 15px; }

/* Native POST/redirect fallback for the existing Kupetz preorder dialog:
   the confirmation remains visible even when client JS is disabled. With JS
   enabled, the controller opens the dialog and removes this fallback marker. */
#predzakaz:has([data-wss-postback="saved"]) {
  visibility: visible;
  z-index: 2000;
}
body:has(#predzakaz [data-wss-postback="saved"]) .bfon2 {
  display: block;
}

/* Localized validation errors; only fields marked by our controller. */
.wss-forms .wss-forms__field-error {
  display: block;
  color: #a51b35;
  font-size: 12px;
  line-height: 1.4;
  margin: 0;
  overflow-wrap: anywhere;
}
.wss-forms .wss-forms__consent + .wss-forms__field-error { margin-top: -8px; }
.wss-forms .wss-forms__row :is(input,textarea)[aria-invalid="true"] {
  border-color: #a51b35;
}
