body.auth-shell {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #F8FAFC;
  color: #111827;
}

body.auth-shell .auth-page-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 1rem;
}

body.auth-shell .auth-brand-block {
  width: 100%;
  margin: 0 auto;
}

body.auth-shell .auth-brand-block--narrow {
  max-width: 28rem;
}

body.auth-shell .auth-brand-block--wide {
  max-width: 52rem;
}

body.auth-shell .auth-panel {
  width: 100%;
  margin: 2rem auto 0;
}

body.auth-shell .auth-panel--narrow {
  max-width: 28rem;
}

body.auth-shell .auth-panel--compact {
  max-width: 40rem;
}

body.auth-shell .auth-panel--wide {
  max-width: 92rem;
}

body.auth-shell .auth-page-title {
  color: #111827;
  font-weight: 900;
  letter-spacing: -0.04em;
}

body.auth-shell .auth-page-subtitle {
  color: #64748b;
  font-weight: 600;
}

body.auth-shell .auth-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e5edf6;
  border-radius: 28px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(12px);
  width: 100%;
  box-sizing: border-box;
}

body.auth-shell .auth-card--narrow {
  padding: 3rem 2.75rem;
}

body.auth-shell .auth-card--compact {
  padding: 2.75rem 3rem;
}

body.auth-shell .auth-card--wide {
  padding: 3rem;
}

body.auth-shell .auth-label {
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

body.auth-shell .auth-input-wrap {
  position: relative;
}

body.auth-shell .auth-glyph {
  position: absolute;
  inset-inline-start: 1.35rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: #94a3b8;
  z-index: 1;
}

body.auth-shell .auth-glyph svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}

body.auth-shell .auth-input,
body.auth-shell input.auth-input,
body.auth-shell input[name="code"]:not([type="hidden"]) {
  width: 100%;
  min-height: 3.75rem;
  padding: 1rem 1.25rem 1rem 4.1rem;
  border: 1px solid #e5edf6;
  background: #f8fbff;
  color: #0f172a;
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease,
    transform 0.18s ease;
}

body.auth-shell .auth-input::placeholder,
body.auth-shell .otp-segment::placeholder {
  color: #a3b2c7;
}

body.auth-shell .auth-input:focus,
body.auth-shell input[name="code"]:not([type="hidden"]):focus {
  outline: none;
  background: #ffffff;
  border-color: #facc15;
  box-shadow:
    0 0 0 4px rgba(250, 204, 21, 0.18),
    0 12px 30px rgba(148, 163, 184, 0.18);
}

body.auth-shell .auth-primary {
  width: 100%;
  min-height: 3.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffd54a 0%, #facc15 100%);
  color: #0f172a;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 16px 32px rgba(250, 204, 21, 0.35);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

body.auth-shell .auth-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(250, 204, 21, 0.42);
  filter: brightness(1.02);
}

body.auth-shell .auth-primary:active {
  transform: translateY(0);
}

body.auth-shell .auth-divider {
  border-color: #edf2f7;
}

body.auth-shell .auth-footer {
  color: #a8b6c9;
}

body.auth-shell .auth-message-success {
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

body.auth-shell .auth-message-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

body.auth-shell .auth-token-pill {
  background: #f8fafc;
  border: 1px solid #e5edf6;
  border-radius: 9999px;
  color: #64748b;
}

body.auth-shell .auth-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.35rem 0.65rem;
  border-radius: 9999px;
  background: #fef3c7;
  color: #b45309;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body.auth-shell #otp-segmented-container .auth-otp-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}

body.auth-shell #otp-segmented-container input.otp-segment {
  flex: 0 0 3.5rem !important;
  flex-grow: 0 !important;
  flex-shrink: 0 !important;
  width: 3.5rem !important;
  min-width: 3.5rem !important;
  max-width: 3.5rem !important;
  height: 3.5rem !important;
  min-height: 3.5rem !important;
  max-height: 3.5rem !important;
  padding: 0;
  border: 1px solid #d9e4f4;
  background: #f8fbff;
  color: #0f172a;
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  box-sizing: border-box;
  display: block;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 3.5rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

body.auth-shell #otp-segmented-container input.otp-segment:focus {
  outline: none;
  background: #ffffff;
  border-color: #facc15;
  box-shadow:
    0 0 0 4px rgba(250, 204, 21, 0.16),
    0 12px 30px rgba(148, 163, 184, 0.16);
}

body.auth-shell .auth-secondary-button {
  width: 100%;
  min-height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.auth-shell .auth-secondary-button:hover {
  background: #f8fbff;
}

body.auth-shell .auth-factor-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  color: #64748b;
  flex: 0 0 auto;
}

body.auth-shell .auth-factor-glyph svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}

body.auth-shell .auth-or-divider .border-t {
  border-color: #cbd5e1;
}

body.auth-shell .auth-or-divider span {
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

body.auth-shell .auth-cancel-button {
  color: #94a3b8;
  font-weight: 800;
  letter-spacing: 0.12em;
}

/* === MFA Refactoring Classes === */

body.auth-shell .auth-option-card {
  position: relative;
  background: #f8fafc;
  border: 2px solid #f1f5f9;
  border-radius: 1rem;
  padding: 1.5rem;
  cursor: default;
  transition: all 0.2s ease;
}

body.auth-shell .auth-option-card:hover {
  border-color: #facc15;
  background: #ffffff;
}

body.auth-shell .auth-option-card--active {
  background: #ffffff;
}

body.auth-shell .auth-option-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

body.auth-shell .auth-option-card-title-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

body.auth-shell .auth-option-icon {
  flex-shrink: 0;
  height: 3rem;
  width: 3rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #111827;
}

body.auth-shell .auth-option-icon--yellow {
  background: #facc15;
  box-shadow: 0 4px 14px rgba(250, 204, 21, 0.4);
}

body.auth-shell .auth-option-icon--slate {
  background: #e2e8f0;
  color: #475569;
}

body.auth-shell .auth-option-title {
  font-size: 0.9rem;
  font-weight: 900;
  color: #111827;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

body.auth-shell .auth-option-subtitle {
  font-size: 0.65rem;
  font-weight: 900;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

body.auth-shell .auth-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

body.auth-shell .auth-status-badge--success {
  background: #dcfce7;
  color: #166534;
}

body.auth-shell .auth-status-badge--info {
  background: #dbeafe;
  color: #1e40af;
}

body.auth-shell .auth-option-actions {
  display: flex;
  gap: 0.75rem;
}

body.auth-shell .auth-action-danger {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 3.25rem;
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: #fef2f2;
  color: #dc2626;
  transition: all 0.2s ease;
}

body.auth-shell .auth-action-danger:hover {
  background: #fee2e2;
}

body.auth-shell .auth-return-link {
  display: inline-block;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  font-weight: 900;
  color: #94a3b8;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.18s ease;
}

body.auth-shell .auth-return-link:hover {
  color: #d97706;
}

@media (max-width: 640px) {
  body.auth-shell .auth-page-wrap {
    padding: 2.25rem 1rem;
  }

  body.auth-shell .auth-card {
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  }

  body.auth-shell .auth-card--narrow,
  body.auth-shell .auth-card--compact,
  body.auth-shell .auth-card--wide {
    padding: 2.25rem 1.5rem;
  }

  body.auth-shell .auth-panel--wide {
    max-width: 100%;
  }

  body.auth-shell #otp-segmented-container .auth-otp-row {
    gap: 0.5rem;
  }

  body.auth-shell #otp-segmented-container input.otp-segment {
    flex-basis: 2.7rem !important;
    width: 2.7rem !important;
    min-width: 2.7rem !important;
    max-width: 2.7rem !important;
    height: 2.7rem !important;
    min-height: 2.7rem !important;
    max-height: 2.7rem !important;
    font-size: 1rem;
    line-height: 2.7rem;
  }
}

/* === Recovery Codes & TOTP specific layouts === */

body.auth-shell .auth-recovery-code-grid {
  background: #f8fafc;
  border: 2px solid #f1f5f9;
  border-radius: 1rem;
  padding: 1rem;
  text-align: center;
  box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

body.auth-shell .auth-recovery-code-inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1rem;
  row-gap: 0.5rem;
}

body.auth-shell .auth-recovery-code-item {
  font-size: 0.75rem;
  font-weight: 900;
  font-family: monospace;
  color: #111827;
  letter-spacing: 0.1em;
}

body.auth-shell .auth-action-row {
  display: flex;
  gap: 0.75rem;
}

body.auth-shell .auth-action-row--spacious {
  gap: 1rem;
}

body.auth-shell .auth-secondary-button--icon {
  text-decoration: none;
  gap: 0.65rem;
}

body.auth-shell .auth-secondary-button--grow {
  flex: 1 1 0;
}

body.auth-shell .auth-secondary-button--compact {
  width: auto;
  padding: 0 1.5rem;
  flex: 0 0 auto;
}

body.auth-shell .auth-action-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  color: #64748b;
  flex: 0 0 auto;
}

body.auth-shell .auth-action-glyph svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}

body.auth-shell .auth-split-grid {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 0 0.5rem;
  flex-wrap: wrap;
}

body.auth-shell .auth-split-left {
  flex-shrink: 0;
  text-align: center;
}

body.auth-shell .auth-split-right {
  flex: 1;
  margin-top: 0.25rem;
}

body.auth-shell .auth-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: stretch;
  margin-top: 2rem;
  border-top: 1px solid #f1f5f9;
  padding-top: 1.5rem;
}

body.auth-shell .auth-hero-icon {
  display: inline-block;
  padding: 2rem;
  background: #f8fafc;
  border: 4px solid #ffffff;
  border-radius: 9999px;
  box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
}

/* Overrides for user feedback styling fixes */
body.auth-shell .auth-recovery-code-grid {
  border-color: #e2e8f0 !important;
  border-width: 1px !important;
  box-shadow: none !important;
}

body.auth-shell .auth-divider-horizontal {
  height: 1px;
  background-color: #f1f5f9;
  margin: 1.5rem 0;
  border: none;
}

body.auth-shell .auth-return-link {
  font-size: 0.65rem;
  font-weight: 900;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-decoration: none;
}
body.auth-shell .auth-return-link:hover {
  color: #1e293b;
}

body.auth-shell .auth-split-grid-vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Vertical QR / Setup Styles */
body.auth-shell .auth-qr-box {
  background: #ffffff;
  padding: 1rem;
  border: 2px solid #e1e7ef;
  border-radius: 1.5rem;
  display: inline-block;
}

body.auth-shell .auth-qr-img {
  width: 140px;
  height: 140px;
  image-rendering: pixelated;
}

body.auth-shell .auth-qr-label {
  font-size: 0.625rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  margin-top: 0.75rem;
}

body.auth-shell .auth-split-right-center {
  text-align: center;
  max-width: 24rem;
  margin: 0 auto;
}

body.auth-shell .auth-instruction-heading {
  font-size: 0.875rem;
  font-weight: 900;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

body.auth-shell .auth-instruction-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 1rem;
  line-height: 1.5;
}

body.auth-shell .auth-manual-key-box {
  background: #f8fafc;
  border: 1px solid #e5edf6;
  border-radius: 0.75rem;
  padding: 0.75rem;
  display: inline-block;
  text-align: center;
}

body.auth-shell .auth-manual-key-label {
  font-size: 0.625rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  margin-bottom: 0.25rem;
}

body.auth-shell .auth-manual-key-code {
  font-size: 0.8125rem;
  font-weight: 900;
  font-family: monospace;
  color: #111827;
  letter-spacing: 0.15em;
}

/* Additional Template Bindings */
body.auth-shell .auth-segmented-wrap {
  margin-bottom: 2rem;
}

body.auth-shell .auth-label-centered {
  display: block;
  margin-bottom: 1rem;
  padding-left: 0.25rem;
  text-align: center;
}

body.auth-shell .auth-error-msg {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 900;
  color: #ef4444;
  text-transform: uppercase;
  text-align: center;
}

/* === Refined OR Divider === */
body.auth-shell .auth-or-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2rem 0;
  width: 100%;
}

body.auth-shell .auth-or-divider::before,
body.auth-shell .auth-or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #f1f5f9;
}

body.auth-shell .auth-or-divider span {
  padding: 0 1.25rem;
  color: #94a3b8;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* === Polished Manual Key Display === */
body.auth-shell .auth-manual-key-card {
  background: #ffffff;
  border: 1px solid #e5edf6;
  border-radius: 1.25rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
  margin: 1rem 0;
}

body.auth-shell .auth-manual-key-code {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 900;
  color: #111827;
  letter-spacing: 0.1em;
  background: #f8fafc;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px dashed #cbd5e1;
  width: 100%;
  word-break: break-all;
}

/* === Button Padding Consistency === */
body.auth-shell .auth-primary {
  padding: 1.15rem 2rem;
}

body.auth-shell .auth-secondary-button {
  padding: 1rem 1.5rem;
}

/* === Option Card Polish === */
body.auth-shell .auth-option-card-header {
  margin-bottom: 2rem;
}

body.auth-shell .auth-option-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: currentColor;
}

/* === Spacing & Margin Polish === */
body.auth-shell .auth-action-row {
  margin-bottom: 1.5rem;
}

body.auth-shell .auth-form-grid form > div {
  margin-bottom: 1.5rem;
}

body.auth-shell .auth-option-card {
  margin-bottom: 1rem;
}

/* Ensure the success/primary button has breathing room */
body.auth-shell .auth-primary {
  margin-top: 0.5rem;
}

/* Gap between buttons in action cards */
body.auth-shell .auth-option-card-action {
  display: flex;
  gap: 0.75rem;
}

/* Fix for potential shadow artifacts and glyph alignment */
body.auth-shell .auth-card {
  backdrop-filter: none; /* Remove filter to prevent edge artifacts */
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08); /* Milder shadow */
}

body.auth-shell .auth-label-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

body.auth-shell .auth-label-group svg {
  margin-top: -1px; /* Optical centering */
}

/* Center segmented inputs and secondary buttons */
body.auth-shell .auth-segmented-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

body.auth-shell .auth-cancel-button {
  width: auto;
  background: none;
  border: none;
  cursor: pointer;
  padding: 1rem;
  transition: color 0.18s ease;
}

body.auth-shell .auth-cancel-button:hover {
  color: #1e293b;
}

/* Precise optical alignment for label icons */
body.auth-shell .auth-label-group svg {
  margin-top: 0;
  flex-shrink: 0;
  vertical-align: middle;
}

/* Ensure breathing room between label and inputs */
body.auth-shell .auth-label-group {
  margin-bottom: 1.75rem !important;
}

body.auth-shell .auth-otp-row {
  margin-top: 0.5rem;
}

body.auth-shell .auth-factor-glyph--verification {
  color: #94a3b8;
  width: 1.15rem;
  height: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.auth-shell .auth-factor-glyph--verification svg {
  display: block;
}

body.auth-shell .auth-submit-wrap--spacious {
  margin-top: 1.5rem;
}

body.auth-shell .auth-submit-wrap--compact {
  margin-top: 1rem;
}

body.auth-shell .auth-centered-box--mt-lg {
  margin-top: 1.5rem;
}

body.auth-shell .auth-centered-box--mt-xl {
  margin-top: 2rem;
}

body.auth-shell .auth-mfa-return-wrap {
  text-align: center;
  margin-top: 1.5rem;
}

body.auth-shell .auth-manual-key-card--spaced {
  margin-top: 1.5rem;
}

body.auth-shell .auth-token-pill--manual {
  margin-bottom: 0.75rem;
  border-style: dashed;
  padding: 0.4rem 1rem;
}

body.auth-shell .auth-manual-key-code--large {
  font-size: 0.9rem;
  letter-spacing: 0.15em;
}

body.auth-shell .auth-form-grid--flush {
  border: none;
  padding-top: 0;
  margin-top: 0;
}

body.auth-shell .auth-label--inline {
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
}

body.auth-shell .auth-recovery-intro {
  font-size: 0.88rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 1.5rem;
  font-style: italic;
}

body.auth-shell .auth-divider-horizontal--tight {
  margin: 0.75rem 0;
}

body.auth-shell .auth-recovery-count {
  font-size: 0.56rem;
  font-weight: 900;
  color: #94a3b8;
  letter-spacing: 0.1em;
  margin: 0;
  text-transform: uppercase;
}

body.auth-shell .auth-action-row--mb-xl {
  margin-bottom: 2rem;
}

body.auth-shell .auth-dashboard-handoff {
  padding-top: 1rem;
  margin-bottom: 2rem;
}

body.auth-shell .auth-dashboard-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

body.auth-shell .auth-dashboard-icon {
  width: 1.25rem;
  height: 1.25rem;
}
