:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #5b6472;
  --line: #d8dde5;
  --paper: #ffffff;
  --wash: #f4f7f8;
  --accent: #0d1f3c;
  --accent-dark: #0a1830;
  --focus: #2b7fff;
  --danger: #9f1239;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(13, 31, 60, 0.08), transparent 42%),
    linear-gradient(315deg, rgba(79, 98, 128, 0.1), transparent 38%),
    var(--wash);
}

main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.shell {
  position: relative;
  width: min(100%, 520px);
  padding: clamp(26px, 5vw, 46px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(13, 31, 60, 0.12);
}

.brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-right: 44px;
  color: var(--accent);
}
.brand-logo {
  display: block;
  width: min(100%, 104px);
  height: auto;
}
.brand-logo path {
  fill: currentColor;
}
.brand-section-label {
  color: var(--accent);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: 0;
}
.account-access {
  display: grid;
  gap: 14px;
}
.account-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  min-height: 46px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f7;
}
.account-switch__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  color: #4b5563;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}
.account-switch__item:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
}
.account-switch__item.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 2px rgba(13, 31, 60, 0.12);
}
.account-switch__item:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.account-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #4b5563;
  text-decoration: none;
}
.account-close:hover {
  color: var(--ink);
  background: #eef2f7;
}
.account-close:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.account-close__icon {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
}
.account-close__icon::before,
.account-close__icon::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 7px;
  width: 2px;
  height: 14px;
  border-radius: 2px;
  background: currentColor;
}
.account-close__icon::before {
  transform: rotate(45deg);
}
.account-close__icon::after {
  transform: rotate(-45deg);
}
h2 {
  margin: 30px 0 0;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}
p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}
a {
  color: var(--accent);
}
form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-color: transparent;
}
.actions {
  display: grid;
  gap: 13px;
  margin-top: 26px;
}
.form-actions {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

button,
.button {
  width: 100%;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 19px;
  border-radius: 6px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.primary {
  color: #fff;
  background: var(--accent);
}
.primary:hover {
  background: var(--accent-dark);
}
.secondary {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line);
}
button:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.provider-button {
  justify-content: flex-start;
  gap: 14px;
  min-height: 56px;
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line);
}

.provider-button:hover {
  border-color: #aeb8c6;
  background: #fbfcfd;
}
.provider-button--large {
  min-height: 66px;
  font-size: 16px;
}
.provider-logo {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: block;
}
.provider-button--large .provider-logo {
  width: 28px;
  height: 28px;
}
.provider-label {
  flex: 1 1 auto;
  text-align: center;
  padding-right: 34px;
}
.provider-button--large .provider-label {
  padding-right: 42px;
}
.button.disabled {
  color: #6b7280;
  background: #f8fafc;
  border-color: var(--line);
  cursor: not-allowed;
  opacity: 0.72;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.divider {
  margin-top: 28px;
  padding-top: 10px;
}
.divider-label {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  color: #7a8493;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}
.divider-label::before,
.divider-label::after {
  content: "";
  height: 1px;
  background: var(--line);
}
.divider-label span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
}
.divider--compact {
  margin-top: 24px;
  padding-top: 6px;
}
.note {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.45;
}
.fine {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.45;
}
.invite-note {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #4b5563;
  background: #f8fafc;
  font-size: 13px;
  line-height: 1.45;
}
.invite-note strong {
  color: var(--ink);
  font-size: 14px;
}
.error {
  color: var(--danger);
}
.success {
  color: var(--accent);
}

.mfa-options {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.mfa-option-form {
  margin: 0;
}

.mfa-option {
  width: 100%;
  min-height: 82px;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  white-space: normal;
}

.mfa-option:hover {
  border-color: #aeb8c6;
  background: #fbfcfd;
}

.mfa-icon,
.passkey-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.mfa-icon svg,
.passkey-mark svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
}

.mfa-option--totp .mfa-icon {
  background: #123f5f;
}

.mfa-option--passkey .mfa-icon,
.passkey-mark {
  background: #183b2d;
}

.mfa-note:empty {
  display: none;
}

.mfa-title,
.mfa-copy {
  display: block;
}

.mfa-title {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
}

.mfa-copy {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

.mfa-setup {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.qr-frame {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.qr-frame img,
.qr-frame svg {
  display: block;
  max-width: 180px;
  max-height: 180px;
}

.manual-code {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.manual-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

code {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family:
    ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.password-check-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.password-check-status[data-state="blocked"] {
  color: var(--danger);
}

.password-check-status[data-state="clear"] {
  color: #256f4a;
}

.password-check-status[data-state="unavailable"] {
  color: #7a4d00;
}

.passkey-panel {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  text-align: center;
}

.passkey-copy {
  margin: 0;
  max-width: 330px;
  font-size: 14px;
}

.mfa-error-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.mfa-option--primary {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(13, 31, 60, 0.18);
}

.passkey-status {
  min-height: 18px;
}

@media (max-width: 520px) {
  main {
    padding: 18px;
  }
  .shell {
    padding: 26px;
  }
  .brand {
    gap: 10px;
  }
  .brand-logo {
    width: min(100%, 96px);
  }
  .brand-section-label {
    font-size: 18px;
  }
  h1 {
    font-size: 30px;
  }
  .account-switch {
    min-height: 44px;
  }
  .account-switch__item {
    min-height: 34px;
    padding: 0 8px;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .mfa-option {
    grid-template-columns: 42px 1fr;
    padding: 14px;
  }
  .mfa-icon,
  .passkey-mark {
    width: 42px;
    height: 42px;
    font-size: 12px;
  }
  .mfa-icon svg,
  .passkey-mark svg {
    width: 22px;
    height: 22px;
  }
  .qr-frame {
    min-height: 190px;
  }
}
