/* Auth pages — login / register */
.auth-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.25rem 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.auth-page__bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, hsla(16, 100%, 60%, .18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 90%, hsla(16, 80%, 50%, .12), transparent 50%),
    var(--bg);
  z-index: 0;
}

html.light .auth-page__bg {
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, hsla(16, 100%, 60%, .12), transparent 55%),
    var(--bg);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem 1.75rem;
  box-shadow: var(--card-shadow);
}

.auth-card__logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.auth-card__head {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-card__head h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: .35rem;
}

.auth-card__head p {
  color: var(--text-muted);
  font-size: .95rem;
}

.auth-alert {
  background: hsla(0, 70%, 50%, .12);
  border: 1px solid hsla(0, 70%, 50%, .35);
  color: hsl(0, 70%, 55%);
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .9rem;
  margin-bottom: 1rem;
}

html.light .auth-alert {
  color: hsl(0, 65%, 42%);
}

.auth-alert--success {
  background: hsla(140, 45%, 40%, .12);
  border: 1px solid hsla(140, 45%, 40%, .35);
  color: hsl(140, 45%, 38%);
}

html.light .auth-alert--success {
  color: hsl(140, 40%, 32%);
}

.auth-field__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.auth-forgot {
  font-size: .8rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.auth-forgot:hover {
  text-decoration: underline;
}

.auth-submit--link {
  display: block;
  text-align: center;
  text-decoration: none;
}

.auth-hint {
  margin: 0 0 1rem;
  padding: .65rem .85rem;
  border-radius: var(--radius);
  background: hsla(210, 80%, 55%, .1);
  border: 1px solid hsla(210, 80%, 55%, .25);
  color: var(--text-muted);
  font-size: .85rem;
  line-height: 1.5;
}

.auth-hint strong {
  color: var(--text);
}

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

.auth-field {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.auth-field span {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.auth-field input {
  width: 100%;
  padding: .75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--search-bg);
  color: var(--text);
  font: inherit;
  transition: border-color .2s, box-shadow .2s;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px hsla(16, 100%, 60%, .2);
  background: var(--search-focus-bg);
}

.auth-check {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  color: var(--text-muted);
  cursor: pointer;
}

.auth-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
}

.auth-submit {
  margin-top: .25rem;
  padding: .85rem 1rem;
  border-radius: var(--radius);
  border: none;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, filter .15s;
}

.auth-submit:hover {
  filter: brightness(1.05);
}

.auth-submit:active {
  transform: scale(.98);
}

.auth-switch {
  margin-top: 1.15rem;
  text-align: center;
  font-size: .9rem;
  color: var(--text-muted);
}

.auth-switch a {
  color: var(--primary);
  font-weight: 700;
}

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

.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.15rem 0;
  color: var(--text-muted);
  font-size: .85rem;
}

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

.auth-social {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.auth-social__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  width: 100%;
  padding: .75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--search-bg);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  transition: background .2s, border-color .2s, transform .15s;
}

.auth-social__btn:hover {
  background: var(--search-focus-bg);
  border-color: var(--ghost-hover-border);
}

.auth-social__btn:active {
  transform: scale(.98);
}

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

.auth-social__btn--facebook {
  background: #1877f2;
  border-color: #1877f2;
  color: #fff;
}

.auth-social__btn--facebook:hover {
  background: #166fe5;
  border-color: #166fe5;
}

.auth-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.auth-theme {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--text);
  cursor: pointer;
}

.auth-home-link {
  font-size: .875rem;
  color: var(--primary);
  font-weight: 600;
}

.auth-home-link:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .auth-page {
    place-items: start center;
    padding-top: max(.85rem, env(safe-area-inset-top, 0px));
    padding-bottom: max(1.75rem, env(safe-area-inset-bottom, 0px));
  }

  .auth-card {
    margin: 0 0 1rem;
    padding: 1.35rem 1.15rem 1.15rem;
  }

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

  .auth-card__head h1 {
    font-size: 1.3rem;
  }

  .auth-form {
    gap: .85rem;
  }

  .auth-field input {
    padding: .7rem .9rem;
  }

  .auth-submit {
    margin-top: .35rem;
    padding: .8rem 1rem;
  }

  .auth-card__foot {
    margin-top: 1.15rem;
    padding-top: .85rem;
  }
}