/* AlgoTree — 3D auth pages (signup / login) */

.auth-page {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 420px);
  min-height: 100vh;
  padding-top: 4.5rem;
  overflow: hidden;
  background: var(--bg-deep);
}

.auth-scene {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  perspective: 1200px;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: calc(100vh - 4.5rem);
}

.auth-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 30% 20%, rgba(0, 229, 160, 0.12), transparent 55%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(34, 211, 238, 0.1), transparent 50%),
    radial-gradient(ellipse 40% 30% at 70% 30%, rgba(167, 139, 250, 0.08), transparent 45%);
  pointer-events: none;
}

.auth-grid-floor {
  position: absolute;
  bottom: 8%;
  left: 50%;
  width: 140%;
  height: 55%;
  transform: translateX(-50%) rotateX(72deg);
  transform-origin: center bottom;
  background-image:
    linear-gradient(rgba(0, 229, 160, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 160, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black, transparent 75%);
  pointer-events: none;
  opacity: 0.6;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  animation: auth-float 8s ease-in-out infinite;
}

.auth-orb-1 {
  width: 280px;
  height: 280px;
  background: rgba(0, 229, 160, 0.18);
  top: 12%;
  left: 8%;
}

.auth-orb-2 {
  width: 220px;
  height: 220px;
  background: rgba(34, 211, 238, 0.14);
  bottom: 18%;
  right: 12%;
  animation-delay: -3s;
}

@keyframes auth-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-18px) scale(1.03); }
}

.auth-stack {
  position: relative;
  width: min(500px, 92%);
  transform-style: preserve-3d;
  transform: rotateY(-10deg) rotateX(5deg);
  animation: auth-tilt 10s ease-in-out infinite;
  z-index: 2;
}

@keyframes auth-tilt {
  0%, 100% { transform: rotateY(-10deg) rotateX(5deg) translateY(0); }
  50% { transform: rotateY(-6deg) rotateX(3deg) translateY(-8px); }
}

.auth-visual-card {
  position: relative;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(8, 14, 28, 0.92));
  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 229, 160, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
  backface-visibility: hidden;
}

.auth-visual-card-main {
  transform: translateZ(36px);
  z-index: 3;
}

.auth-visual-card-back {
  position: absolute;
  top: -10%;
  right: -7%;
  width: 74%;
  opacity: 0.5;
  transform: translateZ(-24px) rotateY(-3deg);
  z-index: 1;
  pointer-events: none;
}

.auth-visual-card-side {
  position: absolute;
  bottom: -8%;
  left: -5%;
  width: 60%;
  opacity: 0.42;
  transform: translateZ(8px) rotateY(6deg);
  z-index: 2;
  pointer-events: none;
}

.auth-mockup-bar {
  display: flex;
  gap: 0.35rem;
  padding: 0.65rem 0.85rem 0;
}

.auth-mockup-bar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.35);
}

.auth-mockup-bar span:first-child { background: #f87171; opacity: 0.85; }
.auth-mockup-bar span:nth-child(2) { background: #fbbf24; opacity: 0.85; }
.auth-mockup-bar span:nth-child(3) { background: #34d399; opacity: 0.85; }

.auth-chart-area {
  min-height: 200px;
  background: #070f1f;
  line-height: 0;
}

.auth-chart-area-mini {
  min-height: 120px;
}

.auth-chart-svg,
.auth-chart-area svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 160px;
}

.auth-chart-area-mini .auth-chart-svg,
.auth-chart-area-mini svg {
  min-height: 100px;
}

.auth-mockup-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

.auth-mockup-stats > div {
  text-align: center;
  padding: 0.45rem 0.25rem;
  border-radius: 8px;
  background: rgba(0, 229, 160, 0.06);
  border: 1px solid rgba(0, 229, 160, 0.12);
}

.auth-mockup-stats .val {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--emerald);
}

.auth-mockup-stats .lbl {
  font-size: 0.62rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-visual-caption {
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-visual-caption strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.92rem;
  margin-bottom: 0.2rem;
  color: var(--text);
}

.auth-visual-caption span {
  font-size: 0.76rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.auth-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
  justify-content: center;
  transform: translateZ(24px);
}

.auth-pill {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 160, 0.25);
  background: rgba(0, 229, 160, 0.08);
  color: var(--emerald);
}

.auth-social-proof {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(8, 14, 28, 0.75);
  backdrop-filter: blur(12px);
  max-width: min(420px, 92%);
}

.auth-social-proof-text p {
  margin: 0.1rem 0 0;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.auth-testimonials {
  position: relative;
  z-index: 2;
  width: min(480px, 92%);
}

.auth-testimonials-label {
  margin: 0 0 0.65rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
}

.auth-testimonials-track {
  position: relative;
  min-height: 148px;
}

.auth-testimonial {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(8, 14, 28, 0.82);
  backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.auth-testimonial.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  position: relative;
}

.auth-testimonial-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  flex-shrink: 0;
}

.auth-testimonial-body strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 0.1rem;
}

.auth-testimonial-role {
  display: block;
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-bottom: 0.45rem;
}

.auth-testimonial-body p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.55;
  font-style: italic;
}

.auth-testimonials-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.auth-tdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(148, 163, 184, 0.35);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.auth-tdot.active {
  background: var(--emerald);
  transform: scale(1.15);
}

/* Form card */
.auth-aside {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: linear-gradient(180deg, rgba(8, 14, 28, 0.6), rgba(3, 7, 18, 0.95));
  border-left: 1px solid var(--border);
  position: relative;
  z-index: 2;
}

.auth-card {
  width: 100%;
  max-width: 380px;
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  margin: 0 0 0.35rem;
  line-height: 1.2;
}

.auth-card-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 0.9rem;
}

.auth-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.auth-field input,
.auth-field select {
  width: 100%;
  padding: 0.72rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(5, 11, 24, 0.9);
  color: var(--text);
  font-size: 0.92rem;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-field input:focus,
.auth-field select:focus {
  outline: none;
  border-color: rgba(0, 229, 160, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 229, 160, 0.1);
}

.auth-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-submit {
  width: 100%;
  margin-top: 0.35rem;
}

.auth-status {
  font-size: 0.82rem;
  min-height: 1.2rem;
  line-height: 1.45;
  word-wrap: break-word;
}

.auth-status.ok { color: var(--emerald); }
.auth-status.err { color: #f87171; }

.auth-foot {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.55;
}

.auth-foot a {
  color: var(--emerald);
  font-weight: 500;
}

.auth-success {
  text-align: center;
  padding: 0.5rem 0;
}

.auth-success.hidden { display: none !important; }

.auth-success-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.85rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 229, 160, 0.15);
  border: 1px solid rgba(0, 229, 160, 0.35);
  color: var(--emerald);
  font-size: 1.25rem;
}

.auth-form.hidden,
.auth-card-sub.hidden { display: none !important; }

.auth-secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1rem;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.auth-secure-note::before {
  content: "🔒";
  font-size: 0.75rem;
}

.auth-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0.75rem 0;
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.auth-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1200px, 92vw);
  margin: 0 auto;
}

@media (max-width: 900px) {
  .auth-page {
    grid-template-columns: 1fr;
    padding-top: 5rem;
    min-height: auto;
  }

  .auth-scene {
    min-height: auto;
    padding: 1rem 1rem 0.5rem;
    justify-content: flex-start;
  }

  .auth-stack {
    transform: perspective(900px) rotateY(0deg) rotateX(4deg) scale(0.94);
    transform-origin: center center;
    animation: none;
    width: min(440px, 96%);
  }

  .auth-visual-card-back,
  .auth-visual-card-side {
    display: none;
  }

  .auth-chart-area {
    min-height: 170px;
  }

  .auth-pills {
    margin-top: 0.75rem;
  }

  .auth-social-proof {
    margin-top: 0.25rem;
  }

  .auth-testimonials-track {
    min-height: 160px;
  }

  .auth-aside {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-bottom: 2.5rem;
  }
}

@media (max-width: 480px) {
  .auth-social-proof {
    flex-direction: column;
    border-radius: var(--radius);
    text-align: center;
  }

  .auth-testimonial {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .auth-testimonial-avatar {
    margin: 0 auto;
  }
}

@media (hover: none), (pointer: coarse) {
  .auth-stack {
    transform: perspective(900px) rotateY(0deg) rotateX(2deg) scale(0.96);
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-stack,
  .auth-orb,
  .auth-testimonial {
    animation: none;
    transition: none;
  }
}
