/* steko-form.css — FWS-001 v0.2.0 Form Widget
   Modal overlay, form fields, responsive, validation states.
   All values from WPD-001 design system CSS custom properties.
   No inline styles — CSP compatible (FWS-001 Section 2.1). */

/* ── Honeypot concealment (Section 5.6) ── */
.steko-form-hp {
  position: absolute;
  left: -9999px;
}

/* ── Scroll lock (Section 6.3) ── */
body.steko-form-open {
  overflow: hidden;
}

/* ── Overlay ── */
.steko-form-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(11, 18, 21, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.steko-form-overlay.steko-form-visible {
  opacity: 1;
  visibility: visible;
}

/* ── Modal card ── */
.steko-form-modal {
  background: var(--deep, #0b1215);
  border: 1px solid var(--ml-ghost, rgba(212, 197, 169, 0.15));
  border-radius: 4px;
  max-width: 480px;
  width: 100%;
  padding: 2rem 2rem 1.5rem;
  position: relative;
  transform: translateY(12px);
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
  opacity: 0;
  max-height: 90vh;
  overflow-y: auto;
}
.steko-form-overlay.steko-form-visible .steko-form-modal {
  transform: translateY(0);
  opacity: 1;
}

/* ── Close button ── */
.steko-form-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--ts, rgba(212, 197, 169, 0.55));
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.2s ease;
}
.steko-form-close:hover,
.steko-form-close:focus-visible {
  color: var(--ml, #d4c5a9);
}

/* ── Heading ── */
.steko-form-heading {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--ml, #d4c5a9);
  margin: 0 0 1.5rem;
  line-height: 1.3;
}

/* ── Form layout ── */
.steko-form-fields {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* ── Field group ── */
.steko-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.steko-form-field label {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--ts, rgba(212, 197, 169, 0.55));
  letter-spacing: 0.02em;
}

/* ── Inputs ── */
.steko-form-field input[type="text"],
.steko-form-field input[type="email"],
.steko-form-field textarea {
  background: rgba(212, 197, 169, 0.06);
  border: 1px solid var(--ml-ghost, rgba(212, 197, 169, 0.15));
  border-radius: 3px;
  color: var(--tp, rgba(212, 197, 169, 0.78));
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 0.92rem;
  padding: 0.6rem 0.75rem;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
  outline: none;
}
.steko-form-field input:focus,
.steko-form-field textarea:focus {
  border-color: var(--ml-action, rgba(212, 197, 169, 0.7));
}
.steko-form-field textarea {
  resize: vertical;
  min-height: 100px;
}

/* ── Error state ── */
.steko-form-field.steko-form-error input,
.steko-form-field.steko-form-error textarea {
  border-color: #c0392b;
}
.steko-form-error-msg {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 0.8rem;
  color: #c0392b;
  margin: 0;
  display: none;
}
.steko-form-field.steko-form-error .steko-form-error-msg {
  display: block;
}

/* ── Consent checkbox ── */
.steko-form-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 0.25rem;
}
.steko-form-consent input[type="checkbox"] {
  margin-top: 0.25rem;
  accent-color: var(--ml-action, rgba(212, 197, 169, 0.7));
  flex-shrink: 0;
}
.steko-form-consent label {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--ts, rgba(212, 197, 169, 0.55));
  line-height: 1.5;
}
.steko-form-consent label a {
  color: var(--ml-action, rgba(212, 197, 169, 0.7));
  text-decoration: none;
}
.steko-form-consent label a:hover {
  text-decoration: underline;
}
.steko-form-consent-error {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 0.8rem;
  color: #c0392b;
  margin: 0 0 0 1.6rem;
  display: none;
}
.steko-form-consent-error.steko-form-shown {
  display: block;
}

/* ── Submit button ── */
.steko-form-submit {
  background: transparent;
  border: 1px solid var(--ml-action, rgba(212, 197, 169, 0.7));
  color: var(--ml-action, rgba(212, 197, 169, 0.7));
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 0.92rem;
  padding: 0.65rem 1.5rem;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.2s ease, color 0.2s ease;
  margin-top: 0.5rem;
  width: 100%;
}
.steko-form-submit:hover:not(:disabled) {
  background: var(--ml-action, rgba(212, 197, 169, 0.7));
  color: var(--deep, #0b1215);
}
.steko-form-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.steko-form-submit.steko-form-loading {
  pointer-events: none;
  opacity: 0.6;
}

/* ── Server error ── */
.steko-form-server-error {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 0.85rem;
  color: #c0392b;
  text-align: center;
  margin-top: 0.5rem;
  display: none;
}
.steko-form-server-error.steko-form-shown {
  display: block;
}

/* ── Success state ── */
.steko-form-success {
  text-align: center;
  padding: 1.5rem 0;
}
.steko-form-success-msg {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1rem;
  color: var(--ml, #d4c5a9);
  line-height: 1.6;
}

/* ── Mobile bottom-anchored (Section 6.2) ── */
@media (max-width: 768px) {
  .steko-form-overlay {
    align-items: flex-end;
  }
  .steko-form-modal {
    max-width: 100%;
    border-radius: 12px 12px 0 0;
    padding: 1.5rem 1rem 1.25rem;
    max-height: 85vh;
    transform: translateY(100%);
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
  }
  .steko-form-overlay.steko-form-visible .steko-form-modal {
    transform: translateY(0);
  }
}
