:root {
  --canvas: #eef1f0;
  --surface: #ffffff;
  --surface-muted: #f7f8f7;
  --ink: #182122;
  --ink-soft: #5e6a6b;
  --ink-faint: #879191;
  --line: #d9dfdd;
  --line-strong: #c2cbc8;
  --teal: #087a70;
  --teal-dark: #05645d;
  --red: #a93331;
  --red-soft: #fcebea;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  color: var(--ink);
  background: var(--canvas);
  font-family: -apple-system, "SF Pro Text", "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(8, 122, 112, 0.2);
  outline-offset: 1px;
}

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(360px, 43%) minmax(420px, 1fr);
  background: var(--surface);
}

.auth-context {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  padding: 38px 42px;
  color: #ffffff;
  background: #172021;
}

.context-brand,
.mobile-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: #ffffff;
  background: var(--teal);
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

.context-brand strong,
.context-brand span {
  display: block;
}

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

.context-brand span {
  margin-top: 3px;
  color: #9eabaa;
  font-size: 11px;
}

.context-copy {
  position: relative;
  z-index: 2;
  max-width: 390px;
  margin-top: clamp(110px, 21vh, 190px);
}

.context-copy p,
.auth-heading p {
  margin: 0 0 9px;
  color: #54b6aa;
  font-size: 10px;
  font-weight: 800;
}

.context-copy h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.2;
}

.context-copy > span {
  display: block;
  margin-top: 15px;
  color: #aeb9b7;
  font-size: 13px;
  line-height: 1.7;
}

.scan-visual {
  position: absolute;
  right: -9%;
  bottom: -8%;
  width: min(440px, 77%);
  aspect-ratio: 1 / 1;
  border: 1px solid #31403f;
  background: #192324;
}

.scan-visual::before,
.scan-visual::after {
  position: absolute;
  content: "";
  background: #2a3837;
}

.scan-visual::before {
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
}

.scan-visual::after {
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
}

.scan-target {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 1px solid #41706b;
  border-radius: 50%;
  color: #55b8ac;
  transform: translate(-50%, -50%);
}

.scan-target svg {
  width: 34px;
  height: 34px;
}

.scan-line {
  position: absolute;
  top: 17%;
  left: 7%;
  z-index: 3;
  width: 86%;
  height: 1px;
  background: #25aa9a;
  box-shadow: 0 0 12px rgba(37, 170, 154, 0.6);
  animation: scan 4s ease-in-out infinite;
}

.scan-corner {
  position: absolute;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-color: #5c817d;
  border-style: solid;
}

.corner-one {
  top: 9%;
  left: 9%;
  border-width: 1px 0 0 1px;
}

.corner-two {
  top: 9%;
  right: 9%;
  border-width: 1px 1px 0 0;
}

.corner-three {
  right: 9%;
  bottom: 9%;
  border-width: 0 1px 1px 0;
}

.corner-four {
  bottom: 9%;
  left: 9%;
  border-width: 0 0 1px 1px;
}

.auth-panel {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 54px 64px;
  background: var(--surface);
}

.mobile-brand {
  display: none;
}

.auth-form-wrap {
  width: min(390px, 100%);
}

.auth-heading {
  margin-bottom: 32px;
}

.auth-heading p {
  color: var(--teal);
}

.auth-heading h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.3;
}

.auth-heading > span {
  display: block;
  min-height: 21px;
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.auth-loading {
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 12px;
}

.loading-indicator {
  width: 15px;
  height: 15px;
  border: 2px solid var(--line);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

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

.auth-field {
  display: grid;
  gap: 7px;
}

.auth-field > span {
  font-size: 12px;
  font-weight: 700;
}

.auth-field small {
  color: var(--ink-faint);
  font-size: 10px;
}

.input-shell {
  position: relative;
}

.input-shell > svg {
  position: absolute;
  top: 15px;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--ink-faint);
  pointer-events: none;
}

.input-shell input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 43px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  font-size: 14px;
}

.input-shell input:hover {
  border-color: var(--line-strong);
}

.input-shell input:focus {
  border-color: #73bcb4;
}

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

.password-toggle {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: var(--ink-soft);
  background: transparent;
}

.password-toggle:hover {
  color: var(--ink);
  background: var(--surface-muted);
}

.password-toggle svg {
  width: 16px;
  height: 16px;
}

.auth-error {
  margin-top: -4px;
  padding: 9px 11px;
  border: 1px solid #edbfbd;
  border-radius: 5px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 11px;
  line-height: 1.5;
}

.submit-button {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 3px;
  padding: 0 16px;
  border: 1px solid var(--teal);
  border-radius: 5px;
  color: #ffffff;
  background: var(--teal);
  font-size: 13px;
  font-weight: 750;
}

.submit-button:hover:not(:disabled) {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
}

.submit-button:disabled {
  color: #aab5b3;
  border-color: #e0e5e3;
  background: #e8ecea;
  cursor: not-allowed;
}

.submit-button svg {
  width: 17px;
  height: 17px;
}

.auth-footer {
  position: absolute;
  right: 32px;
  bottom: 24px;
  margin: 0;
  color: var(--ink-faint);
  font-size: 10px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes scan {
  0%,
  100% {
    top: 17%;
  }
  50% {
    top: 83%;
  }
}

@media (max-width: 820px) {
  .auth-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 116px minmax(0, 1fr);
  }

  .auth-context {
    min-height: 116px;
    padding: 28px 30px;
  }

  .context-copy h1 {
    font-size: 30px;
  }

  .context-copy,
  .scan-visual {
    display: none;
  }

  .auth-panel {
    align-items: flex-start;
    padding: 64px 28px 72px;
  }
}

@media (max-width: 480px) {
  .auth-shell {
    display: block;
  }

  .auth-context {
    display: none;
  }

  .auth-panel {
    min-height: 100vh;
    min-height: 100dvh;
    display: block;
    padding: 24px 22px 58px;
  }

  .mobile-brand {
    display: flex;
    margin-bottom: 62px;
  }

  .mobile-brand .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .mobile-brand strong {
    font-size: 13px;
  }

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

  .auth-heading h2 {
    font-size: 23px;
  }

  .auth-footer {
    right: 22px;
  }
}

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