* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
}

html {
  background: #0b1220;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0f172a;
  background: #f7f8fb;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

.auth-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(460px, 1.08fr) minmax(480px, 0.92fr);
  background: #f7f8fb;
}

.brand-panel {
  position: relative;
  overflow: hidden;
  min-height: 100dvh;
  color: #fff;
  background:
    radial-gradient(circle at 16% 16%, rgba(243, 146, 1, 0.18), transparent 28%),
    linear-gradient(145deg, #07101d 0%, #0b1626 46%, #101b2b 100%);
  isolation: isolate;
}

.brand-grid {
  position: absolute;
  inset: 0;
  z-index: -3;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom right, rgba(0,0,0,0.9), transparent 82%);
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(115deg, transparent 0 48%, rgba(243,146,1,0.035) 48.2% 48.5%, transparent 48.7% 100%);
}

.brand-glow {
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  filter: blur(10px);
  pointer-events: none;
}

.brand-glow-one {
  width: 360px;
  height: 360px;
  right: -100px;
  top: 18%;
  background: rgba(243,146,1,0.12);
  box-shadow: 0 0 140px rgba(243,146,1,0.16);
}

.brand-glow-two {
  width: 280px;
  height: 280px;
  left: -120px;
  bottom: 8%;
  background: rgba(59,130,246,0.09);
  box-shadow: 0 0 120px rgba(59,130,246,0.12);
}

.brand-panel-inner {
  width: min(760px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(42px, 6vw, 78px);
  display: flex;
  flex-direction: column;
}

.wordmark,
.mobile-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
}

.wordmark-icon {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.wordmark-node {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 4px;
  background: #f39201;
  box-shadow: 0 0 22px rgba(243,146,1,0.28);
}

.node-a {
  left: 2px;
  top: 3px;
}

.node-b {
  right: 2px;
  bottom: 3px;
}

.wordmark-line {
  position: absolute;
  left: 10px;
  top: 16px;
  width: 17px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255,255,255,0.84);
  transform: rotate(-40deg);
  transform-origin: center;
}

.wordmark-text {
  font-size: 0.94rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.version-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #fff;
  background: rgba(243,146,1,0.18);
  border: 1px solid rgba(243,146,1,0.35);
}

.brand-copy {
  margin-top: auto;
  margin-bottom: auto;
  max-width: 650px;
  padding: 72px 0 48px;
}

.eyebrow,
.signin-kicker {
  margin: 0 0 14px;
  color: #f6a622;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.brand-copy h1 {
  margin: 0;
  max-width: 650px;
  font-size: clamp(2.7rem, 5.4vw, 5.3rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
  font-weight: 850;
}

.brand-lede {
  max-width: 590px;
  margin: 26px 0 0;
  color: rgba(226,232,240,0.74);
  font-size: clamp(1rem, 1.25vw, 1.12rem);
  line-height: 1.7;
}

.capability-list {
  display: grid;
  gap: 12px;
  max-width: 620px;
  margin-bottom: 42px;
}

.capability-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 13px;
  align-items: start;
  padding: 13px 14px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  background: rgba(255,255,255,0.035);
  backdrop-filter: blur(14px);
}

.capability-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #f9b44a;
  background: rgba(243,146,1,0.10);
  border: 1px solid rgba(243,146,1,0.18);
  font-size: 0.7rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.capability-item strong,
.capability-item span {
  display: block;
}

.capability-item strong {
  color: #f8fafc;
  font-size: 0.88rem;
}

.capability-item div > span {
  margin-top: 3px;
  color: rgba(203,213,225,0.62);
  font-size: 0.79rem;
  line-height: 1.45;
}

.brand-footer {
  margin: 0;
  color: rgba(148,163,184,0.54);
  font-size: 0.73rem;
  letter-spacing: 0.04em;
}

.signin-panel {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(28px, 5vw, 72px);
  background:
    radial-gradient(circle at 100% 0%, rgba(243,146,1,0.07), transparent 30%),
    #f7f8fb;
}

.signin-wrap {
  width: min(450px, 100%);
}

.mobile-wordmark {
  display: none;
  margin-bottom: 44px;
  color: #0f172a;
}

.mobile-wordmark .wordmark-line {
  background: #334155;
}

.mobile-wordmark .version-pill {
  color: #9a5700;
  background: #fff7ed;
  border-color: #fed7aa;
}

.signin-heading {
  margin-bottom: 34px;
}

.signin-kicker {
  color: #b96700;
  margin-bottom: 11px;
}

.signin-heading h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(2rem, 3.5vw, 2.65rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.signin-heading p {
  margin: 10px 0 0;
  color: #64748b;
  font-size: 0.98rem;
  line-height: 1.55;
}

.signin-form {
  display: grid;
  gap: 20px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group > label,
.field-label-row label {
  color: #334155;
  font-size: 0.79rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.forgot-link {
  color: #a65e00;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.forgot-link:hover {
  color: #7c4700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 58px;
  border: 1px solid #dbe1ea;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15,23,42,0.02), inset 0 1px 0 rgba(255,255,255,0.6);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.input-shell:focus-within {
  border-color: rgba(243,146,1,0.75);
  box-shadow: 0 0 0 4px rgba(243,146,1,0.10), 0 12px 28px rgba(15,23,42,0.05);
}

.input-icon {
  position: absolute;
  left: 16px;
  width: 22px;
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 0.95rem;
  font-weight: 900;
  pointer-events: none;
}

.lock-icon {
  font-size: 0.55rem;
}

.input-shell input {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  border: 0;
  outline: 0;
  border-radius: inherit;
  padding: 0 16px 0 48px;
  color: #0f172a;
  background: transparent;
  font-size: 0.97rem;
}

.input-shell input::placeholder {
  color: #a8b2c2;
}

.password-shell input {
  padding-right: 76px;
}

.password-toggle {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 56px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  color: #64748b;
  background: #f8fafc;
  font-size: 0.77rem;
  font-weight: 850;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.password-toggle:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.login-button {
  width: 100%;
  min-height: 60px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #ee8f00 0%, #f8a927 100%);
  box-shadow: 0 16px 34px rgba(214,126,0,0.22), inset 0 1px 0 rgba(255,255,255,0.24);
  font-weight: 900;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease, opacity 150ms ease;
}

.login-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 20px 40px rgba(214,126,0,0.27), inset 0 1px 0 rgba(255,255,255,0.25);
}

.login-button:active:not(:disabled) {
  transform: translateY(0);
  filter: brightness(0.98);
}

.login-button:disabled {
  cursor: wait;
  opacity: 0.70;
}

.login-button-arrow {
  font-size: 1.15rem;
  transition: transform 150ms ease;
}

.login-button:hover:not(:disabled) .login-button-arrow {
  transform: translateX(3px);
}

.status {
  min-height: 22px;
  margin: -3px 0 0;
  color: #64748b;
  text-align: center;
  font-size: 0.84rem;
  line-height: 1.45;
}

.status.error {
  color: #b42318;
}

.status.success {
  color: #08735f;
}

.security-card {
  margin-top: 26px;
  display: grid;
  grid-template-columns: 35px 1fr;
  gap: 11px;
  align-items: start;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: rgba(255,255,255,0.66);
}

.security-shield {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #08735f;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  font-size: 0.78rem;
  font-weight: 900;
}

.security-card strong {
  color: #334155;
  font-size: 0.76rem;
}

.security-card p {
  margin: 3px 0 0;
  color: #7b8797;
  font-size: 0.72rem;
  line-height: 1.45;
}

.signin-footer {
  margin: 22px 0 0;
  color: #94a3b8;
  text-align: center;
  font-size: 0.70rem;
  line-height: 1.45;
}

.signin-footer a {
  color: #cbd5e1;
  text-underline-offset: 3px;
}

.signin-footer a:hover {
  color: #ffffff;
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid #f39201;
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    display: none;
  }

  .signin-panel {
    min-height: 100dvh;
    padding: 36px 22px;
  }

  .mobile-wordmark {
    display: inline-flex;
  }
}

@media (max-width: 560px) {
  .signin-panel {
    place-items: start center;
    padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  }

  .signin-wrap {
    padding-top: 8px;
  }

  .mobile-wordmark {
    margin-bottom: 48px;
  }

  .signin-heading {
    margin-bottom: 28px;
  }

  .signin-heading h2 {
    font-size: 2.2rem;
  }

  .signin-form {
    gap: 18px;
  }

  .input-shell,
  .input-shell input {
    min-height: 56px;
  }

  .login-button {
    min-height: 58px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* V2 MFA */
.auth-stage {
  display: grid;
  gap: 20px;
}

.auth-stage[hidden] {
  display: none !important;
}

.mfa-callout {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 13px;
  align-items: start;
  padding: 15px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
}

.mfa-callout-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #9a5700;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  font-size: 0.73rem;
  font-weight: 900;
}

.mfa-callout strong {
  display: block;
  color: #172033;
  font-size: 0.9rem;
}

.mfa-callout p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.45;
}

.recovery-warning {
  border-color: #fed7aa;
  background: #fffaf3;
}

.auth-text-button {
  justify-self: start;
  padding: 0;
  border: 0;
  color: #a65e00;
  background: transparent;
  font-size: 0.79rem;
  font-weight: 850;
  cursor: pointer;
}

.auth-text-button:hover {
  color: #7c4700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mfa-setup-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid #dbe1ea;
  border-radius: 15px;
  background: #fff;
}

.mfa-setup-label {
  color: #64748b;
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.mfa-secret {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 0.96rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.mfa-account {
  margin: 2px 0 0;
  color: #64748b;
  font-size: 0.75rem;
}

.recovery-code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.recovery-code {
  padding: 10px 11px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #172033;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.03em;
}

@media (max-width: 520px) {
  .recovery-code-grid { grid-template-columns: 1fr; }
}

.mfa-qr-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 16px;
  border: 1px solid #dbe1ea;
  border-radius: 15px;
  background: #fff;
  text-align: center;
}

.mfa-qr-card[hidden] {
  display: none !important;
}

.mfa-qr-frame {
  width: min(238px, 72vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.mfa-qr-code {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.mfa-qr-help {
  max-width: 29rem;
  margin: 0;
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.45;
}
