/* ═══════════════════════════════════════════════════════
   TANIDIK — Auth Earth Cinematic Intro
   Scoped to body.auth-page only. Safe visual merge.
   ═══════════════════════════════════════════════════════ */

/* ── Page base ── */
body.auth-page {
  background: #000004 !important;
  overflow: hidden;
}

body.auth-page.ae-form-open {
  overflow: auto;
}

/* ───────────────────────────────────────
   FORM ENTRANCE / EXIT
   ae-earth-ready is added by JS when Three.js init succeeds.
   Without it these rules stay dormant — safe fallback.
─────────────────────────────────────── */
body.auth-page.ae-earth-ready .auth-container {
  opacity: 0;
  transform: translateY(22px) scale(0.985);
  pointer-events: none;
  visibility: hidden;
  transition: none;
}

body.auth-page.ae-earth-ready.ae-form-open .auth-container {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  visibility: visible;
  /* 80 ms delay — lets overlay start fading first */
  transition:
    opacity   580ms ease-out   80ms,
    transform 580ms cubic-bezier(0.16, 1, 0.3, 1) 80ms,
    visibility 0ms linear 80ms;
}

/* ───────────────────────────────────────
   FULLSCREEN INTRO OVERLAY
─────────────────────────────────────── */
#ae-intro {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000004;
  /* slightly slower fade so Earth lingers as form comes in */
  transition: opacity 780ms cubic-bezier(0.4, 0, 0.2, 1);
}

#ae-intro.ae-intro--out {
  opacity: 0;
  pointer-events: none;
}

/* ── Three.js canvas ── */
#ae-canvas {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 1;
  display: block;
  transform-origin: center center;
  transition:
    filter    900ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity   900ms ease,
    transform 900ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Cinematic arrival: Earth rushes in before blur-out */
#ae-canvas.ae-canvas--bg {
  filter: blur(18px) brightness(0.11) saturate(0.30);
  opacity: 0.40;
  transform: scale(1.14);
}

/* ───────────────────────────────────────
   HYPERSPEED FLASH — radial light impulse
─────────────────────────────────────── */
.ae-hyperspeed {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(
    ellipse 80% 80% at 50% 50%,
    rgba(200, 220, 255, 0.13) 0%,
    rgba(255, 255, 255, 0.05) 38%,
    transparent 70%
  );
  transform: scale(0.15);
  opacity: 0;
  /* expand outward from center — hyperspeed impulse */
  transition:
    transform 320ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity   320ms ease;
}

.ae-hyperspeed--active {
  transform: scale(3.2);
  opacity: 1;
}

/* fast erase — no spring, just rush through */
.ae-hyperspeed--out {
  transform: scale(5.5);
  opacity: 0;
  transition:
    transform 240ms cubic-bezier(0.55, 0, 1, 0.45),
    opacity   200ms ease-in;
}

/* ── Deep-space vignette ── */
#ae-intro::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(
    ellipse 68% 62% at 50% 50%,
    transparent 18%,
    rgba(0, 0, 0, 0.92) 100%
  );
}

/* ── Noir floor gradient ── */
#ae-intro::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    0deg,
    rgba(0, 0, 4, 0.98) 0%,
    rgba(0, 0, 4, 0.50) 50%,
    transparent 100%
  );
}

/* ───────────────────────────────────────
   GOLD DUST PARTICLES
─────────────────────────────────────── */
.ae-particles {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.ae-particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(240, 192, 96, 0.72);
  box-shadow: 0 0 5px rgba(240, 192, 96, 0.52);
  animation: aePFloat linear infinite;
  pointer-events: none;
  opacity: 0;
}

@keyframes aePFloat {
  0%   { transform: translateY(0) scale(1) translateX(0);       opacity: 0;   }
  8%   {                                                          opacity: 1;   }
  88%  {                                                          opacity: 0.4; }
  100% { transform: translateY(-68vh) scale(0.28) translateX(18px); opacity: 0; }
}

/* ───────────────────────────────────────
   OVERLAY CONTENT — full-screen anchor
   Brand block is flex-centered (Earth center).
   CTA is pinned to bottom independently.
─────────────────────────────────────── */
.ae-overlay-content {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;   /* centers .ae-brand over Earth */
  text-align: center;
  pointer-events: none;
  overflow: hidden;
}

/* ── Brand block ── */
.ae-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-bottom: 0;
}

/* ── Kicker — hidden ── */
.ae-kicker {
  display: none !important;
}

/* ── Main title — metallic gold ── */
.ae-title {
  font-size: clamp(58px, 16vw, 112px);
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  margin: 0;
  /* metallic gold gradient */
  background: linear-gradient(
    160deg,
    #c8941c 0%,
    #f0c060 28%,
    #fffbe8 50%,
    #f0c060 72%,
    #b8780e 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* depth shadow — visible on non-gradient fallback browsers */
  filter: drop-shadow(0 0 32px rgba(240, 192, 96, 0.28))
          drop-shadow(0 2px 24px rgba(0, 0, 0, 0.90));
  opacity: 0;
  transform: translateY(24px) scale(0.95);
  transition:
    opacity   1100ms ease,
    transform 1100ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Subtitle ── */
.ae-sub {
  margin: 10px 0 0;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.36);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity   900ms ease,
    transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Visible state — added by JS ── */
.ae--visible {
  opacity: 1 !important;
  transform: none !important;
  /* restore -webkit-text-fill-color when title becomes visible */
}

/* ───────────────────────────────────────
   CTA BUTTONS — Earth altında, ortalanmış
─────────────────────────────────────── */
.ae-cta {
  pointer-events: auto;
  /* detached from brand block — pinned to bottom of overlay */
  position: absolute;
  bottom: 52px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity   700ms ease,
    transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ae-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
  height: 44px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  outline: none;
  border: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform  260ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 260ms ease,
    opacity    200ms ease;
  position: relative;
  white-space: nowrap;
  min-width: 120px;
}

/* ── Primary — solid metallic gold ── */
.ae-btn--primary {
  background: linear-gradient(
    150deg,
    #e8b020 0%,
    #f5cc55 38%,
    #fde88a 55%,
    #e8b020 100%
  );
  color: #1a0e00;
  box-shadow:
    0  4px 24px rgba(240, 192, 40, 0.38),
    0  1px  6px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(0, 0, 0, 0.20);
}

.ae-btn--primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0  8px 36px rgba(240, 192, 40, 0.54),
    0  2px 12px rgba(0, 0, 0, 0.50),
    inset 0 1px 0 rgba(255, 255, 255, 0.50);
}

.ae-btn--primary:active {
  transform: scale(0.96);
  box-shadow:
    0  2px 12px rgba(240, 192, 40, 0.28),
    inset 0 1px 2px rgba(0, 0, 0, 0.30);
}

/* ── Ghost — dark glass + gold border ── */
.ae-btn--ghost {
  background: rgba(6, 4, 2, 0.60);
  color: rgba(240, 192, 96, 0.75);
  border: 1px solid rgba(240, 192, 96, 0.32);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow:
    0 2px 16px rgba(0, 0, 0, 0.40),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ae-btn--ghost:hover {
  background: rgba(20, 12, 2, 0.72);
  border-color: rgba(240, 192, 96, 0.70);
  color: rgba(245, 204, 112, 0.95);
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 6px 28px rgba(0, 0, 0, 0.50),
    0 0 18px rgba(240, 192, 96, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ae-btn--ghost:active {
  transform: scale(0.96);
  opacity: 0.85;
}

/* ───────────────────────────────────────
   MOBILE  — 431px–600px
─────────────────────────────────────── */
@media (max-width: 600px) {
  .ae-title {
    font-size: clamp(46px, 13vw, 66px);
  }

  .ae-sub {
    font-size: 9px;
    letter-spacing: 0.20em;
    margin-top: 8px;
  }

  .ae-cta {
    bottom: 44px;
    gap: 10px;
  }

  .ae-btn {
    height: 40px;
    padding: 0 26px;
    font-size: 10px;
    min-width: 108px;
  }
}

/* ───────────────────────────────────────
   MOBILE  — 390px–430px (iPhone 14/15, Galaxy S)
─────────────────────────────────────── */
@media (max-width: 430px) {
  .ae-title {
    font-size: clamp(36px, 11vw, 48px) !important;
    letter-spacing: 0.05em;
  }

  .ae-sub {
    font-size: 8px;
    letter-spacing: 0.18em;
    margin-top: 6px;
  }

  .ae-cta {
    bottom: 38px;
    gap: 9px;
  }

  .ae-btn {
    height: 38px;
    padding: 0 22px;
    font-size: 9px;
    min-width: 100px;
  }
}

/* ───────────────────────────────────────
   SHORT SCREENS  — landscape / küçük yükseklik
─────────────────────────────────────── */
@media (max-height: 680px) {
  .ae-title {
    font-size: clamp(28px, 9vw, 44px) !important;
  }

  .ae-sub {
    display: none;
  }

  .ae-cta {
    bottom: 24px;
  }

  .ae-btn {
    height: 34px;
    padding: 0 18px;
    font-size: 9px;
    min-width: 90px;
  }
}

/* ───────────────────────────────────────
   ATMOSPHERE ENTRY GLOW — builds before dive
─────────────────────────────────────── */
.ae-atmos-glow {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  background: radial-gradient(
    ellipse 62% 62% at 50% 50%,
    rgba(77, 178, 255, 0.30) 0%,
    rgba(40, 120, 220, 0.16) 38%,
    rgba(188, 73, 11, 0.07) 60%,
    transparent 72%
  );
  opacity: 0;
  transition: opacity 720ms cubic-bezier(0.4, 0, 0.2, 1);
}

.ae-atmos-glow--active {
  opacity: 1;
}

/* ───────────────────────────────────────
   ZOOM GLOW STREAK — speed-rush feeling
─────────────────────────────────────── */
.ae-zoom-streak {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  background: radial-gradient(
    ellipse 48% 48% at 50% 50%,
    rgba(180, 220, 255, 0.28) 0%,
    rgba(100, 160, 255, 0.12) 36%,
    transparent 62%
  );
  animation: aeZoomStreak 960ms cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes aeZoomStreak {
  0%   { opacity: 0;   transform: scale(0.4);  }
  10%  { opacity: 1;                            }
  100% { opacity: 0;   transform: scale(6.5);  }
}

/* ───────────────────────────────────────
   PREMIUM BLACK-GOLD FORM INPUTS
   Overrides style.css — scoped to auth-page
─────────────────────────────────────── */
body.auth-page .auth-card {
  background:
    linear-gradient(160deg, rgba(255,255,255,0.055), rgba(255,255,255,0.015)),
    rgba(2, 2, 6, 0.90) !important;
  border: 1px solid rgba(240, 192, 96, 0.20) !important;
  box-shadow:
    0 48px 110px rgba(0, 0, 0, 0.78),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 70px rgba(240, 192, 96, 0.07) !important;
  backdrop-filter: blur(32px) !important;
}

body.auth-page .auth-fields label {
  color: rgba(240, 192, 96, 0.58) !important;
  letter-spacing: 0.13em !important;
  font-size: 9px !important;
}

body.auth-page .auth-container input {
  background: rgba(3, 2, 6, 0.82) !important;
  border: 1px solid rgba(240, 192, 96, 0.16) !important;
  border-radius: 12px !important;
  color: rgba(255, 248, 228, 0.90) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 4px 14px rgba(0, 0, 0, 0.45) !important;
  transition:
    border-color 220ms ease,
    background   220ms ease,
    box-shadow   220ms ease !important;
}

body.auth-page .auth-container input::placeholder {
  color: rgba(255, 240, 200, 0.22) !important;
}

body.auth-page .auth-container input:focus {
  border-color: rgba(240, 192, 96, 0.52) !important;
  background: rgba(5, 3, 8, 0.92) !important;
  box-shadow:
    0 0 0 3px rgba(240, 192, 96, 0.09),
    inset 0 1px 0 rgba(240, 192, 96, 0.06),
    0 6px 20px rgba(0, 0, 0, 0.55) !important;
}

/* ───────────────────────────────────────
   REDUCED MOTION
─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ae-kicker,
  .ae-title,
  .ae-sub,
  .ae-cta {
    transition: opacity 300ms ease !important;
    transform: none !important;
  }

  #ae-canvas,
  #ae-intro {
    transition: opacity 300ms ease !important;
    filter: none !important;
    transform: none !important;
  }

  .ae-hyperspeed,
  .ae-zoom-streak {
    display: none !important;
  }

  .ae-particle {
    animation: none !important;
    display: none !important;
  }
}
