/* ==========================================================================
   COMPONENTS · FIELDSET — a labelled SECTION of a settings/account form (not a
   single control — that is .op-field). The GitHub-settings pattern: an
   explanatory description column beside a stack of fields, split two-up on wide
   screens and stacked below, with a hairline between sections. The --danger
   variant is the delete-account "danger zone" — a brick-keyed critical plate,
   decoupled from the rubric so a destructive act never reads as brand.
   ========================================================================== */

.op-fieldset {
  /* neutralise the base <fieldset> element when used as one */
  margin: 0;
  border: 0;
  padding: 0;
  min-inline-size: 0;
  display: grid;
  gap: var(--space-md);
  align-items: start;
}

/* Two-up on wide screens: description left (~16rem), controls right */
@media (min-width: 56.25rem) {
  .op-fieldset {
    grid-template-columns: 16rem minmax(0, 1fr);
    gap: var(--space-xl);
  }
}

/* A hairline divides consecutive sections; gap without a rule before a plate */
.op-fieldset + .op-fieldset {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--rule);
}
.op-fieldset + .op-fieldset--danger { padding-top: 0; border-top: 0; }

/* — The description column — */
.op-fieldset__head {
  display: grid;
  gap: var(--space-2xs);
  align-content: start;
}
.op-fieldset__legend {
  margin: 0;
  padding: 0;
  font-family: var(--font-reading);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
}
.op-fieldset__desc {
  margin: 0;
  font-family: var(--font-furniture);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}

/* — The controls column: a stack of .op-field — */
.op-fieldset__body {
  display: grid;
  gap: var(--space-md);
  min-inline-size: 0;
}

/* — The save/submit row, set off by a faint rule — */
.op-fieldset__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-2xs);
  padding-top: var(--space-md);
  border-top: 1px solid var(--rule-faint);
}

/* — Danger zone: a self-bordered brick plate, heading in critical ink. The box
   itself (a shape cue) plus the literal heading carry the warning — never hue
   alone — and the brick stays distinct from the rubric. — */
.op-fieldset--danger {
  border: 1px solid var(--critical);
  border-radius: var(--radius-sm);
  background: var(--critical-wash);
  padding: var(--space-lg);
}
.op-fieldset--danger .op-fieldset__legend { color: var(--critical); }
