.auth-screen {
  --auth-ink: #f5f5f2;
  --auth-muted: #e4e8e6;
  --auth-line: #929b9d;
  --auth-accent: #a3f6ca;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 62.25%) minmax(0, 37.75%);
  min-height: 100svh;
  overflow: hidden;
  color: var(--auth-ink);
  background: #101518;
  color-scheme: dark;
}

.auth-story {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 580px;
  padding: 0 0 0 clamp(24px, 3.45vw, 64px);
}

.auth-story::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: url("./emerald-atlas.webp") left center / 62.25% auto no-repeat;
  mask-image: linear-gradient(90deg, #000 52%, transparent 62.25%);
}

.auth-story p {
  margin: 0;
  color: var(--auth-ink);
  font-size: clamp(28px, 3.1vw, 58px);
  font-weight: 720;
  letter-spacing: -.055em;
  line-height: 1.08;
  text-shadow: 0 2px 10px #08120f;
}

.auth-story em { color: var(--auth-accent); font-style: normal; }

.auth-panel {
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 34px clamp(24px, 5vw, 92px) 52px clamp(20px, 2.8vw, 52px);
}

.auth-card { width: min(100%, 480px); }

.auth-brand {
  margin: 0 0 clamp(28px, 3.95vw, 60px);
}

.auth-brand img {
  display: block;
  width: min(100%, 420px);
  height: auto;
}

.auth-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  background: #0d1415;
}

.auth-tabs button,
.auth-reveal {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--auth-muted);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}

.auth-tabs button[aria-pressed="true"] {
  border-color: #547e6d;
  color: var(--auth-ink);
  background: #213d32;
}

.auth-tabs button[aria-pressed="false"]:hover:not(:disabled),
.auth-reveal:hover {
  color: var(--auth-accent);
}

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

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

.auth-field label {
  font-size: 13px;
  font-weight: 650;
}

.auth-input {
  position: relative;
}

.auth-input input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid #687477;
  border-radius: 10px;
  color: var(--auth-ink);
  background: #0d1415;
  font-size: 16px;
}

.auth-input input::placeholder { color: #869b90; }
.auth-input input:hover { border-color: #648879; }

.auth-input input:focus {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px #77e5ad28;
}

.auth-input input[aria-invalid="true"] { border-color: #fa9d9d; }
.auth-input:has(.auth-reveal) input { padding-inline-end: 52px; }
.auth-input input::-ms-reveal { display: none; }

.auth-reveal {
  position: absolute;
  display: grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  inset-inline-end: 5px;
  inset-block-start: 50%;
  padding: 0;
  transform: translateY(-50%);
}

.auth-reveal svg { width: 20px; height: 20px; pointer-events: none; }

.auth-screen button:focus-visible {
  outline: 2px solid var(--auth-accent);
  outline-offset: 2px;
}

.auth-feedback,
.auth-status,
.auth-field-error {
  margin: 0;
  color: #ffc0bd;
  font-size: 13px;
  line-height: 1.45;
}

.auth-status { color: var(--auth-accent); }

.auth-feedback:empty,
.auth-status:empty,
.auth-field-error:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  margin-top: 4px;
  border: 1px solid #a0f4c5;
  border-radius: 11px;
  color: #082218;
  background: linear-gradient(110deg, #aaf5ce, #72e3aa);
  box-shadow: 0 5px 22px #60d99f25;
  font-size: 14px;
  font-weight: 780;
}

.auth-submit:hover:not([aria-disabled]) { filter: brightness(1.09); }
.auth-submit[aria-disabled] { cursor: progress; filter: saturate(0.55); }

.auth-arrow {
  width: 15px;
  height: 11px;
  background: currentColor;
  clip-path: polygon(0 43%, 73% 43%, 47% 10%, 55% 0, 100% 50%, 55% 100%, 47% 90%, 73% 57%, 0 57%);
}

.auth-screen button,
.auth-screen input {
  transition: background-color 140ms, border-color 140ms, color 140ms, box-shadow 140ms, filter 140ms;
}

.auth-submit[aria-disabled] .auth-arrow {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  background: transparent;
  clip-path: none;
  animation: auth-spin 800ms linear infinite;
}

@keyframes auth-spin { to { transform: rotate(1turn); } }

.auth-feedback:not(:empty), .auth-status:not(:empty) {
  padding: 10px 12px;
  border: 1px solid currentColor;
  border-radius: 10px;
}

.auth-tabs {
  gap: 4px;
  padding: 4px;
  border-color: #455154;
  border-radius: 12px;
  background: #181f22;
}

.auth-tabs button {
  min-height: 44px;
  border-radius: 8px;
  font-size: 13px;
}

.auth-tabs button[aria-pressed="true"] {
  border-color: var(--auth-accent);
  color: #071810;
  background: var(--auth-accent);
}

.auth-form {
  gap: 17px;
  margin-top: 24px;
}

.auth-field { gap: 6px; }
.auth-field label { font-size: 13px; font-weight: 650; }
.auth-input input {
  min-height: 52px;
  border-color: #687477;
  border-radius: 10px;
  background: #1e2426;
}

.auth-reveal {
  inset-block-start: 50%;
  transform: translateY(-50%);
  color: #bdc8c6;
  font-size: 13px;
  font-weight: 650;
}

.auth-submit {
  min-height: 52px;
  margin-top: 4px;
  border-radius: 12px;
  background: var(--auth-accent);
  box-shadow: 0 5px 22px #60d99f25;
  font-size: 14px;
}

.auth-status:not(:empty) { padding: 0; border: 0; }

@media (max-width: 800px) {
  .auth-screen { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-story {
    position: relative;
    min-height: clamp(144px, 29vw, 231px);
    padding: 0;
    overflow: hidden;
    background: url("./emerald-atlas.webp") center 37% / min(100%, 540px) auto no-repeat, #101518;
  }
  .auth-story::before { content: none; }
  .auth-story p { display: none; }
  .auth-panel { align-items: start; padding: 28px 20px 36px; }
  .auth-brand img { margin-inline: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-screen button, .auth-screen input { transition: none; }
  .auth-submit[aria-disabled] .auth-arrow { animation: none; }
}

.auth-screen .auth-text-button {
  justify-self: start;
  min-height: 36px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--auth-accent);
  font-size: 13px;
  font-weight: 650;
}
.auth-screen .auth-text-button:hover { text-decoration: underline; }
.auth-recovery-title { margin: 0; color: var(--auth-ink); }
.auth-recovery-description { margin: 8px 0 0; color: var(--auth-muted); font-size: 14px; line-height: 1.5; }
