/* ============================================
   BASE.CSS - Shared Styles for All Auth Pages
   Updated with Animated Gradient Background
   ============================================ */

/* ============ CSS VARIABLES ============ */
@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

:root {
  /* Colors */
  --color-ink: #0a0f1a;
  --color-ink-light: #1a2332;
  --color-ink-muted: #4a5568;
  --color-paper: #fefefe;
  --color-paper-warm: #faf9f7;
  --color-paper-cool: #f4f6f9;
  
  /* Brand Colors */
  --color-accent: #f7941d;
  --color-accent-hover: #e8850a;
  --color-accent-soft: #fef3e2;
  --color-accent-dark: #c67610;
  
  /* Status Colors */
  --color-success: #059669;
  --color-success-soft: #d1fae5;
  --color-danger: #dc2626;
  --color-danger-soft: #fee2e2;
  
  /* Borders */
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;
  
  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.04), 0 10px 20px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.06), 0 20px 50px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.08), 0 30px 70px rgba(0,0,0,0.12);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.3);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ RESETS ============ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============ AUTH BODY WITH ANIMATED GRADIENT ============ */
body.auth-bg {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-ink);
  background: #0a0a0f;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* ============ WEBGL GRADIENT CANVAS ============ */
#gradient-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

/* ============ CSS FALLBACK GRADIENT ============ */
.auth-gradient-fallback {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: none;
  background: 
    radial-gradient(ellipse at 20% 80%, rgba(247, 148, 29, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255, 0, 128, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 40% 40%, rgba(128, 0, 255, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 60%, rgba(255, 100, 50, 0.3) 0%, transparent 50%),
    linear-gradient(135deg, #1a0a2e 0%, #0d1520 50%, #1a1025 100%);
  animation: fallbackGradientShift 20s ease-in-out infinite;
}

@keyframes fallbackGradientShift {
  0%, 100% {
    background-position: 0% 0%, 100% 100%, 50% 50%, 30% 70%, 0% 0%;
  }
  50% {
    background-position: 100% 100%, 0% 0%, 70% 30%, 50% 50%, 0% 0%;
  }
}

/* Dark overlay to soften the gradient */
.auth-gradient-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.3) 50%,
    rgba(0, 0, 0, 0.4) 100%
  );
  z-index: 1;
  pointer-events: none;
}

/* Noise texture overlay for depth */
.auth-gradient-noise {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 2;
}

/* ============ NAVBAR LOGO (Auth Pages) ============ */
.navbar-logo {
  position: fixed;
  top: var(--space-lg);
  left: var(--space-lg);
  z-index: 100;
  transition: opacity var(--transition-base);
}

.navbar-logo:hover {
  opacity: 0.8;
}

.navbar-logo img {
  height: 40px;
  width: auto;
  filter: brightness(0) invert(1);
}

/* ============ AUTH CONTAINER ============ */
.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  position: relative;
  z-index: 10;
  min-height: 100vh;
}

/* ============================================================
   FORM SIZING - EDIT THESE VALUES TO CHANGE FORM SIZE
   ============================================================ */
.auth-box {
  width: 100%;
  max-width: 580px;        /* <-- DESKTOP WIDTH: Change this to make form wider/narrower */
  animation: fadeInUp 0.6s ease-out both;
}

/* ============ GLASSMORPHISM FORM CONTAINER ============ */
/* Styled similar to your toast notifications */
.mobile-form-container {
  background: rgba(255, 255, 255, 0.8) !important;  /* <-- TRANSPARENCY: Lower = more transparent (0.0 to 1.0) */
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: var(--space-4xl);    /* <-- DESKTOP PADDING: Change for more/less internal spacing */
  position: relative;
  overflow: hidden;
}

/* Accent line at top of card */
.mobile-form-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-accent), #ff6b35, var(--color-accent-hover));
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ============ FORM ELEMENTS ============ */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-ink);
  margin-bottom: var(--space-xs);
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-ink);
  background: rgba(255, 255, 255, 0.7);  /* Slightly transparent inputs */
  background-color: rgba(255, 255, 255, 0.7) !important;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
  height: auto;
  line-height: 1.5;
}

.auth-bg .form-control,
.auth-form .form-control,
.mobile-form-container .form-control {
  border-radius: var(--radius-md) !important;
}

.form-control::placeholder {
  color: var(--color-ink-muted);
  opacity: 0.6;
}

.form-control:hover {
  border-color: #cbd5e1;
}

.form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
  background: rgba(255, 255, 255, 0.9) !important;
  background-color: rgba(255, 255, 255, 0.9) !important;
}

.form-control.is-invalid {
  border-color: var(--color-danger);
  animation: shake 0.3s ease-in-out;
}

/* Input Group */
.auth-form .input-group,
.mobile-form-container .input-group,
.auth-bg .input-group {
  position: relative;
  display: block !important;
  flex-wrap: nowrap;
}

.auth-bg .input-group > .form-control {
  position: relative;
  flex: none;
  width: 100%;
  min-width: 0;
  z-index: 1;
}

.auth-form .input-group .form-control,
.mobile-form-container .input-group .form-control,
.auth-bg .input-group .form-control {
  padding-left: 3rem;
}

.auth-form .input-group-icon,
.mobile-form-container .input-group-icon,
.auth-bg .input-group-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-ink-muted);
  font-size: 1rem;
  pointer-events: none;
  transition: color var(--transition-fast);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  background: transparent;
  border: none;
  padding: 0;
}

.auth-form .input-group:focus-within .input-group-icon,
.mobile-form-container .input-group:focus-within .input-group-icon,
.auth-bg .input-group:focus-within .input-group-icon {
  color: var(--color-accent);
}

/* Password Toggle */
.auth-form .password-toggle,
.mobile-form-container .password-toggle,
.auth-bg .password-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-ink-muted);
  cursor: pointer;
  padding: 0.5rem;
  transition: color var(--transition-fast);
  z-index: 5;
}

.auth-form .password-toggle:hover,
.mobile-form-container .password-toggle:hover,
.auth-bg .password-toggle:hover {
  color: var(--color-accent);
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.875rem var(--space-xl);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-hover));
  color: white;
  box-shadow: 0 4px 15px rgba(247, 148, 29, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-accent-hover), var(--color-accent-dark));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(247, 148, 29, 0.4);
}

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

.btn-primary:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.7);
  color: var(--color-ink-muted);
  border: 1.5px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-ink);
  color: var(--color-ink);
  background: rgba(255, 255, 255, 0.9);
}

/* Button Loading State */
.btn .indicator-progress {
  display: none;
}

.btn[data-kt-indicator="on"] .indicator-label {
  display: none;
}

.btn[data-kt-indicator="on"] .indicator-progress {
  display: inline-flex;
  align-items: center;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

/* ============ LINKS ============ */
.link-primary {
  color: var(--color-accent);
  font-weight: 500;
  transition: color var(--transition-fast);
  text-decoration: none;
}

.link-primary:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

.link-muted {
  color: var(--color-ink-muted);
  font-size: 0.875rem;
  transition: color var(--transition-fast);
  text-decoration: none;
}

.link-muted:hover {
  color: var(--color-accent);
}

/* ============ ALERTS ============ */
.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xl);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
}

.alert-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  margin-bottom: 2px;
  font-size: 0.9375rem;
}

.alert-text {
  font-size: 0.875rem;
  line-height: 1.5;
}

.alert-danger {
  background: rgba(254, 226, 226, 0.7);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.alert-danger .alert-icon,
.alert-danger .alert-title {
  color: var(--color-danger);
}

.alert-danger .alert-text {
  color: #991b1b;
}

.alert-success {
  background: rgba(209, 250, 229, 0.7);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.alert-success .alert-icon,
.alert-success .alert-title {
  color: var(--color-success);
}

.alert-success .alert-text {
  color: #065f46;
}

/* ============ ANIMATIONS ============ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Form Row Animation */
.form-row {
  opacity: 0;
  animation: fadeInUp 0.5s ease-out forwards;
}

.form-row:nth-child(1) { animation-delay: 0.05s; }
.form-row:nth-child(2) { animation-delay: 0.1s; }
.form-row:nth-child(3) { animation-delay: 0.15s; }
.form-row:nth-child(4) { animation-delay: 0.2s; }
.form-row:nth-child(5) { animation-delay: 0.25s; }
.form-row:nth-child(6) { animation-delay: 0.3s; }
.form-row:nth-child(7) { animation-delay: 0.35s; }
.form-row:nth-child(8) { animation-delay: 0.4s; }

/* ============ UTILITY CLASSES ============ */
.w-100 { width: 100%; }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mt-auto { margin-top: auto; }

/* Hide default browser autofill styling */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.9) inset;
  -webkit-text-fill-color: var(--color-ink);
  transition: background-color 5000s ease-in-out 0s;
}

/* ============================================================
   RESPONSIVE / MOBILE STYLES
   ============================================================ */

/* Tablet breakpoint */
@media (max-width: 768px) {
  .auth-container {
    padding: var(--space-md);
    align-items: flex-start;
    padding-top: 80px;
  }
  
  .auth-box {
    max-width: 100%;
  }
  
  .navbar-logo {
    top: var(--space-md);
    left: var(--space-md);
  }
  
  .navbar-logo img {
    height: 36px;
  }
}

/* Mobile breakpoint - Natural form height (no flex stretching) */
@media (max-width: 480px) {
  .auth-container {
    padding: var(--space-md);
    padding-top: 80px;
    align-items: flex-start;
    min-height: 100vh;
  }
  
  .auth-box {
    max-width: 100%;
  }
  
  .mobile-form-container {
    padding: var(--space-4xl) var(--space-2xl);
    border-radius: var(--radius-lg);
  }
  
  .navbar-logo {
    top: var(--space-md);
    left: var(--space-md);
  }
  
  .navbar-logo img {
    height: 32px;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .auth-container {
    padding-top: 70px;
  }
  
  .mobile-form-container {
    padding: var(--space-lg) var(--space-md);
  }
  
  .navbar-logo img {
    height: 28px;
  }
}