/*
 * Minimal, replaceable request form styling until the Direction B theme slice.
 * Everything sits in one layer, so any unlayered theme rule wins. No fonts, brand colors,
 * backgrounds, radii, shadows, motion, container widths or margins. Secondary buttons' stand-in
 * look is in request-secondary.css, outside the layer (spec D4).
 */
@layer ggc-request {
  .ggc-request {
    overflow-wrap: anywhere;
  }

  .ggc-request [hidden] {
    display: none !important;
  }

  .ggc-request__form {
    container-type: inline-size;
    display: flex;
    flex-direction: column;
    gap: var(--ggc-request-gap, 1.25rem);
  }

  .ggc-request__form > *,
  .ggc-request__details > * {
    margin-block: 0;
  }

  .ggc-request__field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .ggc-request__field > label,
  .ggc-request__field > legend {
    font-weight: 700;
  }

  .ggc-request__field > legend {
    padding: 0;
    margin-bottom: 0.375rem;
  }

  .ggc-request__optional {
    font-weight: 400;
  }

  .ggc-request__hint {
    margin: 0;
    font-size: 0.9375em;
    color: inherit;
  }

  .ggc-request input:not([type="radio"]),
  .ggc-request textarea {
    box-sizing: border-box;
    width: 100%;
    max-width: var(--ggc-request-control-max, 32rem);
    min-height: 44px;
    padding: 0.5rem 0.625rem;
    border: 1px solid currentColor;
    font: inherit;
    color: inherit;
  }

  .ggc-request textarea {
    min-height: 6.5em;
  }

  .ggc-request__choice {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-height: 44px;
  }

  .ggc-request__choice input {
    flex: none;
    width: 1.375rem;
    height: 1.375rem;
    margin: 0;
  }

  .ggc-request__choice label {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .ggc-request__details {
    display: flex;
    flex-direction: column;
    gap: var(--ggc-request-gap, 1.25rem);
  }

  .ggc-request__details > summary {
    min-height: 44px;
    padding-block: 0.625rem;
    box-sizing: border-box;
    cursor: pointer;
    font-weight: 700;
  }

  .ggc-request .wp-element-button,
  .ggc-request__slot {
    min-height: 44px;
    font: inherit;
  }

  /* Buttons size to their label instead of stretching across the flex columns. */
  .ggc-request button {
    align-self: flex-start;
  }

  .ggc-request__send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }

  .ggc-request :focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 2px;
  }

  .ggc-request__error {
    margin: 0;
    color: var(--ggc-request-error, #A3261B);
    font-weight: 600;
  }

  .ggc-request [aria-invalid="true"]:not([type="radio"]) {
    border: 3px solid var(--ggc-request-error, #A3261B);
  }

  .ggc-request__result,
  .ggc-request__summary {
    padding: 1rem;
    border: 3px solid currentColor;
  }

  .ggc-request__summary {
    border-color: var(--ggc-request-error, #A3261B);
  }

  .ggc-request__result > :first-child,
  .ggc-request__summary > :first-child {
    margin-top: 0;
  }

  .ggc-request__result > :last-child,
  .ggc-request__summary > :last-child {
    margin-bottom: 0;
  }

  .ggc-request__result,
  .ggc-request__summary,
  .ggc-request__notice {
    margin-block: 0 var(--ggc-request-gap, 1.25rem);
  }

  /* Links that stand alone (not inside a sentence) get a 44 px target. */
  .ggc-request__summary li > a,
  .ggc-request__call {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .ggc-request__summary ul {
    margin-block: 0.5rem 0;
  }

  .ggc-request__slots {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0;
    list-style: none;
  }

  .ggc-request__next-step {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .ggc-request__next-step > * {
    margin-block: 0;
  }

  /* Reserves the Turnstile widget's height before it loads: flexible is 65 px, compact 140 px.
     line-height: 0 stops the widget rendering 4 px taller than its iframe. */
  .ggc-request__challenge {
    min-height: 65px;
    line-height: 0;
  }

  @container (width < 300px) {
    .ggc-request__challenge {
      min-height: 140px;
    }
  }

  @media (scripting: none) {
    .ggc-request__js-only {
      display: none !important;
    }
  }

  .ggc-request__visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}
