:root {
  --login-ink: #132849;
  --login-muted: #72829a;
  --login-primary: #0062b6;
  --login-primary-dark: #00529a;
  --login-panel: #033d72;
  --login-border: #d6dee9;
  --login-focus-text: #2b4261;
  --login-focus-ring: rgba(7, 88, 184, 0.32);
}

.login-body {
  min-width: 320px;
  background: #f7f8fb;
}

.login-page {
  display: grid;
  grid-template-columns: 45.7% 54.3%;
  min-height: 100vh;
  background: #f7f8fb;
}

.login-visual {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  padding: 34px 0 54px 99px;
  background: #034f80;
  color: #fff;
}

.login-nav {
  display: flex;
  align-items: center;
  min-height: 40px;
  margin-left: -56px;
}

.login-brand,
.login-brand:hover {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.login-brand svg {
  width: 39px;
  height: 39px;
  stroke-width: 2.5;
}

.login-hero {
  width: 455px;
  max-width: calc(100% - 42px);
  margin-top: clamp(128px, 19vh, 180px);
}

.login-hero h1 {
  margin: 0;
  color: #fff;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.33;
}

.login-intro {
  max-width: 420px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 17px;
  font-weight: 450;
  letter-spacing: 0.005em;
  line-height: 1.75;
}

.login-flow {
  margin-top: 30px;
}

.login-flow-item {
  display: flex;
  min-height: 99px;
  align-items: center;
  border-bottom: 1px solid rgba(223, 237, 255, 0.42);
}

.login-flow-item:last-child {
  border-bottom: 0;
}

.login-step-num {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
}

.login-flow-divider {
  width: 1px;
  height: 28px;
  flex: 0 0 1px;
  margin: 0 29px 0 23px;
  background: rgba(255, 255, 255, 0.76);
}

.login-flow-copy,
.login-flow-copy strong,
.login-flow-copy small {
  display: block;
}

.login-flow-copy strong {
  color: #fff;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.login-flow-copy small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.87);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
}

.login-main {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
  background: #f7f8fb;
}

.login-main-inner {
  width: 518px;
  max-width: 100%;
}

.login-card {
  width: 100%;
  min-height: 664px;
  padding: 62px 72px 39px;
  border: 1px solid #d8e0eb;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 16px 26px rgba(35, 55, 83, 0.14);
  transform: translate(-3px, -3px);
}

.login-card-header {
  margin: 0 0 26px;
}

.login-card-header h2 {
  margin: 0;
  color: var(--login-ink);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.35;
  transform: translateY(-8px);
}

.login-field {
  margin-bottom: 23px;
}

.login-field label {
  display: block;
  margin: 0 0 4px;
  color: var(--login-ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

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

.login-label-row label {
  margin: 0 0 4px;
}

.login-forgot-link,
.login-back-link {
  color: var(--login-primary);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
  text-decoration: none;
}

.login-forgot-link:hover,
.login-back-link:hover {
  color: var(--login-primary-dark);
}

.login-field input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--login-border);
  border-radius: 5px;
  background: #fff;
  color: var(--login-ink);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.login-field input::placeholder {
  color: #9aabc2;
}

.login-field input:hover {
  border-color: #b9c7da;
}

.login-field input:focus {
  border-color: var(--login-primary);
  box-shadow: 0 0 0 3px rgba(7, 88, 184, 0.12);
}

.login-field input.is-valid {
  border-color: #12a274;
}

.login-field input.is-invalid {
  border-color: #d92d20;
  background: #fffafa;
}

.login-password-wrap {
  position: relative;
}

.login-sms-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 124px;
  gap: 10px;
}

.login-captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  align-items: stretch;
  gap: 12px;
}

.login-captcha-row input {
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.captcha-image-button {
  position: relative;
  display: block;
  height: 48px;
  padding: 0;
  border: 1px solid #d8dcff;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff 0%, #f6f7ff 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.65), 0 6px 16px rgba(91,92,226,0.08);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.captcha-image-button:hover {
  border-color: #aeb2ff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.8), 0 8px 20px rgba(91,92,226,0.14);
  transform: translateY(-1px);
}

.captcha-image-button:disabled,
.captcha-image-button.is-loading {
  cursor: progress;
  opacity: 0.72;
  transform: none;
}

.captcha-image-button:focus-visible {
  outline: 2px solid rgba(91, 92, 226, 0.32);
  outline-offset: 2px;
}

.captcha-image-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.captcha-refresh-mark {
  position: absolute;
  right: 6px;
  top: 5px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(17,24,39,0.62);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.captcha-image-button:hover .captcha-refresh-mark,
.captcha-image-button:focus-visible .captcha-refresh-mark {
  opacity: 1;
  transform: scale(1);
}

.login-sms-button {
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid #cfd2ff;
  border-radius: 10px;
  background: #f7f7ff;
  color: var(--login-primary);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.login-sms-button:hover:not(:disabled) {
  border-color: #b7b9ff;
  background: #efefff;
}

.login-sms-button:disabled {
  cursor: not-allowed;
  color: #9294d9;
  opacity: 0.78;
}
.login-password-wrap input {
  padding-right: 58px;
}

.login-password-wrap .login-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 36px;
  height: 36px;
  min-height: 0;
  margin: 0;
  place-items: center;
  transform: translateY(-50%);
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: #71839d;
  line-height: 1;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.login-password-wrap .login-password-toggle:hover:not(:disabled) {
  transform: translateY(-50%);
  background: rgba(0, 98, 182, 0.08);
  box-shadow: none;
  color: var(--login-primary-dark);
}

.login-password-wrap .login-password-toggle:active:not(:disabled) {
  transform: translateY(-50%);
  background: rgba(0, 98, 182, 0.13);
}

.login-password-wrap .login-password-toggle:focus-visible {
  transform: translateY(-50%);
  outline: none;
  background: rgba(0, 98, 182, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 98, 182, 0.16);
  color: var(--login-primary-dark);
}

.login-password-toggle svg {
  width: 19px;
  height: 19px;
  stroke-width: 2;
}

.login-password-toggle [data-password-eye="closed"] {
  display: none;
}

.login-password-toggle[aria-pressed="true"] [data-password-eye="open"] {
  display: none;
}

.login-password-toggle[aria-pressed="true"] [data-password-eye="closed"] {
  display: block;
}

.login-captcha-field {
  margin-bottom: 0;
}

.login-captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 16px;
}

.login-captcha-refresh {
  width: 170px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
}

.login-captcha-refresh:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(7, 88, 184, 0.16);
}

.login-captcha-row img {
  display: block;
  width: 170px;
  height: 52px;
  border: 1px solid var(--login-border);
  border-radius: 5px;
  object-fit: cover;
}

.login-field .field-feedback {
  min-height: 6px;
  margin: 0;
  color: #c6251a;
  font-size: 12px;
  line-height: 1.4;
}

.login-field .field-feedback.valid {
  color: #07835f;
}

.login-agreement {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 3px;
  margin-top: 5px;
  color: #63728a;
  font-size: 12px;
  line-height: 1.75;
}

.login-agreement-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #46566e;
  cursor: pointer;
  user-select: none;
}

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

.login-agreement-indicator {
  display: grid;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  place-items: center;
  border: 1px solid #aebbd0;
  border-radius: 3px;
  background: #fff;
}

.login-agreement-check input:checked + .login-agreement-indicator {
  border-color: var(--login-primary);
  background: var(--login-primary);
}

.login-agreement-check input:checked + .login-agreement-indicator::after {
  width: 6px;
  height: 3px;
  border-bottom: 1.8px solid #fff;
  border-left: 1.8px solid #fff;
  content: "";
  transform: translateY(-1px) rotate(-45deg);
}

.login-agreement-check input:focus-visible + .login-agreement-indicator {
  outline: 2px solid rgba(7, 88, 184, 0.32);
  outline-offset: 2px;
}

.login-agreement-check input:disabled + .login-agreement-indicator {
  border-color: #d5deea;
  background: #f3f6fa;
}

.login-agreement-links {
  display: inline;
}

.login-agreement-link {
  display: inline;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--login-primary);
  font: inherit;
  font-weight: 650;
  line-height: inherit;
  cursor: pointer;
  appearance: none;
  transition: color 0.15s ease;
}

.login-agreement .login-agreement-link:hover:not(:disabled),
.login-agreement .login-agreement-link:focus,
.login-agreement .login-agreement-link:focus-visible,
.login-agreement .login-agreement-link:active {
  /* Keep agreement text readable; the focus indicator is the outline, not the text color. */
  background: transparent;
  box-shadow: none;
  color: var(--login-focus-text);
  text-decoration: underline;
  transform: none;
}

.login-agreement .login-agreement-link:focus-visible {
  outline: 2px solid var(--login-focus-ring);
  outline-offset: 2px;
}

.login-agreement-feedback {
  width: 100%;
  min-height: 0 !important;
}

.login-error {
  min-height: 0;
  margin: 0;
  color: #c6251a;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
}

.login-error:not(:empty) {
  margin: 8px 0 0;
}

.login-submit {
  width: 100%;
  height: 53px;
  margin: 24px 0 0;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: var(--login-primary);
  box-shadow: none;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.login-submit:hover:not(:disabled),
.login-submit:focus-visible {
  transform: translateY(-1px);
  background: var(--login-primary-dark);
  outline: none;
}

.login-submit:focus-visible {
  box-shadow: 0 0 0 3px rgba(7, 88, 184, 0.18);
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.login-account-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 33px;
  color: #4a5c75;
  font-size: 15px;
  line-height: 1.4;
}

.login-account-prompt a {
  color: var(--login-primary);
  font-weight: 650;
  text-decoration: none;
}

.login-account-prompt a:hover {
  color: var(--login-primary-dark);
}

.login-agreement-open {
  overflow: hidden;
}

.login-agreement-modal {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: block;
  padding: 0;
  background: #fff;
}

.login-agreement-modal[hidden] {
  display: none;
}

.login-agreement-dialog {
  display: flex;
  width: 100%;
  height: 100%;
  max-height: none;
  flex-direction: column;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.login-agreement-dialog-head {
  display: flex;
  width: min(920px, calc(100% - 64px));
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  padding: 28px 0 20px;
  border-bottom: 1px solid #e7edf5;
}

.login-agreement-eyebrow {
  margin: 0 0 4px;
  color: #71839d;
  font-size: 12px;
  font-weight: 650;
}

.login-agreement-dialog h2 {
  margin: 0;
  color: var(--login-ink);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.4;
}

.login-agreement-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  color: #64748b;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.login-agreement-close:hover:not(:disabled),
.login-agreement-close:focus-visible {
  box-shadow: none;
  background: #f0f5fb;
  color: var(--login-primary);
  transform: none;
  outline: none;
}

.login-agreement-close svg {
  width: 20px;
  height: 20px;
}

.login-agreement-tabs {
  display: flex;
  width: min(920px, calc(100% - 64px));
  min-height: 56px;
  gap: 30px;
  margin: 0 auto;
  padding: 0;
  border-bottom: 1px solid #e7edf5;
}

.login-agreement-tabs button {
  min-height: 56px;
  padding: 0 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #6e7e94;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.login-agreement-tabs button:hover:not(:disabled),
.login-agreement-tabs button:focus,
.login-agreement-tabs button:focus-visible,
.login-agreement-tabs button:active {
  /* Override the global button state: tabs keep a stable dark text color on white. */
  color: var(--login-focus-text);
  background: transparent;
  box-shadow: none;
  transform: none;
}

.login-agreement-tabs button:focus-visible {
  outline: 2px solid var(--login-focus-ring);
  outline-offset: 3px;
}

.login-agreement-tabs button.active {
  border-bottom-color: var(--login-primary);
  background: transparent;
  color: var(--login-primary);
}

.login-agreement-content {
  width: min(760px, calc(100% - 64px));
  min-height: 0;
  margin: 0 auto;
  overflow: auto;
  padding: 40px 0 64px;
  color: #43536a;
  font-size: 15px;
  line-height: 1.9;
  white-space: pre-wrap;
}

.login-toast {
  position: fixed;
  top: 22px;
  left: 50%;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100vw - 32px);
  transform: translate(-50%, -12px);
  padding: 12px 18px;
  border: 1px solid #b7ead8;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(16, 72, 55, 0.14);
  color: #08765a;
  font-size: 13px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

.login-toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
}

@media (max-width: 1100px) {
  .login-page {
    grid-template-columns: minmax(420px, 45.7%) minmax(480px, 1fr);
  }

  .login-visual {
    padding-left: 56px;
  }

  .login-hero {
    width: min(455px, calc(100% - 32px));
  }
}

@media (max-width: 820px) {
  .login-page {
    display: block;
  }

  .login-visual {
    min-height: 288px;
    padding: 28px 26px 48px;
  }

  .login-brand,
  .login-brand:hover {
    font-size: 18px;
  }

  .login-brand svg {
    width: 34px;
    height: 34px;
  }

  .login-hero {
    width: 100%;
    max-width: none;
    margin-top: 58px;
  }

  .login-hero h1 {
    font-size: clamp(31px, 8vw, 42px);
  }

  .login-intro,
  .login-flow {
    display: none;
  }

  .login-main {
    min-height: auto;
    padding: 0 18px 36px;
  }

  .login-main-inner {
    margin-top: -34px;
  }
}

@media (max-width: 540px) {
  .login-card {
    padding: 38px 24px 32px;
  }

  .login-captcha-row {
    grid-template-columns: minmax(0, 1fr) 132px;
    gap: 10px;
  }

  .login-captcha-row input {
    padding-inline: 10px;
    letter-spacing: 3px;
  }

  .login-captcha-row img {
    width: 132px;
  }

  .login-captcha-refresh {
    width: 132px;
  }

  .login-agreement-dialog {
    max-height: none;
  }

  .login-agreement-modal {
    padding: 0;
  }

  .login-agreement-dialog-head,
  .login-agreement-tabs {
    width: calc(100% - 36px);
  }

  .login-agreement-tabs {
    gap: 2px;
  }

  .login-agreement-tabs button {
    padding-inline: 7px;
    font-size: 12px;
  }

  .login-agreement-content {
    width: calc(100% - 36px);
    padding: 28px 0 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-field input,
  .login-submit,
  .captcha-image-button,
  .login-toast {
    transition: none;
  }
}
