/* Auth feedback and gate styles extracted from styles.css.
   Load after settings styles so the gated settings auth panel keeps its modal overrides. */

#settings .auth-form .error {
  display: none;
}

.auth-feedback-popup {
  left: 50%;
  right: auto;
  bottom: 28px;
  transform: translateX(-50%);
  width: min(480px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  z-index: 140;
}

[data-theme='dark'] .auth-feedback-popup {
  background: linear-gradient(
      180deg,
      rgba(17, 24, 38, 0.96),
      rgba(11, 17, 28, 0.94)
    ),
    rgba(14, 18, 29, 0.96);
  border-color: rgba(118, 146, 201, 0.18);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

@media (max-width: 880px) {
  .auth-feedback-popup {
    left: 16px;
    right: 16px;
    bottom: 18px;
    width: auto;
    max-width: none;
    transform: none;
  }
}

body.auth-gate-open {
  overflow: hidden;
}
.auth-gate-overlay {
  z-index: 160;
  padding: 20px 16px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}
.auth-gate-overlay:not(.hidden) {
  visibility: visible;
}
.auth-gate-overlay.is-open {
  opacity: 1;
}
.auth-gate-overlay .auth-gate-card {
  transform: translateY(16px) scale(0.988);
  opacity: 0;
  transition:
    transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.24s ease;
}
.auth-gate-overlay.is-open .auth-gate-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.auth-gate-card {
  width: min(440px, calc(100vw - 32px));
  max-height: min(90vh, 880px);
  overflow: auto;
  gap: 18px;
  padding: 26px 24px 22px;
  border-radius: 24px;
  text-align: left;
}
.auth-gate-card .delete-account-title {
  text-align: center;
  font-size: 20px;
  line-height: 1.25;
}
.auth-gate-card .delete-account-message:not(.hidden) {
  text-align: center;
  margin: -6px 0 0;
  padding: 0 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.auth-gate-panel-host {
  width: 100%;
}
.auth-gate-panel-host #settingsAuthPanel {
  width: 100%;
  max-width: none;
  box-shadow: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
}
.auth-gate-panel-host #authPanelHeader {
  display: none;
}
.auth-gate-panel-host .auth-form {
  width: 100%;
  max-width: none;
  margin: 0;
  gap: 14px;
}
.auth-gate-panel-host .auth-form .settings-form-grid,
.auth-gate-panel-host .auth-form .auth-actions,
.auth-gate-panel-host .auth-form .auth-provider-block .settings-provider-grid {
  grid-template-columns: 1fr;
}
/* Register inside the gate: one email field, logical order, no middle name. */
.auth-gate-panel-host .auth-form.is-register-mode .auth-login-only {
  display: none !important;
}
.auth-gate-panel-host .auth-form.is-register-mode .settings-form-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-gate-card:has(.auth-form.is-register-mode) {
  width: min(440px, calc(100vw - 32px));
}
.auth-gate-panel-host .auth-actions {
  gap: 10px;
  margin-top: 2px;
}
.auth-gate-panel-host .auth-form:not(.is-register-mode) #authLogin {
  order: 0;
}
.auth-gate-panel-host .auth-form:not(.is-register-mode) #authRegister {
  order: 1;
}
.auth-gate-panel-host .auth-divider {
  margin: 10px 0 2px;
  font-size: 10px;
  letter-spacing: 0.14em;
}
.auth-gate-panel-host .auth-provider-block {
  margin-top: 0;
}
.auth-gate-panel-host .settings-provider-grid {
  gap: 10px;
}
.auth-gate-panel-host .provider-button,
.auth-gate-panel-host .google-button {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
}
.auth-gate-panel-host .provider-google-wrap {
  width: 100%;
}
.auth-gate-panel-host .google-button > div {
  width: 100% !important;
}
.auth-gate-panel-host #authError,
.auth-gate-panel-host #authInfo {
  margin: 0;
  font-size: 12px;
  text-align: center;
}
.auth-gate-panel-host #authError:empty,
.auth-gate-panel-host #authInfo:empty {
  display: none;
}
.auth-gate-close {
  width: 100%;
  margin-top: 6px;
  min-height: 44px;
  border-radius: 14px;
  background: transparent;
  color: var(--ink-soft);
  border-color: rgba(126, 151, 193, 0.32);
  box-shadow: none;
}
.auth-gate-close:hover {
  background: rgba(126, 151, 193, 0.08);
}
[data-theme='dark'] .auth-gate-card {
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
[data-theme='dark'] .auth-gate-close {
  border-color: rgba(148, 163, 184, 0.28);
  color: rgba(226, 232, 240, 0.88);
}

@media (prefers-reduced-motion: reduce) {
  .auth-gate-overlay,
  .auth-gate-overlay .auth-gate-card {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
