.auth-page {
  display: flex;
  align-items: center;
  min-height: calc(100vh - var(--header-h) - 132px);
  padding: 48px 0 72px;
}

.auth-card {
  width: min(460px, 100%);
  margin: 0 auto;
  padding: 32px 28px 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(240px 110px at 100% 0%, rgba(56, 189, 248, 0.16), transparent 70%),
    #fff;
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.06);
}

.auth-card h1 {
  max-width: 16ch;
  font-size: clamp(28px, 5vw, 36px);
}

.auth-card h1 em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-lead {
  margin: 12px 0 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.auth-form .field input {
  width: 100%;
  max-width: none;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 400;
}

.auth-form .field input:focus {
  outline: 2px solid color-mix(in srgb, var(--blue) 55%, white);
  outline-offset: 1px;
}

.auth-form .field.is-invalid input {
  border-color: #f0b4b0;
  background: #fff8f8;
}

.auth-form .field.is-invalid input:focus {
  outline-color: #f0b4b0;
}

.auth-form .field.is-ok input {
  border-color: color-mix(in srgb, #0f766e 35%, var(--line));
}

.auth-pass {
  position: relative;
  display: block;
  font-weight: 400;
}

.auth-pass input {
  padding-right: 48px;
}

.auth-eye {
  position: absolute;
  top: 50%;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transform: translateY(-50%);
  transition: color 0.18s ease, background 0.18s ease;
}

.auth-eye:hover,
.auth-eye:focus-visible {
  background: #f4f8ff;
  color: var(--muted);
}

.auth-eye.is-on {
  color: #0f172a;
  background: color-mix(in srgb, var(--blue) 8%, white);
}

.auth-eye:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--blue) 55%, white);
  outline-offset: 1px;
}

.auth-rules {
  display: grid;
  gap: 6px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.auth-rules li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  transition: color 0.16s ease;
}

.auth-rules li::before {
  content: "";
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #cbd5e1;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.16);
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.auth-rules li.is-ok {
  color: #0f766e;
}

.auth-rules li.is-ok::before {
  background: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.auth-rules.is-invalid li:not(.is-ok) {
  color: #b42318;
}

.auth-rules.is-invalid li:not(.is-ok)::before {
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.auth-aside {
  margin: -4px 0 18px;
  text-align: right;
  font-size: 13px;
  font-weight: 500;
}

.auth-aside a {
  color: var(--muted);
  text-decoration: none;
}

.auth-aside a:hover {
  color: var(--blue);
}

.auth-submit,
.auth-switch {
  width: 100%;
  min-height: 46px;
}

.auth-submit {
  margin-top: 4px;
}

.auth-switch {
  margin-top: 10px;
}

.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.auth-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  margin: 0;
  color: var(--text);
  font-weight: 600;
}

.auth-google svg {
  flex-shrink: 0;
}

.auth-google-note {
  margin: 8px 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  text-align: center;
}

.auth-google-note a {
  color: var(--blue);
  text-decoration: none;
}

.auth-google-note a:hover {
  text-decoration: underline;
}

.auth-privacy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 18px;
}

.auth-privacy .check {
  margin: 0;
}

.auth-privacy .check span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 400;
}

.auth-privacy .field-error {
  padding-left: 25px;
}

.auth-privacy.is-invalid .check input {
  outline: 1px solid #b42318;
  outline-offset: 1px;
}

.auth-newsletter {
  margin-top: -6px;
}

.auth-ok {
  margin: -8px 0 20px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, #0f766e 28%, var(--line));
  border-radius: 12px;
  background: #f3faf7;
  color: #0f766e;
  font-size: 13px;
  font-weight: 500;
}

.auth-ok[hidden],
.auth-form-error[hidden],
.auth-unverified[hidden],
.auth-resend-msg[hidden] {
  display: none;
}

.auth-unverified {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--line));
  border-radius: 14px;
  background: #f8fbff;
}

.auth-unverified p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-unverified .btn {
  width: 100%;
  min-height: 42px;
}

.auth-resend-msg {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 500;
}

.auth-resend-msg.is-ok {
  color: #0f766e;
}

.auth-resend-msg.is-err {
  color: #b42318;
}

.auth-form-error {
  margin: 0 0 12px;
  color: #b42318;
  font-size: 13px;
  font-weight: 500;
}

.auth-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 28px 8px;
  text-align: center;
  animation: auth-fade 0.35s ease;
}

.auth-loader[hidden] {
  display: none;
}

.auth-loader p {
  margin-top: 16px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.auth-spinner {
  width: 42px;
  height: 42px;
  border: 3px solid color-mix(in srgb, var(--blue) 16%, var(--line));
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}

.auth-form[hidden] {
  display: none;
}

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

@keyframes auth-fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 640px) {
  .auth-page {
    align-items: flex-start;
    min-height: 0;
    padding: 28px 0 56px;
  }

  .auth-card {
    padding: 24px 18px 20px;
    border-radius: 18px;
  }

  .auth-lead {
    margin-bottom: 20px;
    font-size: 14px;
  }

  .auth-aside {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-spinner,
  .auth-loader,
  .auth-eye,
  .auth-rules li,
  .auth-rules li::before {
    animation: none;
    transition: none;
  }

  .auth-spinner {
    border-top-color: var(--blue-deep);
  }
}
