.auth {
  min-height: 100dvh;
  background: var(--bg);
}

.auth-root {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100dvh;
}

.auth-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100dvh;
  padding: 22px 32px calc(22px + var(--safe-bottom));
}

.auth-art {
  position: sticky;
  top: 12px;
  height: calc(100dvh - 24px);
  margin: 12px 12px 12px 0;
  overflow: hidden;
  border-radius: 18px;
  background: var(--bg-raised);
  isolation: isolate;
}

.auth-art .wp {
  transition: opacity 1.1s var(--ease-out);
}

.auth-art .wp.is-ready:not(.is-current) {
  opacity: 0;
}

.auth-art-caption {
  position: absolute;
  left: 24px;
  bottom: 22px;
  z-index: 1;
  display: grid;
  gap: 2px;
  color: rgba(255, 255, 255, 0.92);
  font-size: var(--fs-sm);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.auth-art-caption b {
  font-weight: 600;
}

.auth-art-caption span {
  color: rgba(255, 255, 255, 0.62);
  font-size: var(--fs-xs);
}

.auth-plan {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.auth-plan-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
}

.auth-logo {
  display: inline-flex;
  color: var(--text);
}

.auth-logo svg {
  transform: translateY(-20%);
}

.auth-lang {
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: var(--fs-sm);
  transition: background-color var(--dur-2), color var(--dur-2);
}

.auth-lang:hover {
  background: var(--surface-2);
  color: var(--text);
}

.auth-center {
  flex: 1;
  display: grid;
  align-content: center;
  width: 100%;
  max-width: 372px;
  margin: 0 auto;
  padding: 40px 0;
}

.auth-view {
  display: grid;
  gap: 20px;
}

.auth-view.is-entering {
  animation: fade-in var(--dur-3) var(--ease-out) both;
}

.auth-title {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--white);
}

.auth-sub {
  margin-top: 8px;
  color: var(--text-2);
  font-size: var(--fs-md);
  line-height: 1.5;
}

.auth-providers {
  display: grid;
  gap: 8px;
}

.auth-provider {
  height: 42px;
  border-radius: var(--r-md);
}

.auth-provider .icon {
  width: 17px;
  height: 17px;
}

.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.auth-or::before,
.auth-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line-2);
}

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

.auth-form .input {
  min-height: 42px;
}

.auth-submit {
  height: 42px;
  border-radius: var(--r-md);
  font-weight: 600;
}

.auth-email-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 4px 4px 4px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line-2);
}

.auth-email-chip span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-email-chip .btn {
  border-radius: var(--r-sm);
}

.auth-reveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows var(--dur-3) var(--ease-out), opacity var(--dur-2) var(--ease-out);
}

.auth-reveal > div {
  min-height: 0;
  overflow: hidden;
}

.auth-reveal.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.auth-reveal-inner {
  display: grid;
  gap: 12px;
}

.auth-reveal.is-instant {
  transition: none;
}

.auth-submit .icon {
  width: 17px;
  height: 17px;
}

.auth-recovery-input {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-recovery-input::placeholder {
  text-transform: none;
  letter-spacing: 0.06em;
}

.auth-steps {
  display: grid;
  justify-items: start;
  gap: 10px;
  margin-top: 4px;
}

.auth-steps .auth-link {
  min-height: 24px;
  text-align: left;
}

.auth-lost-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: -6px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-2);
}

.auth-lost {
  display: grid;
  gap: 12px;
  color: var(--text-2);
  font-size: var(--fs-md);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--fs-sm);
}

.auth-link {
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.auth-link:hover:not(:disabled) {
  color: var(--text);
}

.auth-link:disabled {
  color: var(--text-3);
}

.auth-link-strong {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line-3);
  text-underline-offset: 3px;
}

.auth-switch {
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--danger-soft);
  color: #ffb3ae;
  font-size: var(--fs-sm);
}

.auth-error .icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--danger);
}

.password-field {
  position: relative;
}

.password-field .input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
}

.strength {
  display: grid;
  gap: 6px;
}

.strength-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.strength-bars span {
  height: 3px;
  border-radius: 3px;
  background: var(--surface-3);
  transition: background-color var(--dur-3) var(--ease-out);
}

.strength[data-score='1'] .strength-bars span:nth-child(-n + 1) { background: var(--danger); }
.strength[data-score='2'] .strength-bars span:nth-child(-n + 2) { background: var(--warning); }
.strength[data-score='3'] .strength-bars span:nth-child(-n + 3) { background: var(--success); }
.strength[data-score='4'] .strength-bars span { background: var(--success); }

.strength-text {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.strength-text b {
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
}

.otp {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.otp input {
  width: 100%;
  height: 52px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--white);
  font: 500 22px/1 var(--font-mono);
  text-align: center;
  transition: border-color var(--dur-2), background-color var(--dur-2);
}

.otp input:focus {
  border-color: var(--line-3);
  background: var(--surface-2);
}

.otp.is-error input {
  border-color: rgba(242, 112, 107, 0.55);
}

.otp.is-success input {
  border-color: rgba(90, 209, 154, 0.6);
}

.auth-foot {
  display: flex;
  justify-content: center;
  gap: 16px;
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.auth-foot a:hover {
  color: var(--text-2);
}

.auth-noscript {
  padding: 40px;
  text-align: center;
}

.auth-blocked-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: -6px;
  border-radius: var(--r-pill);
  background: var(--danger-soft);
  color: var(--danger);
}

.auth-blocked {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line-2);
}

.auth-facts {
  display: grid;
  gap: 10px;
}

.auth-facts > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--fs-sm);
}

.auth-facts dt {
  color: var(--text-3);
}

.auth-facts dd {
  color: var(--text);
  text-align: right;
}

.auth-message {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.auth-appeal .auth-form .textarea {
  min-height: 120px;
}

.auth-label {
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 500;
}

.auth-hint {
  color: var(--text-3);
  font-size: var(--fs-xs);
  line-height: 1.5;
}

.auth-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-size: var(--fs-sm);
}

.auth-status .icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--text-2);
}

.auth-status-title {
  color: var(--text);
  font-weight: 500;
}

.auth-status-text {
  margin-top: 4px;
  color: var(--text-2);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.auth-status.is-rejected .icon {
  color: var(--danger);
}

@media (max-width: 1023px) {
  .auth-root {
    position: relative;
    display: block;
  }

  .auth-art {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 240px;
    margin: 0;
    border-radius: 0;
    -webkit-mask-image: linear-gradient(to bottom, #000 25%, transparent);
    mask-image: linear-gradient(to bottom, #000 25%, transparent);
  }

  .auth-art-caption {
    display: none;
  }

  .auth-pane {
    position: relative;
    z-index: 1;
  }
}

@media (max-width: 640px) {
  .auth-pane {
    padding: calc(14px + var(--safe-top)) 20px calc(16px + var(--safe-bottom));
  }

  .auth-title {
    font-size: 28px;
  }

  .auth-center {
    align-content: start;
    padding-top: 12vh;
  }

  .otp {
    gap: 6px;
  }
}
