@layer crm-components {
body.crm-auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 3vw, 3rem);
    color: var(--crm-color-ink);
    background: radial-gradient(circle at 92% 1%, var(--crm-ambient-2), transparent 34rem),
      radial-gradient(circle at 2% 10%, var(--crm-ambient-1), transparent 28rem),
      radial-gradient(circle at 77% 94%, var(--crm-ambient-3), transparent 32rem),
      linear-gradient(145deg, var(--crm-color-canvas), var(--crm-color-canvas-deep));
}

.crm-auth-shell {
  width: min(1020px, 100%);
  min-height: 35rem;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(440px, 1.1fr);
  overflow: hidden;
  border: 1px solid var(--crm-color-border-strong);
  border-radius: 2rem;
  background: var(--crm-surface-accent-bg);
  box-shadow: 0 26px 72px var(--crm-color-glass-shadow);
}

.crm-auth-intro,
.crm-auth-card { padding: clamp(2.35rem, 4vw, 3.5rem); border-color: var(--crm-color-border); color: var(--crm-color-ink); background: var(--crm-panel-bg); }

.crm-auth-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;

  border-inline-end: 1px solid var(--crm-component-rule);
    border-color: var(--crm-color-border);
    color: var(--crm-color-ink);
    background: var(--crm-panel-bg);
}

.crm-auth-brand { display: flex; gap: 0.85rem; align-items: center; color: inherit; text-decoration: none; }
.crm-auth-brand__mark { display: grid; place-items: center; inline-size: 3.15rem; block-size: 3.15rem; border-radius: 1rem; background: var(--crm-brand-mark-bg); color: var(--crm-color-on-accent); box-shadow: var(--crm-brand-mark-shadow); font-weight: 720; }
.crm-auth-brand strong { display: block; font-size: 1.05rem; font-weight: 650; letter-spacing: -0.02em; }
.crm-auth-brand span:last-child { color: var(--crm-color-ink-muted); font-size: var(--crm-type-label); }
.crm-auth-intro h1 { max-width: 12ch; margin: 2rem 0 0.9rem; font-size: clamp(2.25rem, 3.5vw, 3.05rem); line-height: 1; letter-spacing: -0.048em; font-weight: 650; }
.crm-auth-intro p { max-width: 36ch; color: var(--crm-color-ink-muted); font-size: var(--crm-type-control); line-height: 1.55; }
.crm-auth-card { display: flex; flex-direction: column; justify-content: center; border-color: var(--crm-color-border); color: var(--crm-color-ink); background: var(--crm-panel-bg); }
.crm-auth-card h2 { margin: 0.45rem 0 0.55rem; font-size: 1.52rem; line-height: 1.15; letter-spacing: -0.03em; font-weight: 650; }
.crm-auth-card > p { margin: 0 0 1.65rem; color: var(--crm-color-ink-muted); font-size: var(--crm-type-control); line-height: 1.5; }
.crm-auth-form { display: grid; gap: 1rem; }
.crm-auth-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.crm-auth-appearance { width: 100%; max-width: 28rem; min-width: 0; margin: var(--crm-space-5) 0 0; padding: 0; border: 0; }
.crm-auth-appearance > legend { padding: 0; margin-bottom: var(--crm-space-2); color: var(--crm-color-ink-muted); font-size: var(--crm-type-label); font-weight: 620; }
.crm-auth-appearance .crm-choice-group { --crm-choice-columns: 3; margin: 0; }
.crm-auth-field { display: grid; gap: 0.45rem; }
.crm-auth-field label { font-size: var(--crm-type-control); font-weight: 620; }
.crm-auth-field__hint { color: var(--crm-color-ink-muted); font-size: var(--crm-type-caption); line-height: 1.4; }
.crm-auth-field input:not(:where([type="checkbox"], [type="radio"])),
.crm-auth-field select { min-block-size: 3.15rem; inline-size: 100%; padding: 0 0.95rem; border: 1px solid var(--crm-control-border); border-radius: var(--crm-control-radius); background: var(--crm-control-bg); box-shadow: var(--crm-control-shadow); font: inherit; color: inherit; }
.crm-auth-field input:not(:where([type="checkbox"], [type="radio"])):focus-visible,
.crm-auth-field select:focus-visible { outline: 3px solid var(--crm-control-focus-ring); border-color: var(--crm-control-focus-border); }
.crm-auth-error { min-height: 24px; color: var(--crm-color-danger); }
.crm-auth-options { min-width: 0; margin: 0; padding: 0; border: 0; }
.crm-auth-options > legend { padding: 0; font-size: var(--crm-type-control); font-weight: 620; }
.crm-auth-options > p { margin: 0; }
.crm-auth-links { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.2rem; }
.crm-auth-links a { min-block-size: 2.75rem; display: inline-flex; align-items: center; color: var(--crm-color-link); font-size: var(--crm-type-control); text-underline-offset: 0.18em; }
.crm-auth-local { margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: var(--crm-surface-accent-bg); color: var(--crm-color-accent-deep); }

.crm-auth-mfa {
  display: grid;
  gap: 1rem;
}

.crm-auth-mfa__setup,
.crm-auth-mfa__recovery {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--crm-component-rule);
  border-radius: var(--crm-control-radius);
  background: var(--crm-subpanel-bg);
}

.crm-auth-mfa__setup h3,
.crm-auth-mfa__recovery h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.crm-auth-mfa__setup p,
.crm-auth-mfa__recovery p {
  margin: 0;
  color: var(--crm-color-ink-muted);
  font-size: var(--crm-type-label);
  line-height: 1.5;
}

.crm-auth-mfa__app-link {
  min-block-size: 2.75rem;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: var(--crm-color-link);
  font-size: var(--crm-type-label);
  font-weight: 620;
  text-underline-offset: 0.18em;
}

.crm-auth-mfa__key {
  display: grid;
  gap: 0.35rem;
}

.crm-auth-mfa__key > span {
  color: var(--crm-color-ink-muted);
  font-size: var(--crm-type-caption);
}

.crm-auth-mfa__key code,
.crm-auth-mfa__recovery code {
  padding: 0.75rem;
  border-radius: calc(var(--crm-control-radius) - 0.25rem);
  background: var(--crm-control-bg);
  color: var(--crm-color-ink);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: var(--crm-type-label);
  font-variant-numeric: tabular-nums;
  line-height: 1.55;
  overflow-wrap: anywhere;
  user-select: all;
}

.crm-auth-mfa__recovery code {
  white-space: pre-line;
  columns: 2;
  column-gap: 1rem;
}



.crm-auth-intro__copy { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; align-content: start; gap: 0; overflow-wrap: anywhere; }
.crm-auth-intro__facts { display: grid; gap: 0; margin: 1.5rem 0 0; }
.crm-auth-intro__facts > div { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 0.75rem; align-items: center; min-height: 2.7rem; border-block-start: 1px solid var(--crm-component-rule); }
.crm-auth-intro__facts dt { color: var(--crm-color-link); font-size: var(--crm-type-caption); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.08em; }
.crm-auth-intro__facts dd { margin: 0; color: var(--crm-color-ink-soft); font-size: var(--crm-type-label); font-weight: 560; }
.crm-auth-card__intro > .crm-eyebrow { margin: 0; }

body.crm-auth-page[data-auth-mode="register"] .crm-auth-shell {
  min-height: 0;
  grid-template-columns: minmax(22rem, 0.92fr) minmax(31rem, 1.08fr);
}

body.crm-auth-page[data-auth-mode="register"] .crm-auth-intro,
body.crm-auth-page[data-auth-mode="register"] .crm-auth-card {
  padding: clamp(2rem, 3vw, 2.75rem);
}

body.crm-auth-page[data-auth-mode="register"] .crm-auth-intro {
  min-height: 39rem;
  justify-content: flex-start;
}

body.crm-auth-page[data-auth-mode="register"] .crm-auth-intro__copy {
  margin-top: clamp(3rem, 7vh, 5.25rem);
}

body.crm-auth-page[data-auth-mode="register"] .crm-auth-intro h1 {
  max-width: 11ch;
  margin: 0.55rem 0 0.8rem;
  font-size: clamp(2.05rem, 3vw, 2.75rem);
}

body.crm-auth-page[data-auth-mode="register"] .crm-auth-intro__copy > p:last-of-type {
  margin: 0;
}

body.crm-auth-page[data-auth-mode="register"] .crm-auth-intro__facts {
  margin-top: auto;
  padding-top: 2rem;
}

body.crm-auth-page[data-auth-mode="register"] .crm-auth-card {
  justify-content: flex-start;
}

body.crm-auth-page[data-auth-mode="register"] .crm-auth-card__intro > p:last-child {
  margin: 0 0 1.35rem;
}

body.crm-auth-page[data-auth-mode="register"] .crm-auth-card h2 {
  margin-top: 0.35rem;
}

body.crm-auth-page[data-auth-mode="register"] .crm-auth-form {
  gap: 0.8rem;
}

body.crm-auth-page[data-auth-mode="register"] .crm-auth-field input:not(:where([type="checkbox"], [type="radio"])),
body.crm-auth-page[data-auth-mode="register"] .crm-auth-field select {
  min-block-size: 3rem;
}

body.crm-auth-page[data-auth-mode="register"] .crm-auth-error {
  min-height: 1rem;
  margin: 0;
  font-size: var(--crm-type-label);
}

body.crm-auth-page[data-auth-mode="register"] .crm-auth-links {
  margin-top: 0.9rem;
}

@media (max-width: 900px) {
  body.crm-auth-page { padding: 0; color: var(--crm-color-ink); background: radial-gradient(circle at 92% 1%, var(--crm-ambient-2), transparent 34rem),
      radial-gradient(circle at 2% 10%, var(--crm-ambient-1), transparent 28rem),
      radial-gradient(circle at 77% 94%, var(--crm-ambient-3), transparent 32rem),
      linear-gradient(145deg, var(--crm-color-canvas), var(--crm-color-canvas-deep)); }
  .crm-auth-shell { min-height: 100vh; grid-template-columns: 1fr; border-radius: 0; }
  .crm-auth-intro { min-height: 260px; border-inline-end: 0; border-block-end: 1px solid var(--crm-component-rule); border-color: var(--crm-color-border); color: var(--crm-color-ink); background: var(--crm-panel-bg); }
  .crm-auth-intro h1 { font-size: 3rem; }
  .crm-auth-mfa__recovery code { columns: 1; }
}

}
