/* ================================================================
   AUTH PAGES — Login / Register (BLOB SLIDE MORPH)
   Cyberpunk neon theme
   ================================================================ */

@keyframes authBorderRun {
  0%   { border-color: #00f2ff; box-shadow: 0 0 45px rgba(0,242,255,0.55), inset 0 0 25px rgba(0,242,255,0.15); }
  25%  { border-color: #ff2d55; box-shadow: 0 0 45px rgba(255,45,85,0.55), inset 0 0 25px rgba(255,45,85,0.15); }
  50%  { border-color: #00ff88; box-shadow: 0 0 45px rgba(0,255,136,0.55), inset 0 0 25px rgba(0,255,136,0.15); }
  75%  { border-color: #a855f7; box-shadow: 0 0 45px rgba(168,85,247,0.55), inset 0 0 25px rgba(168,85,247,0.15); }
  100% { border-color: #00f2ff; box-shadow: 0 0 45px rgba(0,242,255,0.55), inset 0 0 25px rgba(0,242,255,0.15); }
}

@keyframes glowPulseAuth {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%       { opacity: 1; transform: scale(1.1); }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05060a;
  font-family: 'Segoe UI', sans-serif;
  color: #e0fbfc;
  position: relative;
  overflow: hidden;
  padding: 20px;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(0,242,255,0.06), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(168,85,247,0.06), transparent 40%);
  pointer-events: none;
}

/* ================================================================
   MAIN CONTAINER
   ================================================================ */
.auth-container {
  position: relative;
  width: 100%;
  max-width: 960px;
  min-height: 560px;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(10,12,18,0.92);
  border: 1.5px solid #00f2ff;
  animation: authBorderRun 3.5s linear infinite;
  backdrop-filter: blur(20px);
  box-shadow: 0 25px 80px rgba(0,0,0,0.6);
}

/* ================================================================
   FORM PANELS (slide left <-> right, hidden behind blob)
   ================================================================ */
.form-panel {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  display: flex;
  align-items: center;
  transition: transform 0.75s cubic-bezier(0.65, 0, 0.35, 1),
              opacity 0.5s ease;
}

.login-panel {
  z-index: 3;
  transform: translateX(0);
  opacity: 1;
}

.register-panel {
  z-index: 1;
  transform: translateX(0);
  opacity: 0;
  pointer-events: none;
}

.auth-container.is-active .login-panel {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

.auth-container.is-active .register-panel {
  transform: translateX(-100%);
  opacity: 1;
  z-index: 5;
  pointer-events: auto;
}

.auth-right {
  width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 50px 45px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,242,255,0.3) transparent;
}

.register-panel .auth-right {
  justify-content: flex-start;
  padding-top: 34px;
  padding-bottom: 34px;
}

/* ================================================================
   OVERLAY / BLOB PANEL — the piece that morphs + slides
   ================================================================ */
.overlay-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  z-index: 100;
  border-radius: 0 150px 150px 0;
  transition: transform 0.75s cubic-bezier(0.65, 0, 0.35, 1),
              border-radius 0.75s cubic-bezier(0.65, 0, 0.35, 1);
}

.auth-container.is-active .overlay-container {
  transform: translateX(100%);
  border-radius: 150px 0 0 150px;
}

.overlay {
  position: relative;
  left: 0;
  width: 200%;
  height: 100%;
  display: flex;
  background: linear-gradient(135deg, #00f2ff 0%, #a855f7 55%, #ff2d55 100%);
  background-size: 200% 200%;
  animation: overlayGradientShift 6s ease-in-out infinite;
  transform: translateX(0);
  transition: transform 0.75s cubic-bezier(0.65, 0, 0.35, 1);
}

@keyframes overlayGradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.auth-container.is-active .overlay {
  transform: translateX(-50%);
}

.overlay-panel {
  position: relative;
  width: 50%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 45px;
  transition: transform 0.75s cubic-bezier(0.65, 0, 0.35, 1);
}

.overlay-left  { transform: translateX(-20%); }
.overlay-right { transform: translateX(0); }

.auth-container.is-active .overlay-left  { transform: translateX(0); }
.auth-container.is-active .overlay-right { transform: translateX(20%); }

.overlay-glow {
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(255,255,255,0.35), transparent 70%);
  animation: glowPulseAuth 4s ease-in-out infinite;
  pointer-events: none;
}

.overlay-panel .brand-inline {
  margin-bottom: 22px;
  gap: 14px;
}

.overlay-panel .brand-inline .auth-logo {
  height: 64px;
}

.overlay-panel .brand-inline .auth-logo-text {
  font-size: 1.4rem;
  color: #fff;
  text-shadow: 0 0 12px rgba(255,255,255,0.6);
}

.overlay-panel h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  text-shadow: 0 0 18px rgba(255,255,255,0.5);
}

.overlay-panel p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 26px;
  max-width: 260px;
  line-height: 1.5;
}

.overlay-panel .auth-btn-outline {
  border-color: #fff;
  color: #fff;
}

.overlay-panel .auth-btn-outline:hover {
  background: rgba(255,255,255,0.18);
  box-shadow: 0 0 20px rgba(255,255,255,0.5);
  color: #fff;
}

/* ================================================================
   BRAND LOGO — inline, sits below the title, bigger + responsive
   ================================================================ */
.brand-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.auth-logo { height: 38px; width: auto; display: block; }

.auth-logo-text {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #00f2ff;
  text-shadow: 0 0 14px rgba(0,242,255,0.6);
}

/* ================================================================
   BUTTONS
   ================================================================ */
.auth-btn-outline {
  padding: 10px 30px;
  background: transparent;
  border: 1.5px solid #ff2d55;
  color: #ff2d55;
  border-radius: 50px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* ================================================================
   FORM ELEMENTS
   ================================================================ */
.auth-title {
  font-size: 1.9rem;
  font-weight: 800;
  color: #00f2ff;
  text-shadow: 0 0 15px rgba(0,242,255,0.5);
  margin-bottom: 6px;
}

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

.auth-error {
  background: rgba(255,45,85,0.1);
  border: 1px solid rgba(255,45,85,0.4);
  color: #ff2d55;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  margin-bottom: 14px;
}

@keyframes fieldFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-form.field-in > * {
  animation: fieldFadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-form.field-in > *:nth-child(1) { animation-delay: 0.05s; }
.auth-form.field-in > *:nth-child(2) { animation-delay: 0.11s; }
.auth-form.field-in > *:nth-child(3) { animation-delay: 0.17s; }
.auth-form.field-in > *:nth-child(4) { animation-delay: 0.23s; }
.auth-form.field-in > *:nth-child(5) { animation-delay: 0.29s; }
.auth-form.field-in > *:nth-child(6) { animation-delay: 0.35s; }
.auth-form.field-in > *:nth-child(7) { animation-delay: 0.41s; }

.auth-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(0,242,255,0.25);
  border-radius: 10px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.auth-input-group:focus-within {
  border-color: #00f2ff;
  box-shadow: 0 0 15px rgba(0,242,255,0.25);
}

.auth-icon { font-size: 1rem; opacity: 0.8; }

.auth-input-group input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #e0fbfc;
  font-size: 0.9rem;
}

.auth-input-group input::placeholder { color: rgba(224,251,252,0.35); }

.auth-forgot {
  align-self: flex-end;
  font-size: 0.78rem;
  color: rgba(224,251,252,0.5);
  text-decoration: none;
  margin-top: -4px;
}
.auth-forgot:hover { color: #00f2ff; }

.auth-btn-solid {
  margin-top: 8px;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, #00f2ff, #a855f7);
  color: #05060a;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-btn-solid:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,242,255,0.35);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 18px;
  color: rgba(224,251,252,0.4);
  font-size: 0.78rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(0,242,255,0.15);
}

.auth-social-row {
  display: flex;
  gap: 14px;
  justify-content: center;
}

.auth-social-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(0,242,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.auth-social-btn img { width: 20px; height: 20px; }

.auth-social-btn:hover {
  border-color: #00f2ff;
  box-shadow: 0 0 15px rgba(0,242,255,0.35);
  transform: translateY(-3px);
}

/* ================================================================
   EMAIL OTP FLOW (Registration)
   ================================================================ */
.otp-trigger-group { padding-right: 8px; }

.otp-send-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  border: 1px solid rgba(0,242,255,0.5);
  background: rgba(0,242,255,0.08);
  color: #00f2ff;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.otp-send-btn:hover:not(:disabled) {
  background: rgba(0,242,255,0.18);
  box-shadow: 0 0 14px rgba(0,242,255,0.4);
}

.otp-send-btn:disabled {
  cursor: default;
  opacity: 0.75;
  border-color: rgba(0,255,136,0.5);
  color: #00ff88;
}

.otp-group {
  max-height: 0;
  opacity: 0;
  padding: 0 16px;
  margin-top: 0;
  border-width: 0;
  overflow: hidden;
  transform: translateY(-8px);
  transition: max-height 0.5s cubic-bezier(0.65,0,0.35,1),
              opacity 0.4s ease,
              padding 0.5s cubic-bezier(0.65,0,0.35,1),
              transform 0.4s ease,
              border-width 0.4s ease;
}

.otp-group.show {
  max-height: 60px;
  opacity: 1;
  padding: 12px 16px;
  border-width: 1px;
  transform: translateY(0);
}

.otp-group input {
  letter-spacing: 4px;
  font-weight: 700;
}

.otp-resend {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: rgba(224,251,252,0.4);
  white-space: nowrap;
  cursor: default;
  transition: color 0.3s ease;
}

.otp-resend.active {
  color: #ff2d55;
  cursor: pointer;
  text-decoration: underline;
}

.otp-hint {
  font-size: 0.72rem;
  color: rgba(224,251,252,0.45);
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.4s ease, margin-top 0.4s ease;
}

.otp-hint.show {
  max-height: 40px;
  opacity: 1;
  margin-top: -8px;
}

/* ================================================================
   FIRST NAME / LAST NAME ROW
   ================================================================ */
.auth-name-row {
  display: flex;
  gap: 12px;
}

.auth-name-row .auth-input-group { flex: 1; min-width: 0; }

/* ================================================================
   FORGOT PASSWORD MODAL
   ================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2,3,6,0.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.forgot-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 40px 36px;
  border-radius: 20px;
  background: rgba(10,12,18,0.96);
  border: 1.5px solid #00f2ff;
  box-shadow: 0 0 45px rgba(0,242,255,0.4), 0 25px 80px rgba(0,0,0,0.6);
  backdrop-filter: blur(20px);
  transform: scale(0.9) translateY(10px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
}

.modal-overlay.show .forgot-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(0,242,255,0.3);
  background: rgba(255,255,255,0.04);
  color: #e0fbfc;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-close:hover {
  border-color: #ff2d55;
  color: #ff2d55;
  box-shadow: 0 0 14px rgba(255,45,85,0.4);
}

.forgot-sub {
  font-size: 0.85rem;
  color: rgba(224,251,252,0.6);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ================================================================
   RESPONSIVE — mobile pe simple stacked toggle
   FIX: overlay-container ab fixed 200px height ki jagah content ke
   hisaab se naturally grow karta hai (position: relative, height: auto),
   isliye "Welcome Back" / "Hello Welcome" blob ka text/button ab kabhi
   cut/clip nahi hoga chahe wrap ho ke 2-3 lines ban jaaye.
   ================================================================ */
@media (max-width: 900px) {
  .auth-container {
    min-height: auto;
    display: flex;
    flex-direction: column;
  }

  .form-panel {
    position: relative;
    left: 0;
    width: 100%;
    height: auto;
    transform: none !important;
    display: none;
    opacity: 1 !important;
    padding-top: 0;
  }

  .login-panel { display: flex; }
  .auth-container.is-active .login-panel { display: none; }
  .auth-container.is-active .register-panel { display: flex; }

  .overlay-container {
    position: relative;
    top: auto; left: auto;
    width: 100%;
    height: auto;
    overflow: visible;
    border-radius: 0 0 40px 40px;
    transform: none !important;
    order: -1; /* blob always on top, forms below it on mobile */
  }

  .auth-container.is-active .overlay-container {
    border-radius: 0 0 40px 40px;
  }

  .overlay {
    width: 100%;
    left: 0;
    flex-direction: row;
    height: auto;
  }
  .auth-container.is-active .overlay { transform: none; }

  .overlay-left, .overlay-right {
    width: 100%;
    display: none;
    padding: 28px 24px;
  }
  .overlay-left { display: flex; transform: none !important; }
  .auth-container.is-active .overlay-left { display: none; }
  .auth-container.is-active .overlay-right { display: flex; transform: none !important; }

  .overlay-panel .brand-inline {
    flex-wrap: wrap;
    justify-content: center;
  }
  .overlay-panel .brand-inline .auth-logo { height: 48px; }
  .overlay-panel .brand-inline .auth-logo-text { font-size: 1.15rem; }

  .overlay-panel h2 { font-size: 1.4rem; }
  .overlay-panel p { font-size: 0.8rem; margin-bottom: 14px; max-width: 320px; }
  /* overlay-panel ki 100% height base CSS se aa rahi thi — parent ab
     auto-height hai isliye 100% = 0px ban raha tha, isliye content
     collapse/cut ho raha tha. Yahan explicitly auto + proper padding
     diya taaki content apni natural height le sake. */
  .overlay-panel {
    height: auto;
    min-height: 0;
    padding: 32px 24px 40px;
  }

  .overlay {
    height: auto;
    align-items: stretch;
  }

  .auth-right { padding: 30px; }
  .auth-container {
    overflow: visible;
  }
}

@media (max-width: 480px) {
  .auth-name-row { flex-direction: column; gap: 16px; }
  .forgot-card { padding: 32px 24px; }

  .overlay-panel .brand-inline .auth-logo { height: 38px; }
  .overlay-panel .brand-inline .auth-logo-text { font-size: 1rem; }
  .overlay-panel h2 { font-size: 1.2rem; }
  .overlay-panel p { font-size: 0.76rem; }
  .overlay-panel { padding: 22px 18px; }
}