/* =========================================================
   Auth pages  —  login, register, set-password
   ========================================================= */

.auth-main {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h, 3.3rem) + 2.75rem) 1.25rem 3.5rem;
  background: #050505;
  background-image: repeating-linear-gradient(
    rgba(255, 255, 255, 0.096),
    transparent,
    rgba(255, 255, 255, 0.096)
  );
  background-repeat: no-repeat;
  background-size: 100%, cover;
  background-attachment: scroll, fixed;
  background-position: center, center;
}

.auth-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  width: 100%;
  max-width: 440px;
}

/* ── Logo ── */

.auth-brand {
  display: block;
  text-decoration: none;
  outline: none;
}

.auth-brand img {
  display: block;
  width: 8rem;
  height: auto;
  opacity: 0.82;
  transition: opacity 160ms ease;
}

.auth-brand:hover img,
.auth-brand:focus-visible img {
  opacity: 1;
}

/* ── Card ── */

.auth-card {
  width: 100%;
  padding: 2.1rem 1.9rem 1.85rem;

  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.052) 0%, rgba(255, 255, 255, 0.022) 100%),
    rgba(6, 7, 10, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 1.15rem;

  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.28);
}

.auth-card__head {
  margin-bottom: 1.6rem;
}

.auth-card__title {
  font-size: 1.52rem;
  font-weight: 800;
  color: rgba(248, 250, 255, 0.94);
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 0.42rem;
}

.auth-card__subtitle {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.42);
  line-height: 1.55;
  font-weight: 400;
}

/* ── Messages ── */

.auth-message {
  padding: 0.75rem 0.95rem;
  margin-bottom: 1.15rem;
  border-radius: 0.52rem;
  font-size: 0.875rem;
  line-height: 1.5;
  font-weight: 500;
}

.auth-message--success {
  background: rgba(20, 90, 20, 0.18);
  border: 1px solid rgba(50, 170, 50, 0.22);
  color: rgba(110, 210, 110, 0.92);
}

.auth-message--error {
  background: rgba(160, 0, 0, 0.14);
  border: 1px solid rgba(200, 30, 30, 0.26);
  color: rgba(255, 115, 115, 0.94);
}

/* ── Form ── */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}

.auth-form__group {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.auth-form__group label {
  font-size: 0.77rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.38);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.auth-form__group input {
  width: 100%;
  padding: 0.78rem 0.92rem;

  background: rgba(255, 255, 255, 0.038);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0.6rem;

  color: rgba(255, 255, 255, 0.92);
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 400;
  line-height: 1.5;

  outline: none;
  box-sizing: border-box;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.auth-form__group input::placeholder {
  color: rgba(255, 255, 255, 0.18);
}

.auth-form__group input:focus {
  border-color: rgba(170, 0, 0, 0.52);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 0 3px rgba(170, 0, 0, 0.12);
}

/* ── Submit button ── */

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.84rem 1.4rem;
  margin-top: 0.35rem;

  background: linear-gradient(180deg, rgba(210, 20, 20, 0.96) 0%, rgba(145, 0, 0, 0.97) 100%);
  border: 1px solid rgba(255, 90, 90, 0.22);
  border-radius: 0.6rem;

  color: #fff;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-family: inherit;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;

  box-shadow:
    0 4px 18px rgba(170, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.13);

  transition:
    background 130ms ease,
    border-color 130ms ease,
    box-shadow 160ms ease,
    transform 160ms cubic-bezier(0.34, 1.28, 0.64, 1);
}

.auth-btn:hover {
  background: linear-gradient(180deg, rgba(232, 32, 32, 1) 0%, rgba(170, 0, 0, 1) 100%);
  border-color: rgba(255, 130, 130, 0.3);
  transform: translateY(-1px);
  box-shadow:
    0 8px 28px rgba(170, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.17);
}

.auth-btn:active {
  transform: translateY(0);
}

.auth-btn:disabled,
.auth-btn[aria-busy="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  pointer-events: none;
}

/* ── Footer links ── */

.auth-card__links {
  margin-top: 1.5rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.auth-card__links a {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.36);
  text-decoration: none;
  transition: color 150ms ease;
}

.auth-card__links a:hover,
.auth-card__links a:focus-visible {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: underline;
  text-underline-offset: 0.14em;
  outline: none;
}

.auth-card__links a strong {
  font-weight: 700;
  color: inherit;
}

/* ── Loading overlay ── */

.auth-page-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(4, 5, 8, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.auth-page-loading[hidden] {
  display: none !important;
}

.auth-page-loading__panel {
  width: min(100%, 340px);
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 1.1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.052) 0%, rgba(255, 255, 255, 0.022) 100%),
    rgba(6, 7, 10, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.085);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.auth-page-loading__spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 1.1rem;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: rgba(200, 20, 20, 0.9);
  animation: auth-spin 0.75s linear infinite;
}

.auth-page-loading__text {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.58);
  letter-spacing: 0.01em;
}

.auth-form.is-submitting .auth-btn {
  pointer-events: none;
  opacity: 0.6;
}

body.auth-is-submitting {
  cursor: progress;
}

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

/* ── Mobile ── */

@media (max-width: 480px) {
  .auth-main {
    padding-top: calc(var(--nav-h, 3.3rem) + 1.75rem);
    padding-bottom: 2.5rem;
  }

  .auth-card {
    padding: 1.6rem 1.25rem 1.4rem;
    border-radius: 1rem;
  }

  .auth-card__title {
    font-size: 1.32rem;
  }
}
