.login-page {
  --login-blue: #1677c8;
  --login-muted: #6e6e73;
  background: #fff;
}

.login-page .site-header {
  position: absolute;
}

.login-page [hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-main {
  display: flex;
  min-height: calc(100dvh - 76px);
  align-items: flex-start;
  justify-content: center;
  padding: 90px 20px 80px;
}

.login-card {
  width: min(640px, 100%);
  min-height: 725px;
  padding: 17px 90px 48px;
  border-radius: 28px;
  background: #fff;
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.07),
    0 3px 14px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.account-emblem {
  display: block;
  width: 180px;
  height: 180px;
  margin: 0 auto 28px;
  overflow: visible;
}

.login-card h1 {
  margin: 0;
  color: #1d1d1f;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.17;
}

.account-form {
  margin-top: 30px;
  text-align: left;
}

.account-input {
  display: block;
  width: 100%;
  height: 56px;
  padding: 10px 17px;
  border: 2px solid #2169ac;
  border-radius: 14px;
  outline: 0;
  color: #1d1d1f;
  background: #fff;
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  caret-color: #1d1d1f;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.account-input::placeholder {
  color: #86868b;
  opacity: 1;
}

.account-input:focus {
  border-color: #1672bd;
  box-shadow: 0 0 0 2px rgba(22, 114, 189, 0.09);
}

.identifier-control {
  position: relative;
}

.account-label {
  position: absolute;
  top: 3px;
  left: 18px;
  z-index: 1;
  color: #6e6e73;
  font-size: 14px;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
}

.identifier-control.has-value .account-label {
  opacity: 1;
}

.identifier-control.has-value .account-input {
  padding-top: 19px;
  padding-bottom: 3px;
}

.identifier-control.has-value .account-input::placeholder {
  opacity: 0;
}

.identifier-control.has-value .account-input:not(:focus) {
  border-color: #86868b;
}

.credential-fields.is-password .account-input,
.credential-fields.is-password .account-input:focus {
  border-color: #86868b;
  border-radius: 14px 14px 0 0;
  box-shadow: none;
}

.password-input {
  display: block;
  width: 100%;
  height: 56px;
  margin-top: -2px;
  padding: 10px 17px;
  border: 2px solid #1672bd;
  border-radius: 0 0 14px 14px;
  outline: 0;
  color: #1d1d1f;
  background: #fff;
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  caret-color: #1d1d1f;
  box-shadow: 0 0 0 2px rgba(22, 114, 189, 0.09);
}

.password-input::placeholder {
  color: #86868b;
  opacity: 1;
}

.password-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.4;
  animation: login-step-in 280ms ease-out;
}

.keep-session {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  white-space: nowrap;
}

.keep-session input {
  display: grid;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  appearance: none;
  place-content: center;
  border: 2px solid #86868b;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.keep-session input::after {
  width: 7px;
  height: 4px;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  content: "";
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg);
}

.keep-session input:checked {
  border-color: #1677c8;
  background: #1677c8;
}

.keep-session input:checked::after {
  opacity: 1;
}

.forgot-password {
  color: #266a9e;
  white-space: nowrap;
}

.forgot-password:hover {
  text-decoration: underline;
}

.password-control:not([hidden]) {
  animation: login-step-in 280ms ease-out;
}

@keyframes login-step-in {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.create-account {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  margin-top: 8px;
  color: #266a9e;
  font-size: 16px;
  line-height: 1.4;
}

.create-account:hover,
.account-privacy a:hover {
  text-decoration: underline;
}

.account-privacy {
  margin-top: 20px;
  text-align: left;
}

.privacy-people {
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 0 4px;
}

.account-privacy p {
  color: #1d1d1f;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.008em;
  line-height: 1.15;
}

.account-privacy a {
  color: #266a9e;
  white-space: nowrap;
}

.login-actions {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  gap: 10px;
  margin-top: 29px;
}

.continue-button,
.passkey-button {
  display: inline-flex;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.continue-button {
  color: #fff;
  background: #9dbfee;
}

.continue-button:not(:disabled) {
  background: #1677c8;
}

.continue-button:disabled {
  cursor: default;
}

.continue-button:not(:disabled):hover {
  background: #0e67b3;
}

.passkey-button {
  gap: 3px;
  padding: 0 9px;
  color: #fff;
  background: #1d1d1f;
  white-space: nowrap;
}

.passkey-button:hover {
  background: #3a3a3c;
}

.continue-button:not(:disabled):active,
.passkey-button:active {
  transform: scale(0.98);
}

.passkey-button svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.passkey-note {
  margin-top: 12px;
  padding-left: 198px;
  color: #1d1d1f;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
}

.verification-section {
  margin-top: 26px;
  text-align: center;
  animation: login-step-in 280ms ease-out;
}

.verification-section h2 {
  color: #1d1d1f;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.code-boxes {
  display: grid;
  grid-template-columns: repeat(6, 48px);
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.code-input {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1.5px solid #86868b;
  border-radius: 9px;
  outline: 0;
  color: #1d1d1f;
  background: #fff;
  font: inherit;
  font-size: 21px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  caret-color: #1677c8;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.code-input:focus {
  border-color: #1672bd;
  box-shadow: 0 0 0 2px rgba(22, 114, 189, 0.13);
}

.code-input.has-digit {
  border-color: #1677c8;
  background: #f5f9ff;
}

.login-card.has-password .full-signin {
  margin-top: 35px;
}

.full-signin {
  width: 100%;
  height: 38px;
  margin-top: 137px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: #9dbfee;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.02em;
  cursor: default;
  animation: login-step-in 280ms ease-out;
  transition: background-color 160ms ease, transform 160ms ease;
}

.full-signin:not(:disabled) {
  background: #1677c8;
  cursor: pointer;
}

.full-signin:not(:disabled):hover {
  background: #0e67b3;
}

.full-signin:not(:disabled):active {
  transform: scale(0.99);
}

.login-dialog {
  inset: 0;
  width: min(360px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 28px;
  overflow: auto;
  border: 0;
  border-radius: 20px;
  color: #1d1d1f;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  text-align: center;
}

.login-dialog::backdrop {
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(3px);
}

.login-dialog[open] {
  animation: dialog-in 200ms ease-out;
}

.login-dialog h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.login-dialog p {
  margin-top: 9px;
  color: #6e6e73;
  font-size: 15px;
  line-height: 1.4;
}

.dialog-button {
  width: 100%;
  height: 42px;
  margin-top: 24px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: #1677c8;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.dialog-button:hover {
  background: #0e67b3;
}

.dialog-button:active {
  transform: scale(0.98);
}

@keyframes dialog-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.demo-status {
  min-height: 0;
  margin-top: 0;
  color: #266a9e;
  font-size: 13px;
  line-height: 1.4;
}

.demo-status:not(:empty) {
  margin-top: 18px;
}

.login-footer {
  display: flex;
  min-height: 76px;
  align-items: center;
  color: var(--login-muted);
  background: #f5f5f7;
  font-size: 12px;
}

.login-footer-inner {
  display: flex;
  width: 100%;
  max-width: 1016px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  padding: 16px 24px;
}

.legal-links {
  display: flex;
  align-items: center;
}

.legal-links a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 14px;
  border-right: 1px solid #d2d2d7;
}

.legal-links a:first-child {
  padding-left: 0;
}

.legal-links a:last-child {
  border-right: 0;
}

.legal-links a:hover {
  color: #1d1d1f;
  text-decoration: underline;
}

.login-footer p {
  flex-shrink: 0;
}

@media (max-width: 1000px) {
  .login-footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 760px) {
  .login-main {
    min-height: calc(100dvh - 150px);
    padding: 82px 12px 36px;
  }

  .login-card {
    min-height: 0;
    padding: 28px 24px 30px;
    border-radius: 24px;
  }

  .account-emblem {
    width: 154px;
    height: 154px;
    margin-bottom: 16px;
  }

  .login-card h1 {
    font-size: clamp(25px, 7.2vw, 30px);
  }

  .account-form {
    margin-top: 26px;
  }

  .account-input {
    height: 54px;
    padding-inline: 14px;
    font-size: 16px;
  }

  .account-privacy {
    margin-top: 22px;
  }

  .login-actions {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 26px;
  }

  .continue-button,
  .passkey-button {
    height: 44px;
  }

  .passkey-note {
    padding-left: 0;
    text-align: center;
    white-space: normal;
  }

  .account-label {
    left: 16px;
  }

  .password-input {
    height: 54px;
    padding-inline: 14px;
  }

  .password-options {
    flex-wrap: wrap;
    gap: 12px;
  }

  .forgot-password {
    margin-left: auto;
  }

  .full-signin {
    height: 44px;
    margin-top: 80px;
  }

  .verification-section {
    margin-top: 22px;
  }

  .code-boxes {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    width: 100%;
    max-width: 312px;
    margin-inline: auto;
    gap: 6px;
  }

  .code-input {
    width: 100%;
    height: auto;
    min-height: 38px;
    aspect-ratio: 1;
    border-radius: 8px;
    font-size: 19px;
  }

  .login-card.has-password .full-signin {
    margin-top: 26px;
  }

  .login-footer-inner {
    padding: 20px 24px;
  }

  .legal-links {
    flex-wrap: wrap;
  }

  .legal-links a {
    padding: 0 9px;
  }

  .login-footer p {
    line-height: 1.5;
  }
}

@media (max-width: 390px) {
  .login-card {
    padding-inline: 20px;
  }

  .account-privacy p {
    font-size: 13px;
  }

  .password-options {
    align-items: flex-start;
    flex-direction: column;
  }

  .forgot-password {
    margin-left: 25px;
  }

  .legal-links a {
    font-size: 11px;
  }
}

@media (max-width: 760px) {
  .login-main {
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .login-card {
    padding-inline: clamp(20px, 6.4vw, 32px);
  }

  .create-account {
    min-height: 44px;
    margin-top: 4px;
  }

  .account-privacy p {
    overflow-wrap: break-word;
  }

  .legal-links a {
    min-height: 36px;
  }

  .login-footer-inner {
    padding-right: max(24px, env(safe-area-inset-right));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    padding-left: max(24px, env(safe-area-inset-left));
  }

  .dialog-button {
    min-height: 44px;
  }
}

@media (max-width: 360px) {
  .login-card h1 {
    font-size: 24px;
  }

  .passkey-button {
    font-size: 14px;
  }

  .login-dialog {
    padding: 24px;
  }
}

@media (max-height: 700px) and (min-width: 761px) {
  .login-main {
    padding-top: 72px;
    padding-bottom: 36px;
  }
}
