/* ==========================================================================
   Shared Auth Layout — Login / Signup / Reset Password
   ========================================================================== */

* { box-sizing: border-box; }

.auth-page {
  display: flex; flex-direction: row; align-items: stretch;
  padding: 0; width: 100%; height: 100vh; overflow: hidden;
}

/* Left side */
.auth-left {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 0 128px; gap: 10px;
  width: 720px; flex-grow: 1;
}

.auth-inner {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 0 4px; gap: 32px;
  width: 464px; height: 100%;
}

.auth-header {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 0; gap: 8px; width: 100%;
}

.auth-logo {
  width: 36px; height: 36px; object-fit: contain;
}

.auth-fields {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 0; gap: 24px; width: 100%;
}

.auth-field-group {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 0; gap: 8px; width: 100%;
}

.auth-password-row {
  display: flex; flex-direction: row; justify-content: space-between; align-items: center;
  padding: 0; gap: 10px; width: 100%;
}

/* Input */
.auth-input {
  display: flex; flex-direction: row; justify-content: space-between; align-items: center;
  padding: 12px 16px; gap: 10px;
  width: 100%; height: 56px;
  background: #111214; border: 1px solid #252629; border-radius: 12px;
  font-family: 'Inter', sans-serif; font-weight: 400; font-size: 16px; line-height: 20px;
  color: #F0F1F3; outline: none; transition: border-color 0.15s;
}
.auth-input::placeholder { color: #4D4F55; }
.auth-input:focus { border-color: #6B6D75; }

/* Primary button */
.auth-primary-btn {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 16px 32px; width: 100%; height: 56px;
  background: linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0) 100%), #155EFD;
  box-shadow: 0px 1px 2px rgba(14,18,27,0.24), 0px 0px 0px 1px #3473FD;
  border-radius: 12px; border: none; cursor: pointer;
  font-family: 'Inter', sans-serif; font-weight: 400; font-size: 16px; line-height: 20px; color: #FFFFFF;
  transition: background 0.15s;
}
.auth-primary-btn:hover { background: linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.11) 100%), #0850DE; }
.auth-primary-btn:disabled { color: #5A7BFE; cursor: not-allowed; }

/* Divider */
.auth-divider {
  display: flex; flex-direction: row; align-items: center;
  padding: 0; gap: 16px; width: 100%;
}
.auth-divider-line { flex: 1; height: 0; border: none; border-top: 1px solid #252629; }

/* Secondary button (Google) */
.auth-secondary-btn {
  display: flex; flex-direction: row; justify-content: center; align-items: center;
  padding: 16px 32px; gap: 12px;
  width: 100%; height: 56px;
  background: #111214; border: 1px solid #252629;
  box-shadow: inset 0px 1px 2px rgba(255,255,255,0.04), inset 0px 0px 6px rgba(255,255,255,0.06);
  border-radius: 10px; cursor: pointer;
  font-family: 'Inter', sans-serif; font-weight: 400; font-size: 16px; line-height: 20px; color: #FFFFFF;
  transition: background 0.15s;
}
.auth-secondary-btn:hover { background: #1A1B1E; }

/* Eye button */
.auth-eye-btn {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 0;
}

/* Right side */
.auth-right { width: 50%; height: 100%; padding: 32px; }

.auth-right-panel {
  width: 100%; height: 100%;
  background: #090909; border: 1px solid rgba(255,255,255,0.1); border-radius: 25px;
  padding: 32px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}

.auth-glow {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 656px; height: 148px;
  background: #053EB1; filter: blur(218px); border-radius: 50%;
  pointer-events: none;
}

/* Step indicators */
.auth-steps { display: flex; align-items: center; gap: 8px; }
.auth-step { width: 63px; height: 6px; border-radius: 100px; background: #011750; }
.auth-step-active { background: #053EB1; }

/* OTP input group */
.auth-otp-group {
  display: flex; flex-direction: row; align-items: center;
  border: 1px solid #252629; border-radius: 12px; overflow: hidden;
}
.auth-otp-input {
  width: 60px; height: 60px; border: none; border-left: 1px solid #252629;
  background: transparent; text-align: center; outline: none;
  font-family: 'Inter', sans-serif; font-weight: 400; font-size: 16px; line-height: 20px;
  color: #F0F1F3;
}
.auth-otp-input:first-child { border-left: none; }
.auth-otp-input::placeholder { color: #4D4F55; }

/* Back button */
.auth-back-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid #252629; background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #F0F1F3; transition: background 0.15s;
}
.auth-back-btn:hover { background: #1A1B1E; }

/* Spinner (loading indicator) */
.auth-spinner { animation: auth-spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* Plan card */
.auth-plan-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; width: 100%;
  background: #111214; border: 1px solid #252629; border-radius: 12px;
  cursor: pointer; transition: border-color 0.15s;
}
.auth-plan-card:hover { border-color: #33353A; }
.auth-plan-card.selected { border-color: #155EFD; }

/* Plan toggle */
.auth-plan-toggle {
  display: flex; align-items: center; gap: 0;
  background: #111214; border: 1px solid #252629; border-radius: 100px;
  padding: 2px; overflow: hidden;
}
.auth-plan-toggle-btn {
  padding: 6px 16px; border: none; border-radius: 100px; cursor: pointer;
  font-family: 'Inter', sans-serif; font-weight: 500; font-size: 12px; line-height: 16px;
  color: #6B6D75; background: transparent; transition: all 0.15s;
}
.auth-plan-toggle-btn.active { background: #155EFD; color: #FFFFFF; }

/* Responsive */
@media (max-width: 1023px) {
  .auth-left { width: 100%; padding: 40px 24px; }
  .auth-inner { width: 100%; max-width: 464px; }
  .auth-right { display: none; }
}

/* ==========================================================================
   GSAP motion (auth-motion.js)
   ==========================================================================
   `auth-motion-armed` is set on <html> by auth/_motion_head.html before first
   paint and removed by auth-motion.js the moment it has written the same
   hidden state to inline styles — so the intro timeline starts from black
   instead of flashing the finished layout. A failsafe in the head snippet
   removes it if GSAP never arrives, and it is never set at all under
   prefers-reduced-motion. */
html.auth-motion-armed .auth-inner > *,
html.auth-motion-armed .auth-right-panel { opacity: 0; }

/* Focus/typing chrome for the animated OTP group. The two overlay elements are
   injected by auth-motion.js, so they only exist when motion is on. Colours are
   brand tokens only: rgba(21,94,253) is #155EFD (.ds-accent-500, the primary
   button and the design system's input-focus colour); the sweep is a plain
   white sheen. */
.auth-otp-group.auth-otp-animated,
.ds-input-otp-group.auth-otp-animated { position: relative; }

.auth-otp-cursor {
  position: absolute; top: 0; left: 0; height: 100%; width: 60px;
  pointer-events: none; border-radius: 10px;
  background: radial-gradient(120% 130% at 50% 100%, rgba(21,94,253,0.22) 0%, rgba(21,94,253,0) 72%);
  box-shadow: inset 0 0 0 1px rgba(21,94,253,0.55), 0 0 22px rgba(21,94,253,0.22);
}

.auth-otp-sweep {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg,
    rgba(255,255,255,0) 32%, rgba(255,255,255,0.14) 50%, rgba(255,255,255,0) 68%);
}

/* Keep typed digits above the injected overlays. */
.auth-otp-animated .auth-otp-input,
.auth-otp-animated .ds-input-otp { position: relative; z-index: 1; }
