/* ==========================================================================
   richter2026 — forms.css
   Modern form fields. Targets the existing, unprefixed selectors used
   across account/checkout/contact templates (input[type=text], select,
   textarea, table.form, table.radio) — no template markup changes needed.
   Milestone: 0.1 Foundation
   ========================================================================== */

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
textarea,
select {
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  color: var(--color-text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(29, 79, 145, 0.12);
}

textarea {
  line-height: var(--line-height-base);
  resize: vertical;
}

select {
  cursor: pointer;
}

label {
  display: block;
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

input.large-field,
select.large-field {
  width: 100%;
  max-width: 420px;
}

.required {
  color: var(--color-warning);
  font-weight: var(--font-weight-bold);
}

.error {
  display: block;
  color: var(--color-warning);
  font-size: var(--font-size-sm);
  margin-top: var(--space-1);
}

.help {
  color: var(--color-text-faint);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-normal);
  font-family: var(--font-body);
  display: block;
  margin-top: var(--space-1);
}

/* table.form — used heavily on account/edit, checkout address forms etc. */
table.form {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-6);
}

table.form td {
  padding: var(--space-2) var(--space-2) var(--space-2) 0;
  color: var(--color-text);
  vertical-align: top;
}

table.form tr td:first-child {
  width: 200px;
  padding-top: var(--space-4);
  font-weight: var(--font-weight-medium);
}

table.radio {
  width: 100%;
  border-collapse: collapse;
}

table.radio td {
  padding: var(--space-3);
  vertical-align: middle;
}

table.radio tr td:first-child {
  width: 24px;
}

table.radio tr.highlight:hover td {
  background: var(--color-bg-subtle);
  cursor: pointer;
}

input[type="radio"],
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* Generic card wrapper used by login-content / checkout-content panels */
.richter-form-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

@media (max-width: 599px) {
  table.form tr td:first-child {
    width: auto;
    display: block;
    padding-top: var(--space-3);
  }

  table.form tr td:first-child + td {
    display: block;
  }

  input.large-field,
  select.large-field {
    max-width: none;
  }
}
