/* ── Auth pages (login/register/forgot) — Redesign v3 (split layout) ── */

/* ── Fade-in animation ───────────────────────────────────────────────── */
@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes authOrbFloat {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: .45; }
  50%      { transform: translate(-50%, -50%) scale(1.15); opacity: .7; }
}

@keyframes authPulseGlow {
  0%, 100% { box-shadow: 0 0 40px rgba(91,160,255,.08); }
  50%      { box-shadow: 0 0 60px rgba(139,108,247,.12); }
}

/* ── Split layout container ──────────────────────────────────────────── */
.auth-layout {
  display: flex;
  min-height: calc(100vh - 72px);
  animation: authFadeIn .5s var(--ease-out) both;
}

.auth-form-side {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
}

.auth-promo-side {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: linear-gradient(135deg, rgba(91,160,255,.04) 0%, rgba(139,108,247,.06) 50%, rgba(34,211,238,.03) 100%);
  border-left: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

/* ── Animated gradient orb (promo side) ──────────────────────────────── */
.auth-promo-side::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91,160,255,.12) 0%, rgba(139,108,247,.08) 40%, transparent 70%);
  animation: authOrbFloat 6s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.auth-promo-content {
  position: relative;
  z-index: 1;
  max-width: 380px;
}

.auth-promo-content h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.auth-promo-content .auth-promo-sub {
  color: var(--muted2);
  font-size: .95rem;
  margin-bottom: 32px;
  line-height: 1.6;
}

.auth-promo-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-promo-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: .9rem;
  color: var(--text2);
  line-height: 1.5;
}

.auth-promo-features .promo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 8px;
  background: rgba(91,160,255,.1);
  color: var(--accent);
  font-size: .8rem;
  font-weight: 700;
  margin-top: 1px;
}

.auth-promo-stats {
  display: flex;
  gap: 24px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.auth-promo-stat {
  text-align: center;
}

.auth-promo-stat .stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
}

.auth-promo-stat .stat-label {
  font-size: .75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 2px;
}

/* ── Auth card (form side) ───────────────────────────────────────────── */
.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 40px 36px;
  background: rgba(21,24,35,.65);
  border: 1px solid var(--border2);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.03),
    0 8px 40px rgba(0,0,0,.3),
    inset 0 1px 0 rgba(255,255,255,.04);
  position: relative;
  overflow: hidden;
  animation: authPulseGlow 4s ease-in-out infinite;
}

/* Subtle accent glow behind the card */
.auth-card::before {
  content: '';
  position: absolute;
  top: -60%;
  left: 50%;
  transform: translateX(-50%);
  width: 200%;
  height: 120%;
  background: radial-gradient(ellipse at center, rgba(91,138,248,.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.auth-card > * { position: relative; z-index: 1; }

/* ── Logo / Title ────────────────────────────────────────────────────── */
.auth-logo {
  text-align: center;
  margin-bottom: 8px;
}

.auth-logo img {
  height: 36px;
  width: auto;
}

.auth-title {
  font-size: 1.65rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text);
  letter-spacing: -.02em;
  text-align: center;
}

.auth-subtitle {
  color: var(--muted2);
  font-size: .9rem;
  margin-bottom: 28px;
  line-height: 1.5;
  text-align: center;
}

/* ── Error / Success ─────────────────────────────────────────────────── */
.auth-error {
  padding: 12px 16px;
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(248,113,113,.18);
  border-left: 3px solid #f87171;
  border-radius: 10px;
  color: #f87171;
  font-size: .85rem;
  margin-bottom: 20px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-error::before {
  content: '!';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  background: rgba(248,113,113,.15);
  color: #f87171;
  font-size: .7rem;
  font-weight: 700;
}

.auth-success {
  padding: 12px 16px;
  background: rgba(62,232,168,.08);
  border: 1px solid rgba(62,232,168,.18);
  border-left: 3px solid var(--green);
  border-radius: 10px;
  color: var(--green);
  font-size: .85rem;
  margin-bottom: 20px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-success::before {
  content: '\2713';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  background: rgba(62,232,168,.15);
  color: var(--green);
  font-size: .7rem;
  font-weight: 700;
}

/* ── Form ────────────────────────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-field label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted2);
  margin-bottom: 8px;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.auth-field .required { color: #f87171; }

.auth-field .input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-family: var(--sans);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  outline: none;
}

.auth-field .input::placeholder {
  color: var(--muted);
  font-size: 14px;
}

.auth-field .input:hover {
  border-color: var(--border3);
}

.auth-field .input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(91,160,255,.02);
}

/* Override browser autofill (dark theme) */
.auth-field .input:-webkit-autofill,
.auth-field .input:-webkit-autofill:hover,
.auth-field .input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface2) inset;
  transition: background-color 5000s ease-in-out 0s;
  border-color: var(--border2);
  caret-color: var(--text);
}

/* ── Password strength indicator ─────────────────────────────────────── */
.password-strength {
  height: 3px;
  border-radius: 3px;
  background: var(--border);
  margin-top: 8px;
  overflow: hidden;
  transition: opacity .2s ease;
}

.password-strength-bar {
  height: 100%;
  border-radius: 3px;
  width: 0;
  transition: width .3s ease, background-color .3s ease;
}

.password-strength-bar[data-level="1"] {
  width: 25%;
  background-color: var(--red);
}

.password-strength-bar[data-level="2"] {
  width: 50%;
  background-color: var(--orange);
}

.password-strength-bar[data-level="3"] {
  width: 75%;
  background-color: var(--yellow);
}

.password-strength-bar[data-level="4"] {
  width: 100%;
  background-color: var(--green);
}

/* ── Forgot password link row ────────────────────────────────────────── */
.auth-forgot-row {
  text-align: right;
  margin: -6px 0 8px;
}

.auth-forgot-row a {
  font-size: 13px;
  color: var(--muted2);
  text-decoration: none;
  transition: color .15s ease;
}

.auth-forgot-row a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Full-width button ───────────────────────────────────────────────── */
.btn-full {
  width: 100%;
  height: 48px;
  padding: 0 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--sans);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
  margin-top: 4px;
  position: relative;
  overflow: hidden;
}

.btn-full::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,.1));
  opacity: 0;
  transition: opacity .2s ease;
}

.btn-full:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(91,160,255,.3);
  filter: brightness(1.08);
}

.btn-full:hover::after { opacity: 1; }

.btn-full:active {
  transform: translateY(0);
  box-shadow: 0 2px 12px rgba(91,160,255,.2);
  filter: brightness(.97);
}

/* ── Bottom links ────────────────────────────────────────────────────── */
.auth-link {
  text-align: center;
  margin-top: 24px;
  font-size: .85rem;
  color: var(--muted2);
}

.auth-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color .15s ease;
}

.auth-link a:hover {
  color: var(--accent2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Referral bonus box ──────────────────────────────────────────────── */
.auth-ref-bonus {
  background: rgba(251,191,36,.06);
  border: 1px solid rgba(251,191,36,.18);
  border-left: 3px solid var(--yellow);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: .85rem;
  color: #fbbf24;
  line-height: 1.5;
}

/* ── Privacy consent checkbox (register) ─────────────────────────────── */
.auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: .84rem;
  color: var(--muted2);
  line-height: 1.45;
}

.auth-consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  border-radius: 4px;
  cursor: pointer;
}

.auth-consent a {
  color: var(--accent);
  text-decoration: none;
}

.auth-consent a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Social / alternative links ──────────────────────────────────────── */
.auth-alt-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.auth-alt-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text2);
  font-size: .85rem;
  text-decoration: none;
  transition: border-color .2s ease, background .2s ease;
}

.auth-alt-link:hover {
  border-color: var(--border3);
  background: var(--surface3);
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .auth-layout {
    flex-direction: column;
  }

  .auth-promo-side {
    display: none;
  }

  .auth-form-side {
    flex: 1;
    padding: 32px 16px;
  }
}

@media (max-width: 600px) {
  .auth-card {
    padding: 28px 20px;
    border-radius: 14px;
    animation: none;
  }

  .auth-title { font-size: 1.35rem; }
  .auth-subtitle { font-size: .85rem; margin-bottom: 22px; }

  .auth-field .input {
    height: 44px;
    padding: 0 14px;
    font-size: 14px;
  }

  .btn-full {
    height: 44px;
    font-size: 15px;
  }

  .auth-form-side {
    padding: 24px 12px;
  }
}

/* ── Fallback: auth-card without layout wrapper (forgot-password etc) ── */
.auth-layout-single {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 72px);
  padding: 48px 32px;
  animation: authFadeIn .5s var(--ease-out) both;
}

@media (max-width: 600px) {
  .auth-layout-single {
    padding: 24px 12px;
  }
}
