/*
 * FutureFi Portal – Premium Auth Styles
 * Dark theme + glassmorphism, matching futurefi.trade branding.
 */

/* ========================================================================
   1. ROOT VARIABLES
   ======================================================================== */
:root {
  --ff-bg-dark: #060b18;
  --ff-bg-gradient: linear-gradient(135deg, #060b18 0%, #0c1a3a 40%, #12234d 70%, #0a1628 100%);
  --ff-primary: #4f6ef7;
  --ff-primary-light: #6b8aff;
  --ff-primary-glow: rgba(79, 110, 247, 0.35);
  --ff-accent: #a78bfa;
  --ff-accent-pink: #ec4899;
  --ff-glass-bg: rgba(255, 255, 255, 0.05);
  --ff-glass-border: rgba(255, 255, 255, 0.1);
  --ff-glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --ff-text: #e2e8f0;
  --ff-text-muted: #94a3b8;
  --ff-text-heading: #f1f5f9;
  --ff-input-bg: rgba(255, 255, 255, 0.06);
  --ff-input-border: rgba(255, 255, 255, 0.12);
  --ff-input-focus-border: #4f6ef7;
  --ff-input-focus-shadow: 0 0 0 3px rgba(79, 110, 247, 0.15);
  --ff-radius: 16px;
  --ff-radius-sm: 10px;
  --ff-font: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ========================================================================
   2. BASE
   ======================================================================== */
body, .auth-page {
  font-family: var(--ff-font) !important;
  background: var(--ff-bg-dark) !important;
  background-image: var(--ff-bg-gradient) !important;
  color: var(--ff-text);
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

/* Animated gradient orbs in background */
.auth-page {
  position: relative;
}

.auth-page::before,
.auth-page::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  z-index: 0;
  pointer-events: none;
}

.auth-page::before {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #4f6ef7 0%, transparent 70%);
  top: -10%;
  right: -5%;
  animation: floatOrb1 12s ease-in-out infinite;
}

.auth-page::after {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #a78bfa 0%, transparent 70%);
  bottom: -10%;
  left: -5%;
  animation: floatOrb2 15s ease-in-out infinite;
}

@keyframes floatOrb1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 30px) scale(1.1); }
}

@keyframes floatOrb2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -40px) scale(1.15); }
}

/* ========================================================================
   3. AUTH LAYOUT – SPLIT SCREEN
   ======================================================================== */
.auth-split {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Left panel – branding */
.auth-brand-panel {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(79, 110, 247, 0.08) 0%, rgba(167, 139, 250, 0.04) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

@media (min-width: 992px) {
  .auth-brand-panel {
    display: flex;
    flex: 0 0 45%;
    max-width: 45%;
  }
}

.auth-brand-panel::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(79, 110, 247, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(40px);
}

.brand-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 380px;
}

.brand-content .brand-logo {
  margin-bottom: 2.5rem;
}

.brand-content .brand-logo img {
  height: 50px;
  opacity: 0.9;
}

.brand-tagline {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ff-text-heading);
  line-height: 1.3;
  margin-bottom: 1rem;
}

.brand-tagline span {
  background: linear-gradient(135deg, #4f6ef7, #a78bfa, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-description {
  font-size: 1rem;
  color: var(--ff-text-muted);
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.brand-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
}

.brand-stat {
  text-align: center;
}

.brand-stat .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ff-text-heading);
}

.brand-stat .stat-label {
  font-size: 0.75rem;
  color: var(--ff-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.25rem;
}

/* Right panel – form (white background) */
.auth-form-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
  background: #f8fafc;
}

/* ========================================================================
   4. FORM CARD (on white panel)
   ======================================================================== */
.glass-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: var(--ff-radius) !important;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04) !important;
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  position: relative;
}

/* Wider card for pages with many fields (e.g. Create account) */
.glass-card--wide {
  max-width: 560px;
}

/* Subtle gradient top accent line */
.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4f6ef7, #a78bfa, #ec4899);
  border-radius: var(--ff-radius) var(--ff-radius) 0 0;
}

.glass-card .card-body {
  padding: 2.5rem 2rem;
  background: transparent !important;
}

@media (min-width: 576px) {
  .glass-card .card-body {
    padding: 2.5rem;
  }
}

/* ========================================================================
   5. LOGO (inside card, mobile)
   ======================================================================== */
.auth-card-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-card-logo img {
  height: 40px;
  opacity: 0.9;
}

@media (min-width: 992px) {
  .auth-card-logo {
    display: none; /* Hidden on desktop – shown in brand panel instead */
  }
}

/* ========================================================================
   6. HEADING (dark text on white panel)
   ======================================================================== */
.auth-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  color: #64748b !important;
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* ========================================================================
   7. FORM ELEMENTS (dark text on white panel)
   ======================================================================== */
.auth-form .form-label {
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  letter-spacing: 0.3px;
}

.auth-form .form-control {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0;
  border-radius: var(--ff-radius-sm);
  color: #1e293b !important;
  padding: 0.65rem 1rem;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
  height: auto;
}

.auth-form .form-control::placeholder {
  color: #94a3b8;
}

.auth-form .form-control:focus {
  background: #fff !important;
  border-color: var(--ff-primary);
  box-shadow: var(--ff-input-focus-shadow);
  color: #1e293b !important;
  outline: none;
}

/* Input group – password toggle */
.auth-form .input-group .form-control {
  border-right: 0;
}

.auth-form .input-group .btn,
.auth-form .input-group .input-group-text {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0;
  border-left: 0;
  border-radius: 0 var(--ff-radius-sm) var(--ff-radius-sm) 0;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Primary button inside input-group (e.g. Verify) – keep visible on light background */
.auth-form .input-group .btn-primary {
  background: linear-gradient(135deg, #4f6ef7, #6b8aff) !important;
  border: 1px solid rgba(79, 110, 247, 0.5) !important;
  border-left: 0;
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(79, 110, 247, 0.3);
}
.auth-form .input-group .btn-primary:hover {
  background: linear-gradient(135deg, #5f7ef8, #7b9aff) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(79, 110, 247, 0.4);
}

.auth-form .input-group .form-control:focus + .btn,
.auth-form .input-group .form-control:focus + .input-group-text {
  border-color: var(--ff-primary);
  box-shadow: none;
}

.auth-form .input-group .btn:hover,
.auth-form .input-group .input-group-text:hover {
  color: #1e293b;
}

/* Checkbox */
.auth-form .form-check-input {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  border-radius: 4px;
  width: 1.1em;
  height: 1.1em;
}

.auth-form .form-check-input:checked {
  background-color: var(--ff-primary);
  border-color: var(--ff-primary);
}

.auth-form .form-check-input:focus {
  border-color: var(--ff-primary);
  box-shadow: var(--ff-input-focus-shadow);
}

.auth-form .form-check-label {
  color: #64748b;
  font-size: 0.875rem;
}

/* ========================================================================
   8. PRIMARY BUTTON
   ======================================================================== */
.auth-form .btn-primary {
  background: linear-gradient(135deg, #4f6ef7, #6b8aff) !important;
  border: none !important;
  border-radius: var(--ff-radius-sm);
  padding: 0.7rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #fff !important;
  box-shadow: 0 4px 15px rgba(79, 110, 247, 0.35);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.auth-form .btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: left 0.5s ease;
}

.auth-form .btn-primary:hover::before {
  left: 100%;
}

.auth-form .btn-primary:hover {
  background: linear-gradient(135deg, #5f7ef8, #7b9aff) !important;
  box-shadow: 0 6px 25px rgba(79, 110, 247, 0.5);
  transform: translateY(-1px);
}

.auth-form .btn-primary:active {
  transform: translateY(0);
}

.auth-form .btn-primary:disabled {
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

/* ========================================================================
   9. LINKS (on white panel)
   ======================================================================== */
.glass-card a {
  color: var(--ff-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.glass-card a:hover {
  color: var(--ff-primary-light);
  text-decoration: none;
}

.glass-card .fw-semibold {
  font-weight: 600;
}

.password-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.password-header .form-label {
  margin-bottom: 0;
}

.password-header a {
  font-size: 0.8125rem;
}

/* ========================================================================
   10. ALERTS (on white panel)
   ======================================================================== */
.glass-card .alert {
  border-radius: var(--ff-radius-sm);
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  border: none;
}

.glass-card .alert-success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.glass-card .alert-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.glass-card .alert .btn-close {
  opacity: 0.5;
}

.glass-card .invalid-feedback {
  color: #dc2626;
  font-size: 0.8125rem;
}

/* ========================================================================
   11. FOOTER (on white panel)
   ======================================================================== */
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: #94a3b8;
  font-size: 0.8rem;
}

.auth-footer a {
  color: #64748b;
}

/* ========================================================================
   12. TERMS MODAL
   ======================================================================== */
.modal-content {
  background: #111827 !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--ff-radius);
  color: var(--ff-text);
}

.modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header .modal-title {
  color: var(--ff-text-heading);
}

.modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-footer .btn-primary {
  background: var(--ff-primary) !important;
  border-color: var(--ff-primary) !important;
}

.modal-body {
  color: var(--ff-text-muted);
}

.modal-body b, .modal-body strong {
  color: var(--ff-text);
}

/* ========================================================================
   13. LOADING SPINNER
   ======================================================================== */
.bx-spin {
  animation: spin 1.5s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ========================================================================
   14. RESPONSIVE
   ======================================================================== */
@media (max-width: 575.98px) {
  .glass-card .card-body {
    padding: 2rem 1.25rem;
  }

  .auth-heading {
    font-size: 1.25rem;
  }

  .auth-card-logo img {
    height: 35px;
  }
}

/* ========================================================================
   15. MINIA OVERRIDES (neutralize any inherited auth-page styles)
   ======================================================================== */
.auth-page .auth-full-page-content {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
}

.auth-page .container-fluid {
  max-width: 100%;
}

.auth-page #preloader {
  display: none;
}

/* Override Bootstrap card defaults for dark theme */
.glass-card, .glass-card .card-body {
  background-color: transparent;
}

/* ========================================================================
   16. ENTRANCE ANIMATION
   ======================================================================== */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.glass-card {
  animation: fadeSlideUp 0.6s ease-out;
}

.brand-content {
  animation: fadeSlideUp 0.8s ease-out;
}
