/*
 * SAF Design System -- public form base (`saf-public-form` handle).
 *
 * The shared `.saf-form` system extracted from the byte-identical copies
 * that sober-af-peers / sober-af-crp / sober-af-charter each shipped
 * (~110 duplicated lines per plugin). Those plugins now register their
 * own handle with `saf-public-form` as a dependency and keep ONLY their
 * plugin-specific rules (label shape, field/row wrappers, req/optional
 * markers, help/error text, notice margin).
 *
 * Self-contained: the OLD theme's components.css is NOT enqueued on the
 * Tier-D Elementor + JTC public surface (memory:
 * tier-d-old-theme-css-not-enqueued), so this ships base styles, not
 * overrides. Every rule is scoped under `.saf-form` so nothing leaks to
 * the global JTC footer -- a bare `.saf-btn` restyles the footer "Say hi"
 * button and breaks visual-diff height (memory:
 * per-cpt-css-saf-btn-footer-leak).
 *
 * Owned by sober-af-design-system -- the shared-CSS home named in
 * .claude/rules/elementor-patterns.md Rule 3. Bump
 * SAF_DESIGN_SYSTEM_VERSION on every edit (LiteSpeed cache discipline).
 */

/* ----------------------------------------------------------------------
 * Layout
 * -------------------------------------------------------------------- */

.saf-form {
  display: grid;
  gap: var(--saf-gap-4, 1.5rem);
}

/* ----------------------------------------------------------------------
 * Inputs (the field-wrapper / label shape stays per-plugin)
 * -------------------------------------------------------------------- */

.saf-form__input,
.saf-form input[type="text"],
.saf-form input[type="email"],
.saf-form input[type="tel"],
.saf-form input[type="url"],
.saf-form input[type="number"],
.saf-form input[type="date"],
.saf-form input[type="time"],
.saf-form select,
.saf-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--saf-border, #d8d1c0);
  border-radius: var(--saf-radius, 8px);
  background: #fff;
  font: inherit;
  color: inherit;
  box-sizing: border-box;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.saf-form input:focus,
.saf-form select:focus,
.saf-form textarea:focus,
.saf-form .saf-form__input:focus {
  outline: none;
  border-color: var(--saf-brick-red, #be2727);
  box-shadow: 0 0 0 3px rgba(190, 39, 39, 0.15);
}

.saf-form textarea {
  min-height: 140px;
  resize: vertical;
}

/* ----------------------------------------------------------------------
 * Response notices (success / dedupe / error)
 * -------------------------------------------------------------------- */

.saf-form__notice {
  padding: var(--saf-gap-4, 1.5rem);
  border-radius: var(--saf-radius, 8px);
  font-weight: 500;
  line-height: 1.45;
}

.saf-form__notice--success {
  background: #e4f2ea;
  color: #2d6a4f;
  border-left: 4px solid #2d6a4f;
}

.saf-form__notice--error {
  background: #fbe6e6;
  color: var(--saf-brick-red, #be2727);
  border-left: 4px solid var(--saf-brick-red, #be2727);
}

/* ----------------------------------------------------------------------
 * Submit button -- scoped under .saf-form to never leak to the footer
 * (memory: per-cpt-css-saf-btn-footer-leak; bare `.saf-btn` selectors
 * restyle the JTC "Say hi" footer button and break visual-diff height).
 * -------------------------------------------------------------------- */

.saf-form .saf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--saf-gap-2, 0.5rem);
  padding: 0.85rem 1.75rem;
  background: var(--saf-brick-red, #be2727);
  color: var(--saf-linen, #f5f1e7);
  font-family: inherit;
  font-weight: 700;
  font-size: var(--saf-text-base, 1rem);
  line-height: 1.2;
  text-decoration: none;
  border: 2px solid var(--saf-brick-red, #be2727);
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.saf-form .saf-btn:hover,
.saf-form .saf-btn:focus-visible {
  background: var(--saf-burgundy, #7b181a);
  border-color: var(--saf-burgundy, #7b181a);
  color: var(--saf-linen, #f5f1e7);
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 0 0 3px rgba(190, 39, 39, 0.18);
}
