/* ============================================
   WEGA ADS - Login Page Styles
   Dark theme with glass-morphism effects
   ============================================ */

/* --- RESET & BASE --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0a0a0f;
  color: #e0e0e0;
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- ANIMATED BACKGROUND --- */
.bg-animated {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  will-change: transform;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #667eea 0%, transparent 70%);
  top: -10%;
  left: -5%;
  animation: floatOrb1 18s ease-in-out infinite;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #764ba2 0%, transparent 70%);
  bottom: -10%;
  right: -5%;
  animation: floatOrb2 22s ease-in-out infinite;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #4facfe 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: floatOrb3 15s ease-in-out infinite;
  opacity: 0.18;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
}

@keyframes floatOrb1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(80px, 60px) scale(1.1); }
  66%      { transform: translate(-40px, 30px) scale(0.95); }
}

@keyframes floatOrb2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(-60px, -50px) scale(1.05); }
  66%      { transform: translate(50px, -30px) scale(0.9); }
}

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

/* --- MAIN WRAPPER --- */
.login-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}

/* --- BRAND --- */
.login-brand {
  text-align: center;
  margin-bottom: 2rem;
  animation: fadeSlideUp 0.7s ease-out;
}

.brand-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  margin-bottom: 1rem;
  box-shadow:
    0 4px 24px rgba(102, 126, 234, 0.35),
    0 0 60px rgba(118, 75, 162, 0.15);
  animation: pulseGlow 4s ease-in-out infinite;
}

.brand-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fff;
}

.brand-title span {
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.35rem;
  font-weight: 400;
  letter-spacing: 0.5px;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 4px 24px rgba(102, 126, 234, 0.35), 0 0 60px rgba(118, 75, 162, 0.15); }
  50%      { box-shadow: 0 4px 32px rgba(102, 126, 234, 0.5), 0 0 80px rgba(118, 75, 162, 0.25); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- LOGIN CARD (glass-morphism) --- */
.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 2rem;
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: fadeSlideUp 0.7s ease-out 0.15s both;
}

/* --- TAB SWITCHER --- */
.tab-switcher {
  display: flex;
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tab-btn {
  flex: 1;
  padding: 0.7rem 1rem;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.45);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 9px;
  transition: color 0.3s ease;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.tab-btn i {
  font-size: 0.8rem;
}

.tab-btn.active {
  color: #fff;
}

.tab-btn:hover:not(.active) {
  color: rgba(255, 255, 255, 0.7);
}

.tab-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 9px;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 12px rgba(102, 126, 234, 0.3);
}

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

/* --- TAB PANELS --- */
.tab-panel {
  display: none;
  animation: fadeIn 0.35s ease-out;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- FORM STYLES --- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0.45rem;
  letter-spacing: 0.3px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.25);
  transition: color 0.3s ease;
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 0.8rem 2.8rem 0.8rem 2.6rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.3s ease;
}

.input-wrapper input::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

.input-wrapper input:focus {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.06);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.input-wrapper input:focus ~ .input-icon,
.input-wrapper input:focus + .input-icon {
  color: #667eea;
}

.input-wrapper:has(input:focus) .input-icon {
  color: #667eea;
}

.input-wrapper input.error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.06);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-wrapper:has(input.error) .input-icon {
  color: #ef4444;
}

/* Toggle password button */
.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  padding: 4px;
  font-size: 0.85rem;
  transition: color 0.3s ease;
  line-height: 1;
}

.toggle-password:hover {
  color: rgba(255, 255, 255, 0.6);
}

/* Field error */
.field-error {
  display: block;
  font-size: 0.75rem;
  color: #ef4444;
  margin-top: 0.35rem;
  min-height: 1rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.25s ease;
}

.field-error.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- PASSWORD STRENGTH --- */
.password-strength {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.45rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.password-strength.visible {
  opacity: 1;
}

.strength-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: width 0.4s ease, background 0.4s ease;
}

.strength-fill.weak      { width: 33%; background: #ef4444; }
.strength-fill.medium    { width: 66%; background: #f59e0b; }
.strength-fill.strong    { width: 100%; background: #22c55e; }

.strength-label {
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 40px;
  color: rgba(255, 255, 255, 0.45);
}

.strength-label.weak   { color: #ef4444; }
.strength-label.medium { color: #f59e0b; }
.strength-label.strong { color: #22c55e; }

/* --- FORM OPTIONS --- */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  user-select: none;
}

.remember-me input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 16px;
  height: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.remember-me input:checked + .checkmark {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-color: transparent;
}

.remember-me input:checked + .checkmark::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.55rem;
  color: #fff;
}

.forgot-link {
  font-size: 0.8rem;
  color: #667eea;
  text-decoration: none;
  transition: color 0.25s ease;
}

.forgot-link:hover {
  color: #8b9cf7;
}

/* --- SUBMIT BUTTON --- */
.btn-submit {
  width: 100%;
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.btn-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #7b93f5, #8a5cb8);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-submit:hover::before {
  opacity: 1;
}

.btn-submit:active {
  transform: scale(0.985);
}

.btn-submit .btn-text,
.btn-submit .btn-loader {
  position: relative;
  z-index: 1;
}

.btn-submit .btn-loader {
  display: none;
}

.btn-submit.loading .btn-text {
  display: none;
}

.btn-submit.loading .btn-loader {
  display: inline-block;
}

.btn-submit.loading {
  pointer-events: none;
  opacity: 0.8;
}

/* --- FOOTER --- */
.login-footer {
  margin-top: 2rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.2);
  animation: fadeSlideUp 0.7s ease-out 0.3s both;
}

/* --- TOAST NOTIFICATIONS --- */
#toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  border-radius: 12px;
  background: rgba(20, 20, 30, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  min-width: 300px;
  max-width: 420px;
  pointer-events: auto;
  animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: top right;
}

.toast.removing {
  animation: toastOut 0.3s ease-in forwards;
}

.toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.toast.success .toast-icon { color: #22c55e; }
.toast.error   .toast-icon { color: #ef4444; }
.toast.warning .toast-icon { color: #f59e0b; }
.toast.info    .toast-icon { color: #667eea; }

.toast-message {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
  flex: 1;
}

.toast-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  padding: 2px;
  font-size: 0.75rem;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.toast-close:hover {
  color: rgba(255, 255, 255, 0.7);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 0 0 12px 12px;
  animation: toastProgress 4s linear forwards;
}

.toast.success .toast-progress { background: #22c55e; }
.toast.error   .toast-progress { background: #ef4444; }
.toast.warning .toast-progress { background: #f59e0b; }
.toast.info    .toast-progress { background: #667eea; }

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }
}

@keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}

/* --- RESPONSIVE --- */
@media (max-width: 480px) {
  .login-wrapper {
    padding: 1.5rem 1rem;
    justify-content: flex-start;
    padding-top: 3rem;
  }

  .login-card {
    padding: 1.5rem;
    border-radius: 16px;
  }

  .brand-icon {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
  }

  .brand-title {
    font-size: 1.6rem;
  }

  .tab-btn {
    font-size: 0.8rem;
    padding: 0.6rem 0.75rem;
  }

  .form-options {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  #toast-container {
    top: 1rem;
    right: 1rem;
    left: 1rem;
  }

  .toast {
    min-width: unset;
    max-width: unset;
  }

  .orb-1 { width: 300px; height: 300px; }
  .orb-2 { width: 250px; height: 250px; }
  .orb-3 { width: 180px; height: 180px; }
}

@media (max-width: 360px) {
  .login-card {
    padding: 1.25rem;
  }

  .btn-submit {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
}

/* --- ACCESSIBILITY --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .orb { animation: none !important; opacity: 0.15; }
}

:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}
