@layer hpds-components {
  .hpds-form { display: grid; gap: var(--hpds-space-5); }
  .hpds-field { display: grid; gap: var(--hpds-space-2); }

  .hpds-label {
    color: var(--hpds-color-text);
    font-size: var(--hpds-font-size-200);
    font-weight: var(--hpds-weight-semibold);
    line-height: 1.4;
  }

  .hpds-label__required { color: var(--hpds-color-error); }

  .hpds-input,
  .hpds-select,
  .hpds-textarea {
    appearance: none;
    background: var(--hpds-color-surface);
    border: var(--hpds-border);
    border-radius: var(--hpds-radius-sm);
    color: var(--hpds-color-text);
    font-family: var(--hpds-font-sans);
    font-size: var(--hpds-font-size-300);
    inline-size: 100%;
    letter-spacing: 0;
    line-height: 1.4;
    min-block-size: 2.75rem;
    padding: 0.7rem 0.875rem;
    transition: border-color var(--hpds-duration-fast) var(--hpds-ease-standard), box-shadow var(--hpds-duration-fast) var(--hpds-ease-standard), background-color var(--hpds-duration-fast) var(--hpds-ease-standard);
  }

  .hpds-textarea { min-block-size: 8rem; resize: vertical; }
  .hpds-input::placeholder, .hpds-textarea::placeholder { color: color-mix(in srgb, var(--hpds-color-text-muted) 78%, transparent); }

  .hpds-input:hover,
  .hpds-select:hover,
  .hpds-textarea:hover { border-color: var(--hpds-color-border-strong); }

  .hpds-input:focus-visible,
  .hpds-select:focus-visible,
  .hpds-textarea:focus-visible {
    border-color: var(--hpds-color-focus);
    box-shadow: var(--hpds-shadow-focus);
    outline: 0;
  }

  .hpds-input:disabled,
  .hpds-select:disabled,
  .hpds-textarea:disabled,
  .hpds-input[readonly] {
    background: var(--hpds-color-surface-subtle);
    color: var(--hpds-color-text-muted);
    cursor: not-allowed;
  }

  .hpds-field.is-invalid :is(.hpds-input, .hpds-select, .hpds-textarea),
  :is(.hpds-input, .hpds-select, .hpds-textarea)[aria-invalid="true"] {
    border-color: var(--hpds-color-error);
  }

  .hpds-field__help,
  .hpds-field__error {
    color: var(--hpds-color-text-muted);
    font-size: var(--hpds-font-size-200);
    line-height: 1.4;
    margin: 0;
  }

  .hpds-field__error { color: var(--hpds-color-error); }

  .hpds-check {
    align-items: flex-start;
    color: var(--hpds-color-text);
    cursor: pointer;
    display: inline-flex;
    font-size: var(--hpds-font-size-200);
    gap: var(--hpds-space-2);
  }

  .hpds-check input {
    accent-color: var(--hpds-color-brand);
    block-size: 1.125rem;
    flex: 0 0 auto;
    inline-size: 1.125rem;
    margin-block-start: 0.15rem;
  }

  .hpds-form-row { display: grid; gap: var(--hpds-space-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }

  @media (max-width: 767px) {
    .hpds-form-row { grid-template-columns: 1fr; }
  }
}
