/* Forms: visible labels, 48px inputs (16px text, so iOS does not zoom in), errors under the field. */

@layer components {
  .field {
    margin: 0 0 var(--s-4);
  }

  .field > label,
  .field__label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 700;
  }

  .field__optional {
    color: var(--muted);
    font-weight: 400;
  }

  .input {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 0 var(--s-3);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
  }

  .input:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 1px;
  }

  .input-group {
    position: relative;
  }

  /* The show/hide button sits inside the field, at the right. */
  .input-group .input {
    padding-right: 52px;
  }

  .input-group__toggle {
    position: absolute;
    top: 2px;
    right: 2px;
    color: var(--muted);
  }

  .field__hint {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.8125rem;
  }

  .field--invalid .input {
    border: 2px solid var(--spice);
  }

  .field__errors {
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    color: var(--spice);
    font-size: 0.875rem;
    font-weight: 600;
  }

  /* An error that is not about one field (wrong password, unknown link). */
  .alert {
    display: flex;
    align-items: flex-start;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    background: var(--spice-soft);
    color: var(--spice);
    font-weight: 600;
  }

  .alert .icon {
    margin-top: 0.1rem;
  }

  .form-actions {
    margin-top: var(--s-5);
  }

  /* A second form under the first, with its own button (remove the address): a little room above it. */
  .form-extra {
    margin-top: var(--s-2);
  }

  /* A link under a form ("Wachtwoord vergeten?") and a sentence with a link ("Al een account? Inloggen"). */
  .form-links,
  .form-note {
    margin-top: var(--s-5);
    text-align: center;
  }

  .form-note {
    color: var(--text);
  }
}
