body.auth-gate-open {
  overflow: hidden;
}

.auth-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-left))
    max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
}

[data-theme="light"] .auth-gate-overlay {
  background: rgba(15, 15, 15, 0.45);
}

@media (prefers-reduced-motion: reduce) {
  .auth-gate-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(0, 0, 0, 0.78);
  }
}

.auth-gate-overlay.is-open {
  display: flex;
}

.auth-gate-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.auth-gate-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 0;
  background: rgba(0, 0, 0, 0.48);
  color: var(--text-secondary, #cbd5e1);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0;
  z-index: 20;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.auth-gate-close:hover {
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
}

.auth-gate-close-icon {
  display: block;
  width: 18px;
  height: 18px;
}

.auth-gate-logo-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 10px;
  overflow: hidden;
}

.auth-gate-logo {
  width: 180px;
  max-width: 100%;
  height: auto;
  display: block;
}

.auth-gate-modal h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.auth-form input:focus,
.auth-form textarea:focus,
.auth-form input:focus-visible,
.auth-form textarea:focus-visible {
  outline: none;
  border-color: rgba(234, 88, 12, 0.68);
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.18);
  background: #111111;
}

.auth-remember-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 14px;
  font-size: 14px;
  line-height: 1.4;
}

.auth-remember-row input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
  width: 19px;
  height: 19px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.38);
  display: inline-grid;
  place-content: center;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.1s ease;
}

.auth-remember-row input[type="checkbox"]::before {
  content: "";
  width: 12px;
  height: 12px;
  transform: scale(0);
  transition: transform 0.12s ease-in-out;
  box-shadow: inset 1em 1em #ffffff;
  clip-path: polygon(14% 45%, 0 59%, 42% 100%, 100% 20%, 84% 6%, 42% 68%);
}

.auth-remember-row input[type="checkbox"]:hover {
  border-color: rgba(234, 88, 12, 0.72);
  background: rgba(234, 88, 12, 0.06);
}

.auth-remember-row input[type="checkbox"]:checked {
  background: #ea580c;
  border-color: #ea580c;
}

.auth-remember-row input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.auth-remember-row input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.22);
}

.auth-remember-row label {
  cursor: pointer;
  color: var(--text-secondary, #cbd5e1);
  user-select: none;
}

.auth-form-status {
  margin: 6px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.36);
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 4px 12px rgba(2, 8, 23, 0.16);
}

.auth-form-status.is-success {
  border-color: rgba(234, 88, 12, 0.36);
  background: rgba(234, 88, 12, 0.14);
  color: #ffedd5;
}

.auth-form-status.is-error {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.12);
  color: #fee2e2;
}

.auth-form .auth-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  filter: saturate(0.9);
}

.auth-pane {
  opacity: 1;
  transform: translateX(0);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.auth-pane[hidden] {
  display: none !important;
  opacity: 0;
  transform: translateX(8px);
}
