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

   ONLY styling unique to the login page (spec §L). Buttons, fields, cards,
   alerts and layout all come from the component and layout layers. If anything
   here starts appearing on a second page, promote it to components/ in the same
   change that introduces the second use.
   ============================================================================= */

/* ── Clinic-address confirmation row ──────────────────────────────────────
   Fills in as the address is typed, confirming which clinic is about to be
   signed in to. It confirms; it never gates or hides a field. */
.bui-clinic-feedback {
  display: flex;
  align-items: flex-start;
  gap: var(--bui-space-1);
  margin-top: var(--bui-space-2);
  min-height: 18px;
  font-size: var(--bui-text-xs);
  line-height: var(--bui-lh-snug);
  color: var(--bui-ink-500);
  transition: color var(--bui-transition);
}

/* Icon + text + colour: three signals, never colour alone (spec §F.3) */
.bui-clinic-feedback.is-ok {
  color: var(--bui-success);
  font-weight: var(--bui-fw-medium);
}

.bui-clinic-feedback.is-ok::before {
  content: '\2713';
  flex-shrink: 0;
  font-weight: var(--bui-fw-heavy);
}

.bui-clinic-feedback.is-bad {
  color: var(--bui-danger);
  font-weight: var(--bui-fw-medium);
}

.bui-clinic-feedback.is-bad::before {
  content: '\26A0';
  flex-shrink: 0;
}

.bui-clinic-feedback.is-checking::before {
  content: '';
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  margin-top: 3px;
  border: 2px solid var(--bui-line-strong);
  border-top-color: var(--bui-primary-700);
  border-radius: 50%;
  animation: bui-spin .6s linear infinite;
}

/* ── Tenant-locked header ─────────────────────────────────────────────────
   On a clinic's own host the hostname already answered which clinic this is,
   so the card names the clinic instead of asking for it again. */
.bui-login-tenant {
  display: flex;
  align-items: center;
  gap: var(--bui-space-3);
  padding: var(--bui-space-3) var(--bui-space-4);
  margin-bottom: var(--bui-space-6);
  background: var(--bui-primary-50);
  border: 1px solid var(--bui-primary-200);
  border-radius: var(--bui-radius-md);
}

.bui-login-tenant-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  background: var(--bui-primary-100);
  border-radius: var(--bui-radius-sm);
  color: var(--bui-primary-700);
  font-size: 1rem;
}

.bui-login-tenant-name {
  font-size: var(--bui-text-sm);
  font-weight: var(--bui-fw-bold);
  color: var(--bui-ink-900);
}

.bui-login-tenant-host {
  font-size: var(--bui-text-xs);
  color: var(--bui-ink-500);
  font-variant-numeric: tabular-nums;
}

/* ── OTP step ─────────────────────────────────────────────────────────────
   The old page shipped a bare unlabelled text input. This is a designed step:
   wide tracking, tabular numerals, a visible timer. */
.bui-otp-input {
  font-family: var(--bui-font-mono);
  font-size: 1.375rem;
  font-weight: var(--bui-fw-bold);
  letter-spacing: .5em;
  text-align: center;
  text-indent: .5em; /* offsets the trailing letter-spacing so digits look centred */
  font-variant-numeric: tabular-nums;
}

.bui-otp-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--bui-space-1);
  margin-top: var(--bui-space-4);
  font-size: var(--bui-text-xs);
  color: var(--bui-ink-500);
  text-align: center;
}

.bui-otp-timer {
  font-variant-numeric: tabular-nums;
  font-weight: var(--bui-fw-bold);
  color: var(--bui-primary-700);
}

.bui-otp-meta.is-expired {
  color: var(--bui-danger);
  font-weight: var(--bui-fw-medium);
}

.bui-otp-meta.is-expired .bui-otp-timer {
  color: var(--bui-danger);
}

/* ── Find-clinic modal body ───────────────────────────────────────────────── */
.bui-find-clinic-feedback {
  min-height: 18px;
  margin-top: var(--bui-space-2);
  font-size: var(--bui-text-xs);
  line-height: var(--bui-lh-snug);
}

.bui-find-clinic-feedback.is-ok  { color: var(--bui-success); }
.bui-find-clinic-feedback.is-bad { color: var(--bui-danger); }

@media (max-width: 575.98px) {
  .bui-otp-input {
    font-size: 1.125rem;
    letter-spacing: .35em;
    text-indent: .35em;
  }
}
