.authPage {
  min-height: calc(100vh - 12px);
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.authPage .topBar {
  padding-bottom: 12px;
}

.authShell {
  display: grid;
  gap: 14px;
  padding-bottom: 8px;
}

.authHero {
  display: grid;
  gap: 8px;
  padding: 6px 2px 0;
}

.authEyebrow {
  width: fit-content;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--app-chip-border, rgba(150, 168, 255, 0.14));
  background: var(--app-chip-strong-bg, rgba(255, 255, 255, 0.04));
  color: var(--app-chip-strong-fg, rgba(245, 243, 194, 0.9));
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.authTitleHero {
  font-family: var(--display);
  font-size: clamp(30px, 8vw, 38px);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.authHeroSub {
  max-width: 28em;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.authCard {
  border-radius: 28px;
  border: 1px solid var(--app-panel-border, rgba(150, 168, 255, 0.14));
  background: var(--app-auth-card-bg, linear-gradient(180deg, rgba(29, 36, 67, 0.94), rgba(17, 22, 43, 0.96)));
  padding: 16px 14px 14px;
  box-shadow: var(--app-panel-shadow, 0 18px 42px rgba(6, 10, 24, 0.24));
}

.authCardCompact {
  padding-top: 16px;
}

.authStatusCard {
  display: grid;
  gap: 16px;
}

.authSegment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border-radius: 18px;
  border: 1px solid var(--app-action-border, rgba(150, 168, 255, 0.1));
  background: var(--app-action-bg, rgba(255, 255, 255, 0.04));
}

.authSegmentBtn {
  appearance: none;
  border: none;
  border-radius: 14px;
  min-height: 42px;
  padding: 0 12px;
  background: transparent;
  color: var(--faint);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.authSegmentBtn.active {
  color: var(--app-primary-text, rgba(247, 249, 255, 0.98));
  background: var(--app-auth-segment-active-bg, linear-gradient(180deg, rgba(141, 178, 255, 0.16), rgba(57, 69, 127, 0.26)));
  box-shadow: inset 0 0 0 1px var(--app-primary-border, rgba(245, 243, 194, 0.12));
}

.authAssist {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.authForm {
  display: grid;
}

.authFields {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.authField {
  display: grid;
  gap: 8px;
}

.authField[hidden] {
  display: none;
}

.authFieldLabel {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.authInput {
  width: 100%;
  min-height: 50px;
  appearance: none;
  border: 1px solid var(--app-input-border, rgba(150, 168, 255, 0.14));
  background: var(--app-input-bg, rgba(255, 255, 255, 0.045));
  color: var(--text, rgba(245, 248, 255, 0.96));
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.35;
  box-shadow: var(--app-input-shadow, inset 0 1px 0 rgba(255, 255, 255, 0.04));
}

.authInput::placeholder {
  color: var(--faint);
}

.authInput:focus,
.authInput:focus-visible {
  border-color: var(--app-primary-border, rgba(141, 178, 255, 0.34));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 3px var(--app-accent-quiet, rgba(141, 178, 255, 0.12));
}

.authPhoneStack {
  display: grid;
  gap: 8px;
}

.authPhoneRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
}

.authInlineBtn {
  min-height: 50px;
  appearance: none;
  border-radius: 16px;
  border: 1px solid var(--app-action-border, rgba(150, 168, 255, 0.16));
  padding: 0 12px;
  background: var(--app-auth-card-soft-bg, rgba(31, 39, 73, 0.56));
  color: var(--text, rgba(245, 248, 255, 0.94));
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: var(--app-input-shadow, inset 0 1px 0 rgba(255, 255, 255, 0.04));
}

.authInlineBtn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.authFieldHint {
  min-height: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.authFieldHint.ok {
  color: color-mix(in srgb, #62d391 78%, var(--text) 22%);
  font-weight: 900;
}

.authError {
  min-height: 18px;
  margin-top: 12px;
  color: color-mix(in srgb, #ff6d5e 72%, var(--text) 28%);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}

.authActions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

.authActions.stack {
  flex-direction: column;
}

.authPrimary,
.authSecondary {
  width: 100%;
  min-height: 48px;
  appearance: none;
  border-radius: 18px;
  border: 1px solid var(--app-action-border, rgba(150, 168, 255, 0.16));
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 28px rgba(6, 10, 24, 0.18);
}

.authPrimary {
  background: var(--app-auth-primary-bg, linear-gradient(135deg, rgba(141, 178, 255, 0.96), rgba(94, 118, 211, 0.96)));
  color: var(--app-primary-text, rgba(245, 248, 255, 0.96));
}

.authSecondary {
  background: var(--app-auth-card-soft-bg, rgba(31, 39, 73, 0.56));
  color: var(--text, rgba(245, 248, 255, 0.94));
}

.authPrimary:hover,
.authSecondary:hover {
  transform: translateY(-1px);
}

.authPrimary:disabled,
.authSecondary:disabled {
  opacity: 0.68;
  cursor: not-allowed;
  transform: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 8px 18px rgba(6, 10, 24, 0.14);
}

.authIdentity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.authIdentityAvatar {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  border: 1px solid var(--app-panel-border, rgba(150, 168, 255, 0.16));
  background: var(--app-auth-avatar-bg, rgba(255, 255, 255, 0.05));
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 900;
}

.authIdentityBody {
  min-width: 0;
}

.authIdentityName {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
}

.authIdentitySub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.authStatusPill {
  min-width: 82px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--app-chip-border, rgba(245, 243, 194, 0.16));
  background: var(--app-chip-strong-bg, rgba(245, 243, 194, 0.08));
  color: var(--app-chip-strong-fg, rgba(245, 243, 194, 0.92));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
}

.authInfoList {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.authInfoListTight {
  margin-top: 0;
}

.authInfoRow {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--app-panel-border, rgba(150, 168, 255, 0.08));
  background: var(--app-auth-card-soft-bg, rgba(255, 255, 255, 0.03));
}

.authInfoLabel {
  color: var(--faint);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.authInfoValue {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
  word-break: break-word;
}

.authFootNote {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 380px) {
  .authCard {
    border-radius: 24px;
    padding: 14px 12px 12px;
  }

  .authIdentity {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .authStatusPill {
    min-height: 40px;
  }
}

@media (min-width: 900px) {
  .authPage {
    max-width: 520px;
    margin: 0 auto;
  }

  .authShell {
    gap: 16px;
  }
}
