.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 10% 20%, rgba(232, 41, 42, 0.14), transparent 35%),
    radial-gradient(circle at 90% 80%, rgba(74, 158, 255, 0.12), transparent 30%),
    rgba(10, 11, 15, 0.95);
}

.auth-card {
  width: min(460px, 100%);
  background: var(--c-surface);
  border: 1px solid var(--c-border-hi);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 22px;
}

.auth-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  margin: 0 0 8px;
}

.auth-subtitle {
  color: var(--t-secondary);
  font-size: 0.88rem;
  margin: 0 0 16px;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.auth-tab {
  flex: 1;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-surface-2);
  color: var(--t-secondary);
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
}

.auth-tab.active {
  color: var(--t-primary);
  border-color: var(--c-accent);
  box-shadow: 0 0 0 1px rgba(232, 41, 42, 0.3) inset;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-label {
  font-size: 0.76rem;
  color: var(--t-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}

.auth-input {
  background: var(--c-bg-2);
  color: var(--t-primary);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  outline: none;
}

.auth-input:focus {
  border-color: var(--c-accent);
}

.auth-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-msg {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--t-secondary);
  min-height: 20px;
}

.auth-msg.error {
  color: #ff8f8f;
}

.auth-msg.success {
  color: #8fffbf;
}

/* ===== LANDING PAGE ===== */
.auth-landing-gate {
  display: block;
  padding: 0;
  overflow: hidden;
  background: var(--c-bg);
}

.auth-landing {
  position: relative;
  height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 16px clamp(20px, 5vw, 56px) 22px;
  isolation: isolate;
  overflow: hidden;
}

.auth-landing-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 60% 50% at 18% 12%, rgba(232, 41, 42, 0.28), transparent 60%),
    radial-gradient(ellipse 55% 45% at 88% 80%, rgba(74, 158, 255, 0.18), transparent 60%),
    radial-gradient(ellipse 80% 60% at 50% 110%, rgba(255, 74, 28, 0.18), transparent 65%),
    linear-gradient(180deg, #0a0b0f 0%, #0f1117 60%, #0a0b0f 100%);
  animation: authBgShift 18s ease-in-out infinite alternate;
}

.auth-landing-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 80%);
}

@keyframes authBgShift {
  0%   { background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%; }
  100% { background-position: 5% 3%, -4% -2%, 2% -3%, 0% 0%; }
}

/* Topbar */
.auth-landing-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-brand-mark {
  font-size: 1.6rem;
  filter: drop-shadow(0 2px 8px rgba(232, 41, 42, 0.4));
}

.auth-brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--t-primary);
}

.auth-topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.auth-lang-btn {
  font-size: 0.82rem;
  padding: 8px 12px;
  letter-spacing: 0.04em;
  font-weight: 700;
}

/* Hero */
.auth-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 0;
  max-width: 880px;
  margin: 0 auto;
  width: 100%;
  min-height: 0;
}

.auth-hero-eyebrow {
  font-family: var(--font-label);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-accent);
  padding: 5px 12px;
  border: 1px solid rgba(232, 41, 42, 0.4);
  border-radius: var(--r-full);
  background: rgba(232, 41, 42, 0.08);
  margin-bottom: 14px;
}

.auth-hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.7rem, 3.6vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--t-primary);
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.auth-hero-accent {
  background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(232, 41, 42, 0.4));
}

.auth-hero-tagline {
  font-size: clamp(0.9rem, 1.4vw, 1.05rem);
  line-height: 1.5;
  color: var(--t-secondary);
  max-width: 600px;
  margin: 0 0 18px;
}

.auth-cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 10px;
}

.auth-hero-meta {
  font-size: 0.72rem;
  color: var(--t-tertiary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Buttons */
.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 11px 22px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--tr-fast), box-shadow var(--tr-fast), background var(--tr-fast), border-color var(--tr-fast);
  text-decoration: none;
  white-space: nowrap;
}

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

.auth-btn-primary {
  background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-2) 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(232, 41, 42, 0.35);
}

.auth-btn-primary:hover {
  box-shadow: 0 10px 28px rgba(232, 41, 42, 0.5);
}

.auth-btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--t-primary);
  border-color: var(--c-border-hi);
  backdrop-filter: blur(6px);
}

.auth-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

.auth-btn-ghost {
  background: transparent;
  color: var(--t-secondary);
  padding: 10px 16px;
  font-weight: 600;
}

.auth-btn-ghost:hover {
  color: var(--t-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Features */
.auth-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  flex-shrink: 0;
}

.auth-feature {
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.015) 100%);
  border: 1px solid var(--c-border-hi);
  border-radius: var(--r-md);
  padding: 14px 14px;
  transition: transform var(--tr-mid), border-color var(--tr-mid), box-shadow var(--tr-mid);
}

.auth-feature:hover {
  transform: translateY(-2px);
  border-color: rgba(232, 41, 42, 0.35);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(232, 41, 42, 0.15);
}

.auth-feature-icon {
  font-size: 1.4rem;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.auth-feature-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--t-primary);
  margin-bottom: 4px;
}

.auth-feature-desc {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--t-secondary);
}

/* ===== AUTH MODAL (login / signup notice) ===== */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99995;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 6, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: authModalFadeIn 0.18s ease;
}

@keyframes authModalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.auth-modal {
  position: relative;
  width: min(440px, 100%);
  background: var(--c-surface);
  border: 1px solid var(--c-border-hi);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(232, 41, 42, 0.08);
  padding: 28px 26px 24px;
  animation: authModalIn 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes authModalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  border: 0;
  background: transparent;
  color: var(--t-secondary);
  font-size: 1rem;
  cursor: pointer;
  transition: background var(--tr-fast), color var(--tr-fast);
}

.auth-modal-close:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--t-primary);
}

.auth-modal-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  margin: 0 0 6px;
  color: var(--t-primary);
}

.auth-modal-subtitle {
  color: var(--t-secondary);
  font-size: 0.9rem;
  margin: 0 0 18px;
  line-height: 1.5;
}

.auth-modal-text {
  color: var(--t-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0;
}

.auth-modal-notice {
  text-align: center;
}

.auth-notice-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  border-radius: var(--r-full);
  background: rgba(245, 200, 66, 0.12);
  border: 1px solid rgba(245, 200, 66, 0.3);
}

/* Tablet: 2x2 features grid */
@media (max-width: 900px) {
  .auth-features { grid-template-columns: repeat(2, 1fr); }
}

/* Short viewports: allow scroll */
@media (max-height: 680px) {
  .auth-landing-gate { overflow-y: auto; }
  .auth-landing { height: auto; min-height: 100vh; overflow: visible; }
}

/* Mobile tweaks */
@media (max-width: 640px) {
  .auth-landing-gate { overflow-y: auto; }
  .auth-landing { height: auto; min-height: 100vh; overflow: visible; padding: 18px 18px 28px; }
  .auth-cta-row { flex-direction: column; width: 100%; max-width: 320px; }
  .auth-cta-row .auth-btn { width: 100%; }
  .auth-features { grid-template-columns: 1fr; gap: 10px; }
  .auth-brand-name { display: none; }
}
