/* ============================================================
   VegasBet — Auth Pages CSS (login & register)
   Two-column neon card + animated alert plates.
   ============================================================ */

/* ── Page frame ─────────────────────────────────────────────── */
.auth-wrap {
  min-height: calc(100vh - var(--header-height) - 90px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 16px;
  position: relative;
}

.auth-wrap::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1200px 520px at 50% -12%, rgba(124, 58, 237, 0.16), transparent 70%),
    radial-gradient(900px 500px at 92% 4%, rgba(153, 0, 153, 0.12), transparent 60%);
}

/* ── Card ───────────────────────────────────────────────────── */
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 960px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #1e1e23, #1a1a1e);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  animation: authFadeUp 0.5s ease both;
  font-family: 'Manrope', 'Inter', sans-serif;
}

/* ── Left neon hero ─────────────────────────────────────────── */
.auth-hero {
  position: relative;
  overflow: hidden;
  padding: 44px 40px;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(700px 380px at 20% 0%, rgba(124, 58, 237, 0.42), transparent 62%),
    linear-gradient(160deg, #241546 0%, #16121f 60%, #120c1a 100%);
}

.auth-hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(168, 85, 247, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.14) 1px, transparent 1px);
  background-size: 46px 46px;
  animation: authGridPan 6s linear infinite;
  -webkit-mask-image: radial-gradient(500px 500px at 30% 20%, #000, transparent 75%);
          mask-image: radial-gradient(500px 500px at 30% 20%, #000, transparent 75%);
}

.auth-hero-stripe {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* A single diagonal sheen tile, repeated horizontally. The tile edges are
     fully transparent, so tiling is seamless; animating the background by
     exactly one tile width makes the loop point invisible (no jump-back). */
  background-image: linear-gradient(115deg,
      transparent 44%,
      rgba(192, 132, 252, 0.16) 50%,
      transparent 56%);
  background-repeat: repeat;
  background-size: 540px 100%;
  animation: authStripe 5s linear infinite;
}

/* Logo (skewed neon bars + wordmark) */
.auth-hero-logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
}

.auth-hero-logo-img {
  height: 44px;
  width: auto;
  filter: drop-shadow(0 0 18px rgba(168, 85, 247, 0.55));
}

.auth-hero-main { position: relative; }

.auth-hero-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 38px;
  line-height: 1.08;
  font-weight: 700;
  margin: 0 0 14px;
  color: #fff;
  text-shadow: 0 0 30px rgba(168, 85, 247, 0.35);
}

.auth-hero-sub {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #c3bcd4;
  max-width: 340px;
}

.auth-stats {
  display: flex;
  gap: 26px;
  margin-top: 34px;
}

.auth-stat-num {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
}

.auth-stat-label {
  font-size: 12px;
  color: #9a94a8;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.auth-stat-div {
  width: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.auth-secure {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.28);
  font-size: 13px;
  color: #cbe9dc;
  font-weight: 600;
}

.auth-secure-dot {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
  animation: authLivePulse 1.8s infinite;
}

/* ── Right form panel ───────────────────────────────────────── */
.auth-panel {
  padding: 40px 40px 34px;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
}

/* Tabs */
.auth-tabs {
  position: relative;
  display: flex;
  padding: 5px;
  border-radius: 14px;
  background: #131317;
  border: 1px solid rgba(124, 58, 237, 0.18);
  margin-bottom: 26px;
}

.auth-tab-indicator {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc(50% - 5px);
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.5);
  transition: transform 0.28s cubic-bezier(0.4, 1.3, 0.5, 1);
}

.auth-card[data-auth-mode="register"] .auth-tab-indicator {
  transform: translateX(100%);
}

.auth-tab {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 11px 0;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: #8a8398;
  transition: color 0.2s;
}

.auth-tab.active { color: #fff; }
.auth-tab:not(.active):hover { color: #c9c2d8; }

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

.auth-field { display: flex; flex-direction: column; }

.auth-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #8a8398;
  margin-bottom: 8px;
}

.auth-label-optional {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #6a6478;
}

.auth-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  background: #131317;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.auth-input::placeholder { color: #5c5668; }

.auth-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.22);
}

.auth-input.error {
  border-color: #ff4d6d;
  box-shadow: 0 0 0 3px rgba(255, 77, 109, 0.18);
}

.auth-mismatch {
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #ff4d6d;
}

.auth-hint {
  display: block;
  font-size: 12.5px;
  color: #6a6478;
  margin-top: 8px;
}

/* Submit */
.auth-submit {
  position: relative;
  margin-top: 6px;
  padding: 16px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff;
  font-weight: 800;
  font-size: 15.5px;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(124, 58, 237, 0.5);
  transition: transform 0.18s, box-shadow 0.18s;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(168, 85, 247, 0.6);
}

.auth-submit:disabled { cursor: default; opacity: 0.9; }

.auth-terms {
  text-align: center;
  font-size: 12.5px;
  color: #6a6478;
  margin: 2px 0 0;
  line-height: 1.5;
}

.auth-terms a { color: var(--accent); }
.auth-terms a:hover { color: #c084fc; }

/* Switch prompt */
.auth-switch { margin-top: auto; padding-top: 24px; }

.auth-switch-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.3), transparent);
  margin-bottom: 18px;
}

.auth-switch-text {
  text-align: center;
  font-size: 13.5px;
  color: #9a94a8;
  margin: 0;
}

.auth-switch-text a { font-weight: 700; color: var(--accent); }
.auth-switch-text a:hover { color: #c084fc; }

/* ── Loading spinner on submit ──────────────────────────────── */
.auth-submit.btn-loading { color: transparent !important; }

.auth-submit.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: authSpin 0.6s linear infinite;
}

/* ============================================================
   Animated alert plates (built by auth.js)
   ============================================================ */
.auth-alert:empty { display: none; }

.aap {
  --aap-line: #ff4d6d;
  --aap-bg1: rgba(255, 50, 80, 0.14);
  --aap-bg2: rgba(255, 50, 80, 0.04);
  --aap-text: #ffd0d8;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 42px 13px 14px;
  margin-bottom: 20px;
  border-radius: 14px;
  background: linear-gradient(120deg, var(--aap-bg1), var(--aap-bg2));
  border: 1px solid rgba(255, 77, 109, 0.33);
}

.aap--error {
  --aap-line: #ff4d6d;
  --aap-bg1: rgba(255, 50, 80, 0.14);
  --aap-bg2: rgba(255, 50, 80, 0.04);
  --aap-text: #ffd0d8;
  border-color: rgba(255, 77, 109, 0.33);
  animation: alertIn 0.45s cubic-bezier(0.2, 1.2, 0.3, 1) both,
             alertShake 0.5s ease 0.1s,
             alertGlow 2.4s ease-in-out infinite;
}

.aap--success {
  --aap-line: #34d399;
  --aap-bg1: rgba(16, 185, 129, 0.14);
  --aap-bg2: rgba(16, 185, 129, 0.04);
  --aap-text: #c7f2e2;
  border-color: rgba(52, 211, 153, 0.33);
  animation: alertIn 0.45s cubic-bezier(0.2, 1.2, 0.3, 1) both,
             alertGlowOk 2.4s ease-in-out infinite;
}

.aap-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--aap-line);
  box-shadow: 0 0 14px var(--aap-line);
}

.aap-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--aap-line);
  box-shadow: 0 0 18px var(--aap-line);
  animation: iconPop 0.5s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}

.aap-icon svg { width: 20px; height: 20px; display: block; }

.aap-text {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--aap-text);
  line-height: 1.35;
}

.aap-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--aap-text);
  opacity: 0.6;
  font-size: 17px;
  line-height: 1;
  border-radius: 6px;
  transition: opacity 0.18s;
}

.aap-close:hover { opacity: 1; }

.aap-timer {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  transform-origin: left;
  background: var(--aap-line);
  opacity: 0.8;
  animation: alertBar 5.2s linear both;
}

/* ── Keyframes ──────────────────────────────────────────────── */
@keyframes authFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes authLivePulse {
  0%, 100% { opacity: 1;   box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  50%      { opacity: 0.55; box-shadow: 0 0 0 5px rgba(52, 211, 153, 0); }
}
@keyframes authGridPan {
  from { background-position: 0 0; }
  to   { background-position: 46px 46px; }
}
@keyframes authStripe {
  from { background-position: 0 0; }
  to   { background-position: 540px 0; }
}
@keyframes authSpin { to { transform: rotate(360deg); } }
@keyframes alertIn {
  0%   { opacity: 0; transform: translateY(-10px) scale(0.97); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes alertShake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-7px); }
  30% { transform: translateX(6px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
}
@keyframes alertGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 70, 90, 0.35), 0 0 22px rgba(255, 50, 80, 0.20); }
  50%      { box-shadow: 0 0 0 1px rgba(255, 70, 90, 0.55), 0 0 34px rgba(255, 50, 80, 0.42); }
}
@keyframes alertGlowOk {
  0%, 100% { box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.35), 0 0 22px rgba(52, 211, 153, 0.18); }
  50%      { box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.55), 0 0 34px rgba(52, 211, 153, 0.4); }
}
@keyframes alertBar {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
@keyframes iconPop {
  0%   { transform: scale(0) rotate(-30deg); }
  70%  { transform: scale(1.25) rotate(6deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 860px) {
  .auth-card { grid-template-columns: 1fr; max-width: 460px; }
  .auth-hero { display: none; }
  .auth-panel { padding: 32px 26px 28px; }
}

@media (max-width: 480px) {
  .auth-wrap { padding: 24px 12px; }
  .auth-panel { padding: 26px 20px 24px; }
  .auth-tabs { margin-bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card,
  .auth-hero-grid,
  .auth-hero-stripe,
  .auth-secure-dot,
  .aap--error,
  .aap--success,
  .aap-icon,
  .aap-timer { animation: none !important; }
}
