/* =============================================================================
   BUAMS AI new-ui — REGISTER PAGE
   Spec: /frontend_design.md §J.2

   ONLY styling unique to registration (spec §L). Sections, fields and buttons
   come from the component layer.
   ============================================================================= */

/* The register form is the longest in Phase 1, so its card gets a wider
   measure than the auth default to keep the three sections readable. */
.bui-register-panel {
  max-width: 560px;
}

/* ── Terms row ────────────────────────────────────────────────────────────── */
.bui-terms {
  padding: var(--bui-space-3) var(--bui-space-4);
  margin-bottom: var(--bui-space-5);
  background: var(--bui-surface-2);
  border: 1px solid var(--bui-line);
  border-radius: var(--bui-radius-md);
}

.bui-terms.is-invalid {
  border-color: var(--bui-danger);
  background: var(--bui-danger-bg);
}

/* ── intl-tel-input integration ───────────────────────────────────────────
   The library injects its own wrapper and an absolutely-positioned country
   dropdown. These rules re-fit it to the .bui-input geometry without forking
   the library's internals (spec §P). */
.iti {
  display: block;
  width: 100%;
}

.iti__flag-container {
  border: 0;
}

.iti--separate-dial-code .iti__selected-flag {
  background: var(--bui-surface-2);
  border-radius: var(--bui-radius-md) 0 0 var(--bui-radius-md);
}

.iti__country-list {
  border: 1px solid var(--bui-line-strong);
  border-radius: var(--bui-radius-md);
  box-shadow: var(--bui-shadow-md);
  font-size: var(--bui-text-sm);
}

.iti__country.iti__highlight {
  background: var(--bui-primary-50);
}

.iti__dial-code {
  color: var(--bui-ink-500);
}

@media (max-width: 575.98px) {
  .bui-register-panel {
    max-width: none;
  }

  /* The country list is absolutely positioned and will overflow a narrow
     card; cap it to the field width so the page never scrolls sideways. */
  .iti__country-list {
    max-width: calc(100vw - var(--bui-space-10));
  }
}
