.auth-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.auth-grid--stacked {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
}

.auth-grid--stacked.is-reset {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}

.auth-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  gap: 12px;
  flex-direction: column;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

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

.password-field {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.password-field input {
  width: 100%;
  padding-right: 50px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(58, 126, 124, 0.24);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(226, 243, 241, 0.84) 100%
  );
  color: #3b7371;
  box-shadow:
    0 7px 14px rgba(58, 126, 124, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.password-toggle:hover {
  color: #255f5d;
  border-color: rgba(58, 126, 124, 0.46);
  background: linear-gradient(
    145deg,
    rgba(236, 248, 247, 0.98) 0%,
    rgba(198, 233, 231, 0.9) 100%
  );
  transform: translateY(-50%) scale(1.04);
  box-shadow:
    0 10px 16px rgba(58, 126, 124, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.password-toggle:active {
  transform: translateY(-50%) scale(0.98);
  box-shadow:
    0 4px 8px rgba(58, 126, 124, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.password-toggle .icon-eye-off {
  display: none;
}

.password-field.is-visible .password-toggle {
  color: #215957;
  border-color: rgba(58, 126, 124, 0.52);
  background: linear-gradient(
    145deg,
    rgba(223, 243, 242, 0.98) 0%,
    rgba(182, 226, 223, 0.9) 100%
  );
  box-shadow:
    0 9px 15px rgba(58, 126, 124, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.password-field.is-visible .password-toggle .icon-eye {
  display: none;
}

.password-field.is-visible .password-toggle .icon-eye-off {
  display: block;
}

.card {
  animation: rise 0.35s ease both;
}

.auth-subsection {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.auth-subsection h3 {
  margin: 0;
  font-size: 1.05rem;
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
}

#forgotPasswordForm {
  display: grid;
  gap: 10px;
}

#resetPasswordCard {
  max-width: min(560px, 100%);
  width: 100%;
}

#loginForm,
#registerForm,
#resetPasswordForm {
  display: grid;
  gap: 12px;
}

#loginForm .primary,
#registerForm .primary,
#resetPasswordForm .primary {
  margin-top: 10px;
  min-width: 190px;
  min-height: 50px;
  justify-self: start;
}

#forgotPasswordForm .ghost {
  margin-top: 8px;
  min-height: 44px;
  justify-self: start;
}

@media (max-width: 900px) {
  .auth-grid,
  .auth-grid--stacked {
    grid-template-columns: 1fr;
  }

  .auth-divider {
    padding: 16px 0;
    flex-direction: row;
  }

  .auth-divider::before,
  .auth-divider::after {
    width: 100%;
    height: 1px;
  }
}

@media (max-width: 700px) {
  .password-field input {
    padding-right: 46px;
  }

  .password-toggle {
    width: 30px;
    height: 30px;
  }

  #loginForm .primary,
  #registerForm .primary,
  #resetPasswordForm .primary,
  #forgotPasswordForm .ghost {
    width: 100%;
    min-width: 0;
    justify-self: stretch;
  }
}
