/* ========================================
   AUTHENTICATION STYLES - SKEUOMORPHISM
   Modern Dark Theme with Deep 3D Effects
======================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700&display=swap');

/* CSS Variables */
:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #12122a;
  --bg-card: linear-gradient(145deg, #14142e, #0c0c1e);
  --bg-input: #0d0d20;
  --bg-input-hover: #10102a;
  
  --accent-primary: #7c3aed;
  --accent-primary-glow: rgba(124, 58, 237, 0.4);
  --accent-secondary: #a78bfa;
  --accent-tertiary: #c4b5fd;
  
  --text-primary: #ffffff;
  --text-secondary: #a5b4fc;
  --text-muted: #6b7280;
  --text-placeholder: #4b5563;
  
  --border-color: rgba(124, 58, 237, 0.2);
  --border-focus: rgba(124, 58, 237, 0.6);
  
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-deep: 0 10px 40px rgba(0, 0, 0, 0.5),
                 0 0 80px rgba(124, 58, 237, 0.1);
  --shadow-inner: inset 2px 2px 8px rgba(0, 0, 0, 0.4),
                  inset -2px -2px 8px rgba(255, 255, 255, 0.02);
  --shadow-pressed: inset 3px 3px 10px rgba(0, 0, 0, 0.6),
                    inset -3px -3px 10px rgba(255, 255, 255, 0.03);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Animated Background */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  background: var(--bg-primary);
}

.auth-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(167, 139, 250, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(15, 15, 35, 1) 0%, var(--bg-primary) 100%);
  z-index: -2;
  animation: bgPulse 15s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0% { opacity: 1; }
  50% { opacity: 0.8; }
  100% { opacity: 1; }
}

/* Floating Particles */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent-secondary);
  border-radius: 50%;
  opacity: 0.3;
  animation: float 20s infinite ease-in-out;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 25s; }
.particle:nth-child(2) { left: 20%; animation-delay: -5s; animation-duration: 20s; }
.particle:nth-child(3) { left: 30%; animation-delay: -10s; animation-duration: 28s; }
.particle:nth-child(4) { left: 40%; animation-delay: -15s; animation-duration: 22s; }
.particle:nth-child(5) { left: 50%; animation-delay: -2s; animation-duration: 26s; }
.particle:nth-child(6) { left: 60%; animation-delay: -8s; animation-duration: 24s; }
.particle:nth-child(7) { left: 70%; animation-delay: -12s; animation-duration: 21s; }
.particle:nth-child(8) { left: 80%; animation-delay: -18s; animation-duration: 27s; }
.particle:nth-child(9) { left: 90%; animation-delay: -4s; animation-duration: 23s; }
.particle:nth-child(10) { left: 15%; animation-delay: -7s; animation-duration: 19s; }

@keyframes float {
  0%, 100% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.5;
  }
  95% {
    transform: translateY(-10vh) scale(1);
    opacity: 0;
  }
}

/* Glowing Orbs */
.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  animation: orbFloat 10s ease-in-out infinite;
}

.glow-orb-1 {
  width: 400px;
  height: 400px;
  background: rgba(124, 58, 237, 0.2);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.glow-orb-2 {
  width: 300px;
  height: 300px;
  background: rgba(167, 139, 250, 0.15);
  bottom: -50px;
  left: -50px;
  animation-delay: -5s;
}

.glow-orb-3 {
  width: 200px;
  height: 200px;
  background: rgba(196, 181, 253, 0.1);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -2.5s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.1); }
  50% { transform: translate(-20px, 20px) scale(0.9); }
  75% { transform: translate(20px, 30px) scale(1.05); }
}

/* Auth Container */
.auth-container {
  width: 100%;
  max-width: 900px;
  animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Auth Card - Main Form Container */
.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-deep);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.5), transparent);
}

.auth-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top center, rgba(124, 58, 237, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

/* Logo Section */
.auth-logo {
  text-align: center;
  margin-bottom: 30px;
  position: relative;
  z-index: 1;
}

.auth-logo img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  object-fit: cover;
  box-shadow: 0 0 30px var(--accent-primary-glow);
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { box-shadow: 0 0 30px var(--accent-primary-glow); }
  50% { box-shadow: 0 0 50px var(--accent-primary-glow), 0 0 80px rgba(124, 58, 237, 0.2); }
}

.auth-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: 15px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-tertiary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 8px;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  position: relative;
  z-index: 1;
}

.form-grid .full-width {
  grid-column: span 2;
}

.form-grid .one-third {
  grid-column: span 1;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .form-grid .full-width,
  .form-grid .one-third {
    grid-column: span 1;
  }
}

/* Form Group */
.form-group {
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  transition: var(--transition-fast);
}

/* Skeuomorphic Input Styling */
.form-input {
  width: 100%;
  padding: 14px 18px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-inner);
  transition: var(--transition-smooth);
  outline: none;
}

.form-input::placeholder {
  color: var(--text-placeholder);
}

.form-input:hover {
  background: var(--bg-input-hover);
  border-color: rgba(124, 58, 237, 0.3);
}

.form-input:focus {
  background: var(--bg-input-hover);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-inner),
              0 0 0 3px rgba(124, 58, 237, 0.15),
              0 0 20px rgba(124, 58, 237, 0.1);
}

.form-input:focus + .input-glow {
  opacity: 1;
}

/* Input with Icon */
.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  transition: var(--transition-fast);
  pointer-events: none;
}

.input-wrapper .form-input {
  padding-left: 46px;
}

.input-wrapper:focus-within .input-icon {
  color: var(--accent-secondary);
}

/* Input Action Button (e.g., Copy, Toggle Password) */
.input-action {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 58, 237, 0.1);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.input-action:hover {
  background: rgba(124, 58, 237, 0.2);
  color: var(--accent-secondary);
}

/* Select Dropdown */
.form-select {
  width: 100%;
  padding: 14px 18px;
  padding-right: 45px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-inner);
  transition: var(--transition-smooth);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 24px;
}

.form-select:hover {
  background-color: var(--bg-input-hover);
  border-color: rgba(124, 58, 237, 0.3);
}

.form-select:focus {
  background-color: var(--bg-input-hover);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-inner),
              0 0 0 3px rgba(124, 58, 237, 0.15);
}

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 10px;
}

/* Auto-generated Field Styling */
.auto-field {
  position: relative;
}

.auto-field .form-input {
  background: rgba(124, 58, 237, 0.05);
  border-color: rgba(124, 58, 237, 0.3);
}

.auto-badge {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.auto-field .form-input {
  padding-left: 54px;
}

/* Checkbox Styling */
.form-checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.form-checkbox {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 2px;
  appearance: none;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  box-shadow: var(--shadow-inner);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.form-checkbox:hover {
  border-color: rgba(124, 58, 237, 0.5);
}

.form-checkbox:checked {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px var(--accent-primary-glow);
}

.form-checkbox:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 7px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Info Note */
.info-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(124, 58, 237, 0.08);
  border-radius: var(--radius-md);
  border: 1px solid rgba(124, 58, 237, 0.2);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.info-note i {
  color: var(--accent-secondary);
}

/* Submit Button */
.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 40px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: white;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 20px var(--accent-primary-glow),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.btn-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-primary-glow),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-submit:hover::before {
  left: 100%;
}

.btn-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px var(--accent-primary-glow),
              inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Footer Actions */
.auth-footer {
  text-align: center;
  margin-top: 30px;
  padding-top: 25px;
  border-top: 1px solid rgba(124, 58, 237, 0.15);
  position: relative;
  z-index: 1;
}

.auth-footer p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.auth-footer a {
  color: var(--accent-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-fast);
}

.auth-footer a:hover {
  color: var(--accent-tertiary);
  text-decoration: underline;
}

/* Loading State */
.btn-submit.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn-submit.loading .btn-text {
  opacity: 0;
}

.btn-submit .spinner {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  opacity: 0;
  animation: spin 0.8s linear infinite;
}

.btn-submit.loading .spinner {
  opacity: 1;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Success Animation */
@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.success-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(16, 185, 129, 0.1));
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-md);
  color: #4ade80;
  font-weight: 500;
  animation: successPulse 0.5s ease-out;
}

.error-message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.1));
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  color: #f87171;
  font-weight: 500;
}

/* Password Strength Indicator */
.password-strength {
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: var(--transition-smooth);
}

.password-strength-bar.weak { width: 33%; background: #ef4444; }
.password-strength-bar.medium { width: 66%; background: #f59e0b; }
.password-strength-bar.strong { width: 100%; background: #22c55e; }

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 25px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

/* Responsive Adjustments */
@media (max-width: 600px) {
  .auth-card {
    padding: 30px 20px;
    border-radius: var(--radius-lg);
  }
  
  .auth-title {
    font-size: 1.5rem;
  }
  
  .btn-submit {
    width: 100%;
    padding: 14px;
  }
}

/* Page Transition */
.page-enter {
  animation: pageEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Three Column Layout for certain fields */
@media (min-width: 769px) {
  .form-grid.three-cols {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .form-grid.three-cols .one-third {
    grid-column: span 1;
  }
}

/* Triple Row Helper */
.triple-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 768px) {
  .triple-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ===========================================
   LOGIN PAGE SPECIFIC STYLES
=========================================== */

.login-card {
  max-width: 480px;
  margin: 0 auto;
}

.login-card .auth-logo img {
  width: 100px;
  height: 100px;
}

.login-features {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.login-feature i {
  color: var(--accent-secondary);
}

/* Remember Me & Forgot Password Row */
.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
}

.forgot-link {
  color: var(--accent-secondary);
  font-size: 0.9rem;
  text-decoration: none;
  transition: var(--transition-fast);
}

.forgot-link:hover {
  color: var(--accent-tertiary);
  text-decoration: underline;
}

/* Social Login */
.social-login {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-inner);
}

.btn-social:hover {
  background: var(--bg-input-hover);
  border-color: rgba(124, 58, 237, 0.4);
  color: var(--text-primary);
  transform: translateY(-2px);
}
