:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

.auth-page {
  margin: 0;
  min-height: 100vh;
  color: #182230;
  background: #f4f6f8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.auth-card {
  width: min(100%, 480px);
  padding: 36px;
  background: #fff;
  border: 1px solid #e2e7ec;
  border-radius: 14px;
  box-shadow: 0 16px 42px rgb(23 35 49 / 8%);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  color: #182230;
  text-decoration: none;
}

.auth-brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  color: #fff;
  background: #2463eb;
  font-size: 18px;
  font-weight: 750;
}

.auth-brand strong,
.auth-brand small {
  display: block;
}

.auth-brand strong {
  font-size: 14px;
}

.auth-brand small {
  margin-top: 2px;
  color: #758196;
  font-size: 11px;
}

.auth-eyebrow {
  margin: 34px 0 8px;
  color: #2463eb;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.auth-card h1 {
  margin: 0;
  font-size: clamp(24px, 5vw, 30px);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.auth-lead {
  margin: 12px 0 24px;
  color: #637083;
  font-size: 14px;
  line-height: 1.75;
}

.auth-alert,
.auth-warning {
  margin: 18px 0;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
}

.auth-alert {
  color: #a52222;
  background: #fff1f1;
  border: 1px solid #ffd4d4;
}

.auth-warning {
  color: #7a5200;
  background: #fff8e6;
  border: 1px solid #f2dfab;
}

.auth-form {
  display: grid;
  gap: 17px;
}

.auth-form label:not(.auth-check) {
  display: grid;
  gap: 7px;
}

.auth-form label > span {
  font-size: 13px;
  font-weight: 650;
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  color: #182230;
  background: #fff;
  border: 1px solid #cfd6df;
  border-radius: 8px;
  font: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-form input:focus {
  border-color: #2463eb;
  box-shadow: 0 0 0 3px rgb(36 99 235 / 12%);
}

.auth-form small {
  color: #7b8798;
  font-size: 11px;
}

.auth-form button,
.dashboard-logout button {
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.auth-form button {
  min-height: 46px;
  margin-top: 3px;
  color: #fff;
  background: #2463eb;
}

.auth-form button:hover {
  background: #1e53c8;
}

.totp-setup {
  display: grid;
  gap: 16px;
  justify-items: center;
  margin-bottom: 22px;
}

.totp-setup img {
  width: min(240px, 100%);
  height: auto;
  padding: 8px;
  border: 1px solid #e2e7ec;
  border-radius: 10px;
}

.totp-manual {
  width: 100%;
  padding: 14px;
  background: #f6f8fb;
  border-radius: 8px;
  text-align: center;
}

.totp-manual small,
.totp-manual code,
.totp-manual p {
  display: block;
}

.totp-manual small,
.totp-manual p {
  color: #758196;
  font-size: 11px;
}

.totp-manual code {
  margin: 8px 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.totp-manual p {
  margin: 0;
}

.recovery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 16px;
  background: #f6f8fb;
  border: 1px solid #e2e7ec;
  border-radius: 9px;
}

.recovery-grid code {
  padding: 7px;
  background: #fff;
  border-radius: 5px;
  text-align: center;
  font-size: 13px;
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #556173;
  font-size: 13px;
  line-height: 1.5;
}

.auth-check input {
  margin-top: 3px;
}

.auth-note {
  margin: 24px 0 0;
  padding-top: 18px;
  color: #8993a2;
  border-top: 1px solid #edf0f3;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.dashboard-logout {
  position: fixed;
  z-index: 1000;
  right: 24px;
  bottom: 22px;
}

.dashboard-logout button {
  padding: 9px 14px;
  color: #4d596a;
  background: #fff;
  border: 1px solid #d8dee6;
  box-shadow: 0 4px 14px rgb(23 35 49 / 9%);
}

.dashboard-logout button:hover {
  color: #182230;
  border-color: #aeb8c5;
}

@media (max-width: 520px) {
  .auth-card {
    padding: 28px 22px;
  }

  .recovery-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-logout {
    right: 14px;
    bottom: 14px;
  }
}
