.auth-gate {
  --auth-bg: #111416;
  --auth-visual: #171b1e;
  --auth-panel: #121517;
  --auth-card: rgba(28, 32, 35, .94);
  --auth-card-soft: #202529;
  --auth-text: #eceeed;
  --auth-muted: #aeb5b8;
  --auth-line: #343b40;
  --auth-primary: #b79a5d;
  --auth-primary-strong: #c6aa6a;
  --auth-primary-soft: rgba(183, 154, 93, .13);
  --auth-on-primary: #171510;
  --auth-focus: #c6aa6a;
  min-height: 100dvh;
  box-sizing: border-box;
  padding-top: var(--atrium-safe-top, 0px);
  padding-bottom: var(--atrium-safe-bottom, 0px);
  grid-template-columns: minmax(360px, 1.08fr) minmax(430px, .92fr);
  color: var(--auth-text);
  background: var(--auth-bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="light"] .auth-gate {
  --auth-bg: #eef1f1;
  --auth-visual: #e8edef;
  --auth-panel: #f4f5f3;
  --auth-card: rgba(255, 255, 253, .94);
  --auth-card-soft: #eef1f1;
  --auth-text: #252a2e;
  --auth-muted: #606970;
  --auth-line: #d2d8da;
  --auth-primary: #d4e5ed;
  --auth-primary-strong: #42677a;
  --auth-primary-soft: rgba(154, 190, 207, .22);
  --auth-on-primary: #284654;
  --auth-focus: #526d7c;
}

.auth-gate .auth-topbar {
  position: static;
  grid-row: 1;
  align-self: start;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  pointer-events: none;
}
.auth-gate .auth-topbar > * { pointer-events: auto; }

.auth-gate:has(#authSetupForm.active) .auth-card {
  padding-top: 14px;
  padding-bottom: 14px;
}
.auth-gate:has(#authSetupForm.active) .auth-topbar {
  margin: 0;
  padding: 0;
}
.auth-gate:has(#authSetupForm.active) #authIdentityStep > h2 {
  margin: 4px 0 6px;
}
.auth-gate:has(#authSetupForm.active) #authIdentityStep > p {
  margin: 0 0 10px;
}
.auth-gate:has(#authSetupForm.active) .auth-setup-grid > label {
  margin-bottom: 5px;
}
.auth-gate:has(#authSetupForm.active) .auth-submit {
  margin-top: 8px;
}

.auth-gate .auth-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-gate .auth-back-to-landing {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--auth-text);
  text-decoration: none;
  cursor: pointer;
  background: var(--auth-card-soft);
  border: 1px solid var(--auth-line);
  border-radius: var(--v2-radius-round, 999px);
  box-shadow: none;
  transition: all var(--v2-duration-fast, 180ms) var(--v2-ease-standard, ease);
}

.auth-gate .auth-back-to-landing svg.atrium-icon {
  width: 13px;
  height: 13px;
  transition: transform var(--v2-duration-fast, 180ms) ease;
}

.auth-gate .auth-back-to-landing:hover {
  color: var(--v2-color-gold, #c69f53);
  border-color: var(--v2-color-gold, #c69f53);
  background: var(--auth-card);
}

.auth-gate .auth-back-to-landing:hover svg.atrium-icon {
  transform: translateX(-2px);
}

.auth-gate .auth-theme-toggle {
  position: static;
  width: 44px;
  height: 44px;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--auth-text);
  background: var(--auth-card-soft);
  border: 1px solid var(--auth-line);
  border-radius: var(--v2-radius-round, 999px);
  box-shadow: none;
  cursor: pointer;
  transition: all var(--v2-duration-fast, 180ms) var(--v2-ease-standard, ease);
}

.auth-gate .auth-theme-toggle:hover {
  color: var(--v2-color-gold, #c69f53);
  border-color: var(--v2-color-gold, #c69f53);
  background: var(--auth-card);
}

.auth-gate .auth-visual {
  isolation: isolate;
  min-width: 0;
  padding: clamp(36px, 5vw, 76px);
  border-right: 1px solid var(--auth-line);
  background: var(--auth-visual);
}

.auth-gate .auth-visual::before,
.auth-gate .auth-visual::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.auth-gate .auth-visual::before {
  inset: clamp(24px, 4vw, 58px);
  border: 1px solid color-mix(in srgb, var(--auth-line) 72%, transparent);
  border-left-color: transparent;
  opacity: .66;
}

.auth-gate .auth-visual::after {
  right: clamp(34px, 5vw, 80px);
  bottom: clamp(34px, 5vw, 76px);
  width: min(34vw, 430px);
  height: 1px;
  background: var(--auth-primary);
  opacity: .58;
}

.auth-gate .auth-brand-logo,
.auth-gate .auth-visual-copy,
.auth-gate .auth-security-list {
  position: relative;
  z-index: 1;
}

.auth-gate .auth-logo-frame {
  display: inline-flex;
  align-items: center;
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--auth-card) 62%, transparent);
  backdrop-filter: blur(12px);
}

.auth-gate .auth-brand-svg { width: clamp(210px, 22vw, 300px); height: auto; }
.auth-gate .auth-brand-light { display: none; }
.auth-gate .auth-brand-dark { display: block; }
html[data-theme="light"] .auth-gate .auth-logo-frame {
  border-color: var(--auth-line);
  background: rgba(255, 255, 253, .72);
}
html[data-theme="light"] .auth-gate .auth-brand-light { display: block; }
html[data-theme="light"] .auth-gate .auth-brand-dark { display: none; }
.auth-gate .auth-visual-copy { max-width: 700px; margin: clamp(62px, 11vh, 118px) 0 clamp(36px, 6vh, 68px); }

.auth-gate .auth-visual-copy .eyebrow {
  margin: 0;
  color: var(--auth-primary-strong);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.auth-gate .auth-visual-copy h1 {
  margin: 16px 0 22px;
  color: var(--auth-text);
  font: 600 clamp(32px, 5.2vw, 48px)/1.01 "Playfair Display", Georgia, serif;
  letter-spacing: -.025em;
}

.auth-gate .auth-visual-copy h1 em {
  color: var(--auth-primary-strong);
  font-size: 20px;
  font-style: normal;
  font-weight: 560;
  letter-spacing: -.01em;
}
.auth-gate .auth-visual-copy > p { max-width: 610px; margin: 0; color: var(--auth-muted); font-size: 16px; line-height: 1.68; }

.auth-gate .auth-intro-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.auth-gate .auth-intro-flow li { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: start; gap: 9px; padding-top: 12px; border-top: 1px solid var(--auth-line); }
.auth-gate .auth-intro-flow li > span { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--auth-primary-strong); border-radius: 50%; color: var(--auth-primary-strong); font-size: 12px; font-weight: 800; }
.auth-gate .auth-intro-flow div { display: grid; gap: 4px; }
.auth-gate .auth-intro-flow strong { color: var(--auth-text); font-size: 12px; line-height: 1.35; }
.auth-gate .auth-intro-flow small { color: var(--auth-muted); font-size: 12px; line-height: 1.45; }

.auth-gate .auth-security-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 24px;
  color: var(--auth-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .055em;
  line-height: 1.45;
  text-transform: uppercase;
}

.auth-gate .auth-security-list span {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--auth-line);
}

.auth-gate .auth-security-list span > span {
  display: block;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

/* Em telas estreitas, cada garantia empilha e pode quebrar: sem overflow horizontal. */
@media (max-width: 980px) {
  .auth-gate .auth-security-list { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .auth-gate .auth-security-list span > span { white-space: normal; }
}

.auth-gate .auth-panel {
  position: relative;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(44px, 1fr) auto minmax(44px, 1fr);
  gap: var(--v2-space-4, 16px);
  align-items: center;
  justify-items: center;
  padding: 24px clamp(24px, 4vw, 56px);
  background: var(--auth-panel);
  box-sizing: border-box;
}

.auth-gate .auth-card {
  position: relative;
  grid-row: 2;
  width: min(100%, 520px);
  max-height: none;
overflow: visible;
padding: 18px clamp(24px, 3.2vw, 36px) 18px;
border: 1px solid var(--auth-line);
border-radius: 18px;
color: var(--auth-text);
background: var(--auth-card);
box-shadow: 0 18px 50px -38px rgba(0, 0, 0, .68);
}

.auth-gate .auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  /* Override portal.css 48px margin-top — zero dead void between topbar and tabs */
  margin-top: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--auth-line);
  border-radius: 10px;
  background: var(--auth-card-soft);
}

.auth-gate #authRegisterForm .auth-register-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--v2-space-2);
  margin: 0 0 var(--v2-space-4);
  padding: 0;
  list-style: none;
  color: var(--auth-muted);
  font-size: 12px;
}

.auth-gate #authRegisterForm .auth-register-progress li {
  padding-block: var(--v2-space-2);
  border-bottom: 2px solid var(--auth-line);
}

.auth-gate #authRegisterForm .auth-register-progress [aria-current="step"] {
  color: var(--auth-text);
  border-color: var(--auth-focus);
  font-weight: 700;
}

.auth-gate #authRegisterForm .auth-form-desc {
  margin: 0 0 var(--v2-space-3);
  color: var(--auth-muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-gate #authRegisterForm .auth-register-actions {
  display: flex;
  gap: var(--v2-space-2);
  margin-top: var(--v2-space-3);
}

.auth-gate #authRegisterForm .auth-register-actions .button {
  flex: 1;
  min-height: 46px;
  margin: 0;
}

.auth-gate #authRegisterForm .auth-register-footer {
  flex-wrap: wrap;
  margin-top: var(--v2-space-3);
  padding-top: var(--v2-space-2);
}

.auth-gate #authRegisterForm :is(input:not([type="checkbox"]), select) {
  min-height: 46px;
}

.auth-gate #authRegisterFeedback {
  margin: var(--v2-space-3) 0 0;
  overflow-wrap: anywhere;
}

.auth-gate:has(#authRegisterForm.active) .auth-tab,
.auth-gate:has(#authRegisterForm.active) .auth-back-to-landing,
.auth-gate:has(#authRegisterForm.active) .auth-theme-toggle {
  min-height: 44px;
}

.auth-gate:has(#authRegisterForm.active) .auth-theme-toggle {
  min-width: 44px;
}

.auth-gate #authRegisterForm[aria-busy="true"],
.auth-gate #authRegisterForm :disabled {
  cursor: wait;
}

@media (max-width: 520px) {
  .auth-gate #authRegisterForm :is(input, select) { font-size: 16px; }
}

.auth-gate .auth-tab {
  min-width: 0;
  min-height: 38px;
  padding: 6px 4px;
  border-radius: 7px;
  color: var(--auth-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  text-align: center;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-gate .auth-tab:hover { color: var(--auth-text); background: color-mix(in srgb, var(--auth-card) 70%, transparent); }
.auth-gate .auth-tab.active {
  background: rgba(212, 175, 55, 0.16) !important;
  color: #d4af37 !important;
  border: 1px solid rgba(212, 175, 55, 0.32) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
  font-weight: 700 !important;
}

.auth-gate .auth-forgot-wrap {
  text-align: center;
  margin: 10px auto 4px;
}

.auth-gate .auth-forgot-password-link,
.auth-gate .auth-link-action,
.auth-gate button.auth-forgot-password-link,
.auth-gate button.auth-link-action {
  appearance: none !important;
  -webkit-appearance: none !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 4px 6px !important;
  margin: 0 !important;
  font-family: inherit !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #c6aa6a !important;
  cursor: pointer !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 44px;
  transition: opacity 0.15s ease !important;
}

html[data-theme="light"] .auth-gate .auth-forgot-password-link,
html[data-theme="light"] .auth-gate .auth-link-action,
html[data-theme="light"] .auth-gate button.auth-forgot-password-link,
html[data-theme="light"] .auth-gate button.auth-link-action {
  color: #2b576e !important;
}

.auth-gate .auth-forgot-password-link:hover,
.auth-gate .auth-link-action:hover {
  opacity: .75 !important;
}

.auth-gate .auth-card-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--auth-line);
  text-align: center;
}

.auth-gate .auth-card-footer.hidden {
  display: none !important;
}

.auth-gate .auth-footer-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: var(--auth-muted);
  flex-wrap: wrap;
}

.auth-gate .auth-footer-legal {
  margin: 10px auto 0 !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
  color: #8c969e !important;
  text-align: center !important;
  max-width: 440px !important;
  font-weight: 400 !important;
  opacity: .85 !important;
}

html[data-theme="light"] .auth-gate .auth-footer-legal {
  color: #8c969e !important;
}

.auth-gate .auth-register-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--auth-line);
  font-size: 13px;
  color: var(--auth-muted);
}

.auth-gate .auth-step.active { animation: authMineralReveal 180ms ease both; }
.auth-gate .auth-step .eyebrow { color: var(--auth-primary-strong); }
.auth-gate .auth-step h2 { margin: 8px 0 12px; color: var(--auth-text); font-size: clamp(24px, 3vw, 32px); }
.auth-gate .auth-step > p:not(.eyebrow) { margin-bottom: 22px; color: var(--auth-muted); }

.auth-gate #authSetupForm > .eyebrow { padding-right: 48px; }
.auth-gate #authSetupForm > p:not(.eyebrow) { margin-bottom: 10px; line-height: 1.45; }
.auth-gate :is(#authIdentityStep, #authMonitoringStep) > .eyebrow { padding-right: 48px; }
.auth-gate :is(#authIdentityStep, #authMonitoringStep) > p:not(.eyebrow) { margin: 0 0 18px; color: var(--auth-muted); line-height: 1.45; }

.auth-gate .auth-step label {
  gap: 7px;
  margin: 14px 0;
  color: var(--auth-muted);
  font-size: 12px;
  letter-spacing: .065em;
}

.auth-gate .auth-setup-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.auth-gate .auth-setup-grid > label,
.auth-gate .auth-field-row label {
  margin: 0 0 8px;
  gap: 5px;
}

.auth-gate .auth-field-row {
  grid-template-columns: minmax(0, 1fr) 136px;
  align-items: end;
  gap: 12px;
}

.auth-gate .auth-uf-label { padding-left: 8px; text-align: left; }

.auth-gate .auth-field-row input,
.auth-gate .auth-field-row select {
  min-height: 42px;
}

.auth-gate #authSetupForm input,
.auth-gate #authSetupForm select { min-height: 42px; padding-top: 9px; padding-bottom: 9px; }
.auth-gate #authSetupForm .password-input-wrap input[type="password"] { height: 42px; padding-top: 10px; padding-bottom: 10px; }
.auth-gate #authSetupForm .password-toggle { min-height: 40px; }
.auth-gate #authSetupForm .auth-submit { min-height: 42px; margin-top: 12px; }
.auth-gate .auth-setup-heading { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: start; gap: 12px; }
.auth-gate .auth-setup-heading > span { min-height: 42px; display: grid; place-items: center; border: 1px solid var(--auth-line); border-radius: 50%; color: var(--auth-primary-strong); background: var(--auth-primary-soft); font-size: 12px; font-weight: 800; }
.auth-gate .auth-setup-heading .eyebrow { margin: 1px 0 3px; }
.auth-gate .auth-setup-heading h2 { margin: 0; }

.auth-gate .auth-step input,
.auth-gate .auth-step select {
  min-height: 46px;
  border: 1px solid var(--auth-line);
  border-radius: 9px;
  color: var(--auth-text);
  background: color-mix(in srgb, var(--auth-bg) 72%, var(--auth-card));
  box-shadow: none;
}

.auth-gate #authSetupForm select[name="oabUf"] {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' stroke='%23aeb5b8' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
}

html[data-theme="light"] .auth-gate #authSetupForm select[name="oabUf"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' stroke='%23606970' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.auth-gate .auth-step input:focus,
.auth-gate .auth-step select:focus,
.auth-gate .auth-tab:focus-visible,
.auth-gate button:focus-visible,
.auth-gate summary:focus-visible {
  outline: 2px solid var(--auth-focus);
  outline-offset: 2px;
  border-color: var(--auth-focus);
  box-shadow: none;
}

.auth-gate .password-input-wrap { position: relative; display: block; }
.auth-gate .password-input-wrap input { width: 100%; box-sizing: border-box; padding-right: 52px; }
.auth-gate .password-input-wrap input[type="password"] {
  height: 46px;
  padding-top: 13px;
  padding-bottom: 13px;
  font-family: var(--v2-font-interface);
  font-size: 18px;
  line-height: 18px;
  letter-spacing: .12em;
}
.auth-gate .password-input-wrap input[type="password"]::placeholder {
  font-family: var(--v2-font-interface);
  font-size: 13px;
  letter-spacing: normal;
}
.auth-gate .password-toggle {
  position: absolute;
  inset: 1px 1px 1px auto;
  width: 44px;
  min-height: 44px;
  border: 0;
  border-left: 1px solid var(--auth-line);
  border-radius: 0 8px 8px 0;
  color: var(--auth-muted);
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  transform: none;
}

.auth-gate .auth-submit { min-height: 46px; border-radius: 9px; }

/* Tooltip padrão de controle sem rótulo visível (a11y: texto vinculado). */
.ui-tooltip {
  position: absolute;
  z-index: var(--v2-z-popover, 60);
  padding: 6px 9px;
  color: var(--auth-text);
  background: var(--auth-card);
  border: 1px solid var(--auth-line);
  border-radius: var(--v2-radius-sm, 6px);
  font-family: var(--v2-font-interface);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--v2-duration-base, 160ms) var(--v2-ease-standard, ease), visibility var(--v2-duration-base, 160ms);
}
.ui-tooltip[data-open='true'] { opacity: 1; visibility: visible; }
.auth-topbar-actions { position: relative; }
.auth-topbar-actions .ui-tooltip { top: calc(100% + 6px); right: 0; }
.password-input-wrap .ui-tooltip { bottom: calc(100% + 6px); right: 0; }
.password-input-wrap { position: relative; }
.auth-gate .button.gold {
  color: #11100c !important;
  background: var(--auth-gold, #d4af37) !important;
  border: 1px solid color-mix(in srgb, #d4af37 62%, #0b0d0e) !important;
  box-shadow: 0 8px 22px rgba(201, 168, 76, 0.2) !important;
  font-weight: 700 !important;
}
.auth-gate .button.gold:hover {
  color: #11100c !important;
  background: color-mix(in srgb, #d4af37 86%, #fdf3c6) !important;
  border-color: #f5e6a3 !important;
  box-shadow: 0 10px 28px rgba(201, 168, 76, 0.32) !important;
  transform: none;
}
.auth-gate .button.ghost { color: var(--auth-text); border-color: var(--auth-line); background: transparent; box-shadow: none; }
.auth-gate .button.ghost:hover { border-color: var(--auth-primary-strong); background: var(--auth-primary-soft); transform: none; }

.auth-gate .auth-qr { border: 1px solid var(--auth-line); border-radius: 10px; box-shadow: none; }
.auth-gate .auth-step details { border-color: var(--auth-line); border-radius: 9px; color: var(--auth-muted); background: var(--auth-card-soft); }
.auth-gate .auth-step summary { min-height: 44px; display: flex; align-items: center; color: var(--auth-text); }
.auth-gate .auth-manual-secret { color: var(--auth-primary-strong); background: var(--auth-bg); }
.auth-gate .recovery-codes { border: 1px solid var(--auth-line); background: var(--auth-bg); color: var(--auth-text); }

.auth-gate .trust-browser-control {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--auth-line);
  border-radius: 9px;
  background: var(--auth-card-soft);
}

.auth-gate .trust-browser-control input { width: 20px; min-height: 20px; margin: 1px 0 0; }
.auth-gate .trust-browser-control span { display: grid; gap: 3px; }
.auth-gate .trust-browser-control strong { color: var(--auth-text); font-size: 12px; letter-spacing: 0; text-transform: none; }
.auth-gate .trust-browser-control small { color: var(--auth-muted); font-size: 12px; font-weight: 500; letter-spacing: 0; line-height: 1.45; text-transform: none; }

.auth-gate .auth-feedback { border: 1px solid var(--auth-line); border-radius: 9px; color: var(--auth-text); background: var(--auth-card-soft); }
.auth-gate #authInvitationForm { gap: 12px; }
.auth-gate #authInvitationForm > p { margin: 0; }
.auth-gate .auth-invitation-identity { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--auth-line); border-radius: 10px; background: var(--auth-card-soft); }
.auth-gate .auth-invitation-identity:empty,
.auth-gate .auth-invitation-identity:not(:has(strong:not(:empty))) { display: none !important; }
.auth-gate .auth-invitation-identity span { color: var(--auth-muted); overflow-wrap: anywhere; }
.auth-gate .auth-feedback.error { border-color: #8e514c; color: #efbbb5; background: rgba(112, 49, 43, .18); }
.auth-gate .auth-feedback.success { border-color: #587460; color: #b8d5bf; background: rgba(64, 101, 74, .17); }
html[data-theme="light"] .auth-gate .auth-feedback.error { color: #873f38; background: #f4e4e2; }
html[data-theme="light"] .auth-gate .auth-feedback.success { color: #47644e; background: #e4ede6; }
.auth-gate .auth-local-note { margin-top: 12px !important; padding-top: 10px; border-color: var(--auth-line); color: var(--auth-muted) !important; }
.auth-gate .auth-spinner { border-color: var(--auth-line); border-top-color: var(--auth-primary-strong); }

html[data-theme="light"] .auth-gate .button.gold {
color: #11100c !important;
background: #c59b27 !important;
border: 1px solid #b79a5d !important;
box-shadow: 0 8px 22px rgba(201, 168, 76, 0.18) !important;
font-weight: 700 !important;
}

html[data-theme="light"] .auth-gate .button.gold:hover {
background: #d4af37 !important;
border-color: #d4af37 !important;
box-shadow: 0 10px 26px rgba(201, 168, 76, 0.28) !important;
transform: none;
}

html[data-theme="light"] .auth-gate .auth-tabs {
  background: #eef1f1;
  border: 1px solid #d2d8da;
}

html[data-theme="light"] .auth-gate .auth-tab {
  color: #606970;
}

html[data-theme="light"] .auth-gate .auth-tab:hover {
  color: #252a2e;
  background: rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .auth-gate .auth-tab.active {
  background: #ffffff !important;
  color: #204556 !important;
  border: 1px solid #d2d8da !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
  font-weight: 700 !important;
}

@keyframes authMineralReveal {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .auth-gate { grid-template-columns: 1fr; }
  .auth-gate .auth-visual { min-height: auto; padding: 24px; border-right: 0; border-bottom: 1px solid var(--auth-line); }
  .auth-gate .auth-visual::before { inset: 14px; }
  .auth-gate .auth-visual::after { display: none; }
  .auth-gate .auth-visual-copy { margin: 28px 0 8px; }
  .auth-gate .auth-visual-copy h1 { margin: 10px 0 12px; font-size: 40px; }
  .auth-gate .auth-visual-copy > p:last-child { max-width: 680px; }
  .auth-gate .auth-intro-flow { grid-template-columns: 1fr; margin-top: 18px; }
  .auth-gate .auth-security-list { display: none; }
  .auth-gate .auth-panel { padding: clamp(24px, 4vh, 48px) clamp(16px, 3.5vw, 28px); }
  .auth-gate .auth-card { max-height: none; }
}

@media (max-width: 520px) {
  .auth-gate .auth-back-to-landing { padding: 0 10px; font-size: 12px; gap: 5px; }
  .auth-gate .auth-visual { padding: 18px; }
  .auth-gate .auth-logo-frame { min-height: 48px; padding: 7px 10px; }
  .auth-gate .auth-brand-svg { width: 158px; }
  .auth-gate .auth-visual-copy { margin: 20px 0 4px; }
  .auth-gate .auth-visual-copy .eyebrow { font-size: 12px; }
  .auth-gate .auth-visual-copy h1 { font-size: 32px; }
  .auth-gate .auth-visual-copy > p:last-child { display: block; font-size: 12px; line-height: 1.5; }
  .auth-gate .auth-intro-flow { display: none; }
  .auth-gate .auth-panel { padding: 16px 12px 20px; }
  .auth-gate .auth-card { padding: 18px 16px; border-radius: 14px; }
  .auth-gate .auth-tabs { display: grid; grid-template-columns: 1fr; }
  .auth-gate .auth-step h2 { font-size: 24px; }
  .auth-gate .auth-qr { width: min(190px, 74vw); height: auto; aspect-ratio: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-gate .auth-step.active { animation: none; }
  .auth-gate *, .auth-gate *::before, .auth-gate *::after { transition-duration: 1ms !important; }
}

/* Separate account creation from optional judicial monitoring. */
.auth-gate [hidden] { display: none !important; }
#authIdentityStep, #authMonitoringStep { animation: authSetupSlide .25s ease-out; }
#authMonitoringStep > .auth-field-row { margin: 20px 0; }
#authMonitoringChoice { margin: 16px 0; }
#authSetupForm #authMonitoringChoice input { min-height: 20px; }
@keyframes authSetupSlide { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { #authIdentityStep, #authMonitoringStep { animation: none; } }

html[data-ui="v2"] .auth-gate .auth-theme-toggle,
html[data-ui="v2"] .auth-gate .auth-toolbar .icon-button {
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
}
