/* ========================================
   MODERN PREMIUM SAAS LOGIN PAGE
   Union Social Analytics
   ======================================== */

/* Import Modern Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* CSS Variables */
:root {
  /* Premium Purple Gradient */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-alt: linear-gradient(to right, #4facfe 0%, #00f2fe 100%);

  /* Colors */
  --color-primary: #667eea;
  --color-primary-dark: #764ba2;
  --color-white: #ffffff;
  --color-text: #1a202c;
  --color-text-light: #718096;
  --color-border: #e2e8f0;
  --color-border-focus: #667eea;
  --color-error: #f56565;
  --color-success: #48bb78;

  /* Shadows */
  --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.3);
  --shadow-input: 0 0 0 3px rgba(102, 126, 234, 0.1);
  --shadow-button: 0 10px 20px rgba(102, 126, 234, 0.3);
  --shadow-button-hover: 0 15px 30px rgba(102, 126, 234, 0.4);

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;

  /* Spacing */
  --border-radius: 12px;
  --border-radius-input: 8px;
  --input-height: 48px;
}

/* ========================================
   ANIMATED GRADIENT BACKGROUND
   ======================================== */
.modern-login-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
}

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

/* Floating Background Shapes */
.bg-shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(40px);
  animation: float 20s infinite ease-in-out;
}

.bg-shape-1 {
  width: 400px;
  height: 400px;
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.bg-shape-2 {
  width: 300px;
  height: 300px;
  bottom: -50px;
  right: -50px;
  animation-delay: 7s;
}

.bg-shape-3 {
  width: 200px;
  height: 200px;
  top: 50%;
  right: 10%;
  animation-delay: 14s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.3;
  }
  33% {
    transform: translate(30px, -30px) scale(1.1);
    opacity: 0.5;
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
    opacity: 0.4;
  }
}

/* ========================================
   LOGIN CARD
   ======================================== */
.modern-login-card {
  background: var(--color-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 450px;
  border-top: 4px solid var(--color-primary);
  position: relative;
  z-index: 10;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-login-card.fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   LOGO SECTION
   ======================================== */
.login-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.logo-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.logo-icon:hover {
  transform: scale(1.05) rotate(-5deg);
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

/* ========================================
   HEADER SECTION
   ======================================== */
.modern-login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.modern-login-title {
  font-family: var(--font-primary);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.modern-login-subtitle {
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-light);
  margin: 0;
}

/* ========================================
   FORM STYLING
   ======================================== */
.modern-login-form {
  margin-top: 2rem;
}

/* Modern Form Group with Floating Labels */
.modern-form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.modern-form-input {
  width: 100%;
  height: var(--input-height);
  padding: 12px 16px;
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius-input);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  outline: none;
}

.modern-form-input:focus,
.modern-form-input.is-focused,
.modern-form-input.has-value {
  border-color: var(--color-border-focus);
  box-shadow: var(--shadow-input);
}

/* Floating Label */
.modern-form-label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-light);
  background: var(--color-white);
  padding: 0 4px;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-form-input:focus ~ .modern-form-label,
.modern-form-input.is-focused ~ .modern-form-label,
.modern-form-input.has-value ~ .modern-form-label {
  top: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
}

/* Animated Input Border */
.input-border {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
}

.modern-form-input:focus ~ .input-border {
  width: 100%;
}

/* ========================================
   CHECKBOX STYLING
   ======================================== */
.form-options-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.modern-checkbox-group {
  display: flex;
  align-items: center;
}

/* Hide default checkbox */
.modern-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.modern-checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

/* Custom Checkbox */
.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-radius: 4px;
  margin-right: 8px;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modern-checkbox:checked ~ .modern-checkbox-label .checkbox-custom {
  background: var(--gradient-primary);
  border-color: var(--color-primary);
}

.modern-checkbox:checked ~ .modern-checkbox-label .checkbox-custom::after {
  content: '✓';
  color: white;
  font-size: 14px;
  font-weight: 700;
}

.checkbox-text {
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

/* Forgot Password Link */
.forgot-password-link {
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  transition: all 0.3s ease;
}

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

/* ========================================
   PREMIUM BUTTON STYLING
   ======================================== */
.modern-login-button {
  width: 100%;
  height: var(--input-height);
  padding: 0 2rem;
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--color-white);
  background: var(--gradient-primary);
  background-size: 200% 100%;
  border: none;
  border-radius: var(--border-radius-input);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-button);
  position: relative;
  overflow: hidden;
}

.modern-login-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-button-hover);
  background-position: 100% 0;
}

.modern-login-button:active {
  transform: translateY(0);
}

/* Button Shine Effect */
.modern-login-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.modern-login-button:hover::before {
  left: 100%;
}

/* Loading Spinner */
.modern-login-button.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   SIGNUP PROMPT
   ======================================== */
.signup-prompt {
  margin-top: 2rem;
  text-align: center;
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-light);
}

.signup-link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

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

/* ========================================
   FOOTER
   ======================================== */
.modern-login-footer {
  text-align: center;
  margin-top: 2rem;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  position: relative;
  z-index: 10;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 640px) {
  .modern-login-container {
    padding: 1.5rem 1rem;
  }

  .modern-login-card {
    padding: 2rem 1.5rem;
    max-width: 95%;
  }

  .modern-login-title {
    font-size: 24px;
  }

  .modern-login-subtitle {
    font-size: 13px;
  }

  .logo-icon {
    width: 64px;
    height: 64px;
  }

  .form-options-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .forgot-password-link {
    margin-left: 0;
  }

  .bg-shape-1 {
    width: 250px;
    height: 250px;
  }

  .bg-shape-2 {
    width: 200px;
    height: 200px;
  }

  .bg-shape-3 {
    width: 150px;
    height: 150px;
  }
}

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

  .modern-login-title {
    font-size: 22px;
  }

  .modern-form-input,
  .modern-login-button {
    height: 44px;
  }
}

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

/* Focus styles for keyboard navigation */
.modern-form-input:focus-visible,
.modern-login-button:focus-visible,
.forgot-password-link:focus-visible,
.signup-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
  .modern-login-container {
    background: white;
  }

  .bg-shape {
    display: none;
  }

  .modern-login-card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
