/* ============================================================================
   customer-form-validation.css — the customer form's validation styling,
   for every page that loads assets/js/account-forms-premium.js.   (2026-10-16)
   ----------------------------------------------------------------------------
   account-premium.css §14 has styled these messages on /registration and
   /identity since 2026-09-02, but checkout does not load account-premium.css,
   and checkout's personal-information step is where customers actually sign
   up. This file carries the same rules (same values; the colour tokens fall
   back to account-premium.css's own values where its :root is not loaded), so
   a message raised in checkout looks exactly like one on /registration.
   On the two account pages it repeats §14 harmlessly and adds the one new
   piece, the "Did you mean …?" email hint.
   ========================================================================== */

/* No green ticks on the customer form (the theme adds `was-validated` to a
   form that passed). */
#customer-form.was-validated .form-control:valid,
#customer-form.was-validated .form-select:valid,
#customer-form.was-validated textarea.form-control:valid {
  padding-right: 0.75rem;
  background-image: none;
  border-color: var(--ac-line, #ece2e9);
}

#customer-form.was-validated .form-check-input:valid {
  border-color: rgba(26, 0, 16, 0.25);
}

#customer-form.was-validated .form-check-input:valid:checked {
  background-color: var(--ac-pink, #d50075);
  border-color: var(--ac-pink, #d50075);
}

#customer-form.was-validated .form-check-input:valid ~ .form-check-label {
  color: inherit;
}

/* Server-side per-field errors, flattened to a line of red text. */
#customer-form .form-field .form-field__errors .help-block {
  margin: 0;
}

#customer-form .form-field .form-field__errors .alert-danger {
  display: block;
  margin: 0.35rem 0 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  color: var(--ac-danger, #b02a37);
  font-size: 0.8125rem;
  line-height: 1.45;
}

#customer-form .form-field .form-field__errors .alert-danger::before {
  display: none;
}

#customer-form .form-field .form-field__errors ol {
  margin: 0;
  padding-inline-start: 1.1rem;
}

/* Browser-side messages. */
#customer-form .form-field__message {
  display: flex;
  gap: 0.35rem;
  align-items: flex-start;
  margin: 0.35rem 0 0;
  color: var(--ac-danger, #b02a37);
  font-size: 0.8125rem;
  line-height: 1.45;
}

#customer-form .form-field__message::before {
  content: '';
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 0.12rem;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M12 7v6m0 3.2v.4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M12 7v6m0 3.2v.4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* The invalid control itself. */
#customer-form .form-field.is-invalid-field > .form-control,
#customer-form .form-field.is-invalid-field > .form-select,
#customer-form .form-field.is-invalid-field .input-group > .form-control,
#customer-form .form-field.is-invalid-field .iti > .form-control,
#customer-form .has-error > .form-control,
#customer-form .has-error > .form-select,
#customer-form .has-error .input-group > .form-control {
  border-color: var(--ac-danger, #b02a37);
}

#customer-form .form-field.is-invalid-field > .form-control:focus,
#customer-form .form-field.is-invalid-field .input-group > .form-control:focus,
#customer-form .form-field.is-invalid-field .iti > .form-control:focus,
#customer-form .has-error > .form-control:focus,
#customer-form .has-error .input-group > .form-control:focus {
  border-color: var(--ac-danger, #b02a37);
  box-shadow: 0 0 0 0.2rem rgba(176, 42, 55, 0.18);
}

#customer-form .form-field.is-invalid-field .form-check-input,
#customer-form .has-error .form-check-input {
  border-color: var(--ac-danger, #b02a37);
}

/* A flagged consent box gets the whole row tinted: a red hairline on a 1em
   checkbox at the foot of a long form is easy to miss. */
#customer-form .form-field.is-invalid-field[data-field-type='checkbox'],
#customer-form .has-error[data-field-type='checkbox'] {
  padding: 0.7rem 0.85rem;
  background: var(--ac-danger-tint, #fdeced);
  border-radius: var(--ac-radius-xs, 10px);
}

/* The summary line at the top of the form. */
#customer-form .customer-form__summary {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 1.1rem;
  padding: 0.6rem 0.85rem;
  background: var(--ac-danger-tint, #fdeced);
  border-left: 3px solid var(--ac-danger, #b02a37);
  border-radius: var(--ac-radius-xs, 10px);
  color: var(--ac-danger, #b02a37);
  font-size: 0.875rem;
  font-weight: 600;
}

/* The disabled state after a submit that went ahead. */
#customer-form [type='submit'][aria-busy='true'] {
  cursor: progress;
  opacity: 0.65;
}

/* "Did you mean name@gmail.com?" under the email. A hint, not an error: ink,
   not red, and it never blocks the form. */
#customer-form .form-field__suggestion {
  margin: 0.35rem 0 0;
  color: inherit;
  font-size: 0.8125rem;
  line-height: 1.45;
}

#customer-form .form-field__suggestion-use {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ac-pink, #d50075);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

#customer-form .form-field__suggestion-use:focus-visible {
  outline: 2px solid var(--ac-pink, #d50075);
  outline-offset: 2px;
  border-radius: 2px;
}

/* "Already registered?" under a duplicate-email error (customer-form.tpl). */
#customer-form .form-field__account-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
}
