/* ─────────────────────────────────────────────────────────────────────────
   auth.css — Login / Register / Verify pages
   Design language shared with i2i.css: dark navy glass, indigo→violet
   gradient, ambient glows. Everything is scoped under .auth-v2 so it can
   never leak into the rest of the app.
   ───────────────────────────────────────────────────────────────────────── */

.auth-v2 {
  /* Tokens (aligned with i2i.css / app.css) */
  --au-bg: #070d19;
  --au-card: rgba(12, 20, 39, 0.72);
  --au-input: rgba(6, 11, 22, 0.65);
  --au-border: rgba(255, 255, 255, 0.08);
  --au-border-strong: rgba(255, 255, 255, 0.14);
  --au-text: #ffffff;
  --au-text-soft: rgba(255, 255, 255, 0.72);
  --au-muted: rgba(255, 255, 255, 0.52);
  --au-primary: #6571ff;
  --au-accent: #8b5cf6;
  --au-gradient: linear-gradient(135deg, #6571ff 0%, #8b5cf6 100%);
  --au-glow: rgba(101, 113, 255, 0.4);
  --au-success: #34d399;
  --au-radius-xl: 24px;
  --au-radius-md: 14px;
  --au-radius-sm: 12px;

  position: relative;
  /* Bleed over the parent .page-content box (app.css: margin-top 60px + padding 25px)
     so the background reaches the very top and edges of the page, behind the fixed
     navbar. The 60px navbar clearance is restored via padding-top below. */
  margin: -85px -25px -25px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(60px + 2.5rem) 1rem 3.5rem;
  color: var(--au-text);
  background:
    radial-gradient(820px 420px at 50% -8%, rgba(101, 113, 255, 0.14) 0%, transparent 60%),
    radial-gradient(640px 380px at 8% 60%, rgba(139, 92, 246, 0.10) 0%, transparent 62%),
    radial-gradient(620px 400px at 96% 84%, rgba(101, 113, 255, 0.08) 0%, transparent 65%);
}

/* Ambient corner glows (fixed, purely decorative) */
.auth-v2 .au-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.auth-v2 .au-glow::before,
.auth-v2 .au-glow::after {
  content: "";
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
}
.auth-v2 .au-glow::before {
  top: -200px;
  left: -170px;
  background: radial-gradient(circle, rgba(101, 113, 255, 0.16) 0%, rgba(101, 113, 255, 0.04) 45%, transparent 72%);
}
.auth-v2 .au-glow::after {
  bottom: -220px;
  right: -190px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.14) 0%, rgba(101, 113, 255, 0.04) 48%, transparent 75%);
}

/* Shell: wordmark + card + footer links */
.auth-v2 .au-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
}

.auth-v2 .au-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.4rem;
  text-decoration: none;
}
.auth-v2 .au-brand-logo {
  height: 34px;
  width: auto;
  filter: drop-shadow(0 6px 18px rgba(101, 113, 255, 0.35));
}

/* Glass card with gradient beam on top */
.auth-v2 .au-card {
  position: relative;
  border-radius: var(--au-radius-xl);
  border: 1px solid var(--au-border);
  background: linear-gradient(180deg, rgba(12, 20, 39, 0.82) 0%, rgba(12, 20, 39, 0.62) 100%);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow:
    0 18px 70px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(101, 113, 255, 0.05) inset;
  padding: 2.1rem 2rem 1.9rem;
  overflow: hidden;
}
.auth-v2 .au-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(101, 113, 255, 0.65), rgba(139, 92, 246, 0.65), transparent);
}

.auth-v2 .au-title {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
}
.auth-v2 .au-subtitle {
  margin: 0 0 1.5rem;
  font-size: 0.92rem;
  color: var(--au-muted);
  line-height: 1.5;
}

/* Fields */
.auth-v2 .au-field {
  margin-bottom: 1.05rem;
}
.auth-v2 .au-label {
  display: block;
  margin-bottom: 0.42rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--au-text-soft);
  letter-spacing: 0.01em;
}
.auth-v2 .au-input-wrap {
  position: relative;
}
.auth-v2 .au-input {
  display: block;
  width: 100%;
  padding: 0.78rem 0.95rem;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--au-text);
  background: var(--au-input);
  border: 1px solid var(--au-border-strong);
  border-radius: var(--au-radius-md);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.auth-v2 .au-input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}
.auth-v2 .au-input:focus {
  border-color: rgba(101, 113, 255, 0.75);
  background: rgba(6, 11, 22, 0.85);
  box-shadow: 0 0 0 3px rgba(101, 113, 255, 0.18);
}
/* Kill browser autofill yellow on dark theme */
.auth-v2 .au-input:-webkit-autofill,
.auth-v2 .au-input:-webkit-autofill:hover,
.auth-v2 .au-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px #0a1222 inset;
  transition: background-color 9999s ease-in-out 0s;
}

/* Password visibility toggle */
.auth-v2 .au-input-wrap .au-input {
  padding-right: 2.9rem;
}
.auth-v2 .au-eye {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.auth-v2 .au-eye:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.06);
}
.auth-v2 .au-eye svg {
  width: 18px;
  height: 18px;
}
.auth-v2 .au-eye .au-eye-off { display: none; }
.auth-v2 .au-eye.is-visible .au-eye-on { display: none; }
.auth-v2 .au-eye.is-visible .au-eye-off { display: block; }

/* Checkboxes */
.auth-v2 .au-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--au-muted);
}
.auth-v2 .au-check input[type="checkbox"] {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--au-primary);
  cursor: pointer;
}
.auth-v2 .au-check label {
  cursor: pointer;
  margin: 0;
}
.auth-v2 .au-check a {
  color: var(--au-text-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-v2 .au-check a:hover {
  color: #fff;
}

/* Row between fields and CTA (remember me / forgot password) */
.auth-v2 .au-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.auth-v2 .au-row-between .au-check {
  margin-bottom: 0;
}
.auth-v2 .au-link {
  font-size: 0.84rem;
  color: var(--au-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
}
.auth-v2 .au-link:hover {
  color: #fff;
}

/* Primary CTA */
.auth-v2 .au-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.85rem 1.1rem;
  border: none;
  border-radius: var(--au-radius-md);
  background: var(--au-gradient);
  color: #fff;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(101, 113, 255, 0.28);
  transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease;
}
.auth-v2 .au-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(101, 113, 255, 0.36);
  color: #fff;
}
.auth-v2 .au-btn-primary:active {
  transform: translateY(0);
}
.auth-v2 .au-btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Divider */
.auth-v2 .au-divider {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 1.35rem 0;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.auth-v2 .au-divider::before,
.auth-v2 .au-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--au-border);
}

/* Google button */
.auth-v2 .au-btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.78rem 1.1rem;
  border: 1px solid var(--au-border-strong);
  border-radius: var(--au-radius-md);
  background: rgba(255, 255, 255, 0.04);
  color: var(--au-text-soft);
  font-size: 0.93rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.22s ease;
}
.auth-v2 .au-btn-google:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  transform: translateY(-1px);
}
.auth-v2 .au-btn-google svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

/* Footer under the card */
.auth-v2 .au-foot {
  margin-top: 1.35rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--au-muted);
}
.auth-v2 .au-foot a {
  color: var(--au-text-soft);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}
.auth-v2 .au-foot a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Alerts (restyle whatever @include('alert') / session alerts render) */
.auth-v2 .alert {
  border-radius: var(--au-radius-sm);
  border: 1px solid var(--au-border);
  padding: 0.75rem 0.9rem;
  font-size: 0.86rem;
  line-height: 1.5;
  margin-bottom: 1.1rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--au-text-soft);
}
.auth-v2 .alert-success {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.10);
  color: #a7f3d0;
}
.auth-v2 .alert-danger,
.auth-v2 .alert-error {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.10);
  color: #fecaca;
}
.auth-v2 .alert .btn-close {
  filter: invert(1) grayscale(1);
  opacity: 0.6;
}

/* Referral bonus pill (register) */
.auth-v2 .au-bonus {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--au-radius-sm);
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.10);
  color: #a7f3d0;
  font-size: 0.85rem;
  line-height: 1.5;
}
.auth-v2 .au-bonus svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--au-success);
}

/* ── Verify page ─────────────────────────────────────────────────────── */
.auth-v2 .au-verify {
  text-align: center;
}
.auth-v2 .au-verify-icon {
  width: 66px;
  height: 66px;
  margin: 0.25rem auto 1.2rem;
  border-radius: 20px;
  border: 1px solid rgba(101, 113, 255, 0.35);
  background: rgba(101, 113, 255, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 8px rgba(101, 113, 255, 0.05), 0 12px 30px rgba(101, 113, 255, 0.18);
}
.auth-v2 .au-verify-icon svg {
  width: 30px;
  height: 30px;
  color: #aab3ff;
}
.auth-v2 .au-verify .au-title {
  font-size: 1.4rem;
}
.auth-v2 .au-verify .au-subtitle {
  margin-bottom: 1.2rem;
}
.auth-v2 .au-verify-body {
  font-size: 0.92rem;
  color: var(--au-muted);
  line-height: 1.65;
  margin-bottom: 1.4rem;
}
.auth-v2 .au-btn-link {
  border: none;
  background: none;
  padding: 0;
  color: #aab3ff;
  font-weight: 700;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}
.auth-v2 .au-btn-link:hover {
  color: #fff;
}
.auth-v2 .au-verify-help {
  margin-top: 1.3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--au-border);
  font-size: 0.83rem;
  color: var(--au-muted);
  line-height: 1.7;
}
.auth-v2 .au-verify-help a {
  color: var(--au-text-soft);
  font-weight: 600;
  text-decoration: none;
}
.auth-v2 .au-verify-help a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Mobile ──────────────────────────────────────────────────────────── */
/* app.css switches .page-content padding to 25px 15px below 768px */
@media (max-width: 767px) {
  .auth-v2 {
    margin-left: -15px;
    margin-right: -15px;
  }
}

/* Below 992px the sidebar collapses and the top navbar shows the site logo,
   so the in-page brand would be a duplicate. Standalone pages (master2)
   have no navbar and keep theirs. */
@media (max-width: 991px) {
  .auth-v2:not(.auth-v2--standalone) .au-brand {
    display: none;
  }
}

@media (max-width: 576px) {
  .auth-v2 {
    padding: calc(60px + 1rem) 0.9rem 1.5rem;
  }
  .auth-v2 .au-brand {
    margin-bottom: 1.1rem;
  }
  .auth-v2 .au-card {
    padding: 1.5rem 1.2rem 1.4rem;
    border-radius: 20px;
  }
  .auth-v2 .au-title {
    font-size: 1.35rem;
  }
  .auth-v2 .au-subtitle {
    margin-bottom: 1.2rem;
  }
  .auth-v2 .au-field {
    margin-bottom: 0.95rem;
  }
  .auth-v2 .au-divider {
    margin: 1.15rem 0;
  }
  .auth-v2 .au-foot {
    margin-top: 1.15rem;
  }
  .auth-v2 .au-row-between {
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.05rem;
  }
  /* Comfortable tap targets on touch */
  .auth-v2 .au-input {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    font-size: 16px; /* prevents iOS zoom-on-focus */
  }
  .auth-v2 .au-btn-primary,
  .auth-v2 .au-btn-google {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
  }
}

/* Accessibility */
.auth-v2 a:focus-visible,
.auth-v2 button:focus-visible,
.auth-v2 input:focus-visible {
  outline: 2px solid rgba(101, 113, 255, 0.8);
  outline-offset: 2px;
}
.auth-v2 .au-input:focus-visible {
  outline: none; /* input already has its own focus ring */
}
@media (prefers-reduced-motion: reduce) {
  .auth-v2 * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ── Standalone variant (layout.master2 — no .page-content wrapper) ──── */
.auth-v2.auth-v2--standalone {
  margin: 0;
  min-height: 100vh;
  padding: 2.5rem 1rem 3.5rem;
  background-color: var(--au-bg);
}
@media (max-width: 576px) {
  .auth-v2.auth-v2--standalone {
    padding: 1.25rem 0.9rem 1.5rem;
  }
}

/* Validation errors (Laravel @error output) */
.auth-v2 .au-input.is-invalid {
  border-color: rgba(248, 113, 113, 0.65);
}
.auth-v2 .au-input.is-invalid:focus {
  border-color: rgba(248, 113, 113, 0.85);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.16);
}
.auth-v2 .invalid-feedback {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #fca5a5;
}
.auth-v2 .invalid-feedback strong {
  font-weight: 600;
}

/* reCAPTCHA block */
.auth-v2 .au-captcha {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1.4rem;
}
.auth-v2 .au-captcha > div {
  border-radius: var(--au-radius-sm);
  overflow: hidden;
}

/* Warning pill (e.g. deletion countdown) */
.auth-v2 .au-warn {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--au-radius-sm);
  border: 1px solid rgba(245, 166, 35, 0.4);
  background: rgba(245, 166, 35, 0.1);
  color: #fcd9a0;
  font-size: 0.88rem;
  line-height: 1.5;
}
.auth-v2 .au-warn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  color: #f5a623;
}
.auth-v2 .au-warn strong {
  color: #ffe6c2;
}

/* Secondary danger-outline action */
.auth-v2 .au-btn-outline-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.78rem 1.1rem;
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: var(--au-radius-md);
  background: transparent;
  color: rgba(252, 165, 165, 0.85);
  font-size: 0.93rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.auth-v2 .au-btn-outline-danger:hover {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.6);
  color: #fecaca;
}