/*
 * Auth + onboarding UI, modeled on the Peak Health "Create a free account" mock:
 * a light-blue page with a centered card that frames the sign-in, account, and
 * onboarding-wizard forms. Loaded by the `application` layout (see base.css for
 * shared tokens). Carrier branding (e.g. logo) is derived from the invite later.
 * Propshaft serves this directly; keep it plain CSS.
 */

.brand-bar {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-primary);
  font-size: 20px;
  font-weight: 800;
}

.page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 20px 40px;
}

.card {
  width: 100%;
  max-width: 568px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 2px 3px rgba(173, 191, 204, 0.33);
  padding: 40px 46px 46px;
}

.card h1 {
  margin: 0 0 32px;
  color: var(--color-primary);
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
}

.card form > div {
  margin-bottom: 20px;
}

/* Labeled-control (.form-field), label, input/select, submit, and .field-hint
   styling now live in the shared forms.css (loaded by both layouts). */

.card a {
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: underline;
}

/* Onboarding wizard */
.step-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background-color: transparent;
}

.step-dot--active {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.section-heading {
  margin: 8px 0 16px;
  font-size: 16px;
  font-weight: 800;
}

/* Collapsible card used for the optional upline/downline sections on the
   hierarchy step. Built on native <details>/<summary> so it toggles without JS;
   the chevron is a CSS-drawn arrow that flips when the card is open. */
.accordion {
  margin-bottom: 16px;
  padding: 20px 24px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.accordion > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.accordion > summary::-webkit-details-marker {
  display: none;
}

.accordion > summary::after {
  content: "";
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.accordion[open] > summary::after {
  transform: rotate(-135deg);
}

/* Space the content off the title only while expanded (so a collapsed card has
   no trailing gap). Applies to every accordion, whether its body is wrapped in
   .accordion__body or the fields follow the summary directly. */
.accordion[open] > summary {
  margin-bottom: 20px;
}

.join-code {
  color: var(--color-success);
  font-weight: 800;
}

.blue-box {
  padding: 20px;
  margin-bottom: 20px;
  background-color: #f2faff;
  border: 1px solid #afdcfa;
  border-radius: var(--radius);
}

.button-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.button-row .button-plain {
  flex-shrink: 0;
}

.button-row input[type="submit"],
.button-row .button-primary {
  flex: 1;
}

/* Secondary (outline) buttons. Covers both `a` (e.g. Back links) and real
   `button` elements like the "Invite agents"/dialog controls. The `a` variant
   is scoped to `.card a` so it overrides the generic `.card a` link color. */
.card a.button-plain,
.card button.button-plain {
  display: inline-block;
  /* Override the global .button-plain fixed height (base.css): card buttons are
     sized by their larger padding, matching the full-width submit beside them. */
  height: auto;
  padding: 14px 20px;
  background-color: var(--color-surface);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.card button.button-plain:hover {
  background-color: var(--color-field);
}

.card button.button-plain:disabled {
  color: var(--color-muted);
  border-color: var(--color-border);
  background-color: var(--color-surface);
  cursor: not-allowed;
}

/* A modal footer submit inside a card (the downline-invite modal) must not take
   the card form's full-width submit treatment; keep it auto-width and right-aligned
   like every other modal footer. Scoped past .card input[type="submit"] and loaded
   after forms.css, so it wins on both counts. */
.card .modal__footer input[type="submit"],
.card .modal__footer button[type="submit"] {
  width: auto;
}

/* Borderless text button (e.g. the modal "Cancel" action). */
.card button.button-link {
  padding: 14px 16px;
  background: none;
  border: none;
  color: var(--color-primary);
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

/* Modal chrome (`.modal*`) now lives in base.css so it is shared by both the
   auth and portal layouts. The invitee-row styles below stay here: they are
   specific to the agency-onboarding downline modal and its `.card` context. */

/* One dynamic add/remove invitee row in the downline-invite modal. A divider
   separates stacked rows; the last row's divider is dropped so it doesn't sit
   above the "Add another agent" action. */
.invitee-row {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.invitee-row:last-child {
  border-bottom: none;
}

/* Compact the row so several invitees fit without scrolling: smaller labels and
   inputs, and tighter gaps than the full-size onboarding form fields. */
.invitee-row .form-field {
  margin-bottom: 8px;
}

.invitee-row .field-row {
  gap: 12px;
}

.card .invitee-row label {
  margin-bottom: 4px;
  font-size: 13px;
}

.card .invitee-row input[type="text"],
.card .invitee-row input[type="email"] {
  padding: 8px 12px;
  font-size: 14px;
}

/* Compact, borderless remove control (a smaller, muted `.button-link`). */
.card button.invitee-row__remove {
  padding: 2px 0;
  font-size: 13px;
  color: var(--color-muted);
}

/* A primary-styled link used as a row button (e.g. onboarding "Skip") beside a
   .card .button-plain (the "Back" link). Mirror that sibling's box model exactly
   -- height auto, the same 14px vertical padding, and font-size 16px -- so the two
   row buttons are the same height. (Base .button-primary's 40px height and 15px
   font don't apply here; overriding them is what keeps the pair aligned.) */
.card a.button-primary--link {
  display: inline-block;
  height: auto;
  padding: 14px 20px;
  background-color: var(--color-primary);
  color: var(--color-surface);
  /* Transparent 1px border to occupy the same box space as the Back link's
     1px outline; under global border-box this keeps the pair the exact same
     height. The fill shows through it (background-clip defaults to border-box),
     so the button still reads as a solid primary button. */
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

/* Generic form controls (.form-errors, .file-upload*, .field-row*, radios,
   .select-card) now live in the shared forms.css. */
