/* PFB Registration — form styles
 * Builds on the theme's .pfb-form component (input/label/select styling)
 * and adds layout + notice + hint helpers specific to this form. */

.pfb-register-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pfb-form-field {
  display: block;
}

.pfb-form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text, #111);
  margin-bottom: 0.5rem;
}

.pfb-form-required {
  color: var(--color-red, #EF3340);
  margin-left: 0.125rem;
}

.pfb-form-hint {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--color-text-muted, #888);
}

.pfb-form-error {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-red, #EF3340);
}

/* Section titles separate the groups by space and scale, not by a rule:
   twice the field gap above, a small gap below. */
.pfb-form-section-title {
  margin: 1.5rem 0 -0.25rem;
  font-family: var(--font-display, inherit);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text-strong, #111);
}

.pfb-register-form > .pfb-form-section-title:first-of-type {
  margin-top: 0;
}

.pfb-form-row {
  display: grid;
  gap: 1.5rem 1rem;
}

/* Each field of a row spans three shared row tracks (label, control,
   hint/error) through subgrid. Labels, inputs and hints of neighbouring
   fields line up even when one label wraps or one field has a hint
   ("Au moins 8 caractères." used to lift the password input above its
   neighbour). Browsers without subgrid stack the field normally. */
@supports (grid-template-rows: subgrid) {
  .pfb-form-row > .pfb-form-field {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: 0;
    align-items: end;
  }

  .pfb-form-row > .pfb-form-field > :nth-child(3) {
    align-self: start;
  }
}

.pfb-form-row--2 {
  grid-template-columns: 1fr 1fr;
}

.pfb-form-row--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.pfb-form-row--address {
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 0.8fr) minmax(0, 1fr);
}

@media (max-width: 520px) {
  .pfb-form-row--2 {
    grid-template-columns: 1fr;
  }
  /* Street on its own line, number and box side by side under it. */
  .pfb-form-row--address {
    grid-template-columns: 1fr 1fr;
  }
  .pfb-form-row--address > :first-child {
    grid-column: 1 / -1;
  }
  .pfb-form-row--3 {
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: 0.5rem;
  }
  /* Room for "Année" next to the arrow on a phone. */
  .pfb-form-row--3 select {
    padding-inline: 0.75rem 0.5rem;
  }
}

/* Submit button — ensure it stretches full width even with the base .pfb-btn inline-flex */
.pfb-form-submit {
  width: 100%;
  min-height: 3.25rem;
  margin-top: 0.5rem;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
}

/* Terms & conditions consent */
.pfb-form-terms {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary, #555);
  line-height: 1.5;
  cursor: pointer;
}

.pfb-form-terms input[type="checkbox"] {
  margin-top: 0.125rem;
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--color-gold, #FDDA24);
  flex-shrink: 0;
}

.pfb-form-terms a {
  color: var(--color-text, #111);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--color-gold, #FDDA24);
  text-underline-offset: 2px;
}

.pfb-form-terms a:hover {
  text-decoration-color: var(--color-text, #111);
}

/* Notice banners (success / form-level error) */
.pfb-form-notice {
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md, 10px);
  font-size: 0.875rem;
  line-height: 1.5;
}

.pfb-form-notice--success {
  background-color: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.3);
  color: #15803D;
}

.pfb-form-notice--error {
  background-color: rgba(239, 51, 64, 0.08);
  border: 1px solid rgba(239, 51, 64, 0.3);
  color: #C41F2D;
}
