/* ============================================
   AUTH PAGES - MINIMALIST SAAS DESIGN SYSTEM
   Login & Signup Pages for FlipIQ
   ============================================ */

/* CSS Variables */
:root {
  /* Colors */
  --primary-purple: #7C3AED;
  --primary-purple-hover: #6D28D9;
  --primary-purple-light: #A78BFA;
  --purple-bg: #F5F3FF;
  --purple-bg-gradient: linear-gradient(135deg, #7C3AED 0%, #A78BFA 100%);

  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;

  --bg-white: #FFFFFF;
  --bg-gray-50: #F9FAFB;
  --bg-gray-100: #F3F4F6;

  --border-gray: #E5E7EB;
  --border-gray-dark: #D1D5DB;

  --success-green: #10B981;
  --success-bg: #ECFDF5;
  --error-red: #EF4444;
  --error-bg: #FEF2F2;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', sans-serif;

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-purple: 0 10px 20px rgba(124, 58, 237, 0.15);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-sans);
  background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Auth Container - Split Layout */
.auth-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  max-width: 1600px;
  margin: 0 auto;
}

/* Left Side - Branding */
.auth-brand {
  background: var(--purple-bg-gradient);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  overflow: hidden;
}

/* Decorative Elements */
.auth-brand::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
  top: -200px;
  left: -200px;
  animation: float 20s ease-in-out infinite;
}

.auth-brand::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
  bottom: -150px;
  right: -150px;
  animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 30px) scale(1.05); }
}

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

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

.brand-name {
  font-size: 36px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.5px;
}

.brand-tagline {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 48px;
  font-weight: 500;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 24px;
  text-align: left;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  color: white;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.feature-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(8px);
}

.feature-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  stroke-width: 2.5;
}

/* Right Side - Form */
.auth-form-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  background: var(--bg-white);
}

.auth-form-container {
  width: 100%;
  max-width: 440px;
}

.auth-header {
  margin-bottom: 40px;
}

.auth-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.auth-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Form Styles */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.forgot-link {
  font-size: 13px;
  color: var(--primary-purple);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

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

.input-icon {
  position: absolute;
  left: 16px;
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
  pointer-events: none;
  z-index: 1;
}

.form-input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  font-size: 15px;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-white);
  border: 1.5px solid var(--border-gray);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s ease;
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

.form-input:hover {
  border-color: var(--border-gray-dark);
}

.form-input:focus {
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
  background: var(--bg-white);
}

.form-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.checkbox-input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-purple);
  margin: 0;
}

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

/* Submit Button */
.submit-btn {
  width: 100%;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--purple-bg-gradient);
  color: white;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-sans);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-purple);
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}

.submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #6D28D9 0%, #8B5CF6 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(124, 58, 237, 0.25);
}

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

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

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

.btn-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.submit-btn:hover .btn-icon {
  transform: translateX(4px);
}

.submit-btn.loading .btn-icon {
  animation: spin 1s linear infinite;
}

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

/* Form Messages */
.form-message {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  display: none;
  animation: slideDown 0.3s ease;
}

.form-message:not(:empty) {
  display: block;
}

.form-message.success {
  color: var(--success-green);
  background: var(--success-bg);
  border: 1px solid var(--success-green);
}

.form-message.error {
  color: var(--error-red);
  background: var(--error-bg);
  border: 1px solid var(--error-red);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Footer */
.auth-footer {
  margin-top: 32px;
  text-align: center;
}

.footer-text {
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-link {
  color: var(--primary-purple);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

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

/* Divider */
.auth-divider {
  position: relative;
  margin: 32px 0;
  text-align: center;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-gray);
}

.divider-text {
  position: relative;
  display: inline-block;
  padding: 0 16px;
  background: var(--bg-white);
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* Social Buttons */
.social-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg-white);
  border: 1.5px solid var(--border-gray);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.social-btn:hover {
  background: var(--bg-gray-50);
  border-color: var(--border-gray-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

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

.social-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Terms Text */
.terms-text {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  line-height: 1.6;
}

.terms-link {
  color: var(--primary-purple);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet & Below (1024px) */
@media (max-width: 1024px) {
  .auth-container {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    display: none;
  }

  .auth-form-wrapper {
    padding: 60px 32px;
  }
}

/* Mobile (768px) */
@media (max-width: 768px) {
  .auth-form-wrapper {
    padding: 40px 24px;
  }

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

  .auth-title {
    font-size: 28px;
  }

  .auth-subtitle {
    font-size: 15px;
  }

  .auth-form {
    gap: 20px;
  }

  .form-input {
    padding: 13px 16px 13px 48px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .submit-btn {
    padding: 13px 20px;
  }

  .social-buttons {
    grid-template-columns: 1fr;
  }
}

/* Small Mobile (480px) */
@media (max-width: 480px) {
  .auth-form-wrapper {
    padding: 32px 20px;
  }

  .auth-title {
    font-size: 24px;
  }

  .auth-subtitle {
    font-size: 14px;
  }

  .form-input {
    padding: 12px 16px 12px 44px;
    font-size: 16px;
  }

  .input-icon {
    left: 14px;
    width: 18px;
    height: 18px;
  }

  .submit-btn {
    padding: 12px 18px;
    font-size: 15px;
  }

  .auth-footer {
    margin-top: 28px;
  }

  .auth-divider {
    margin: 28px 0;
  }
}

/* Extra Small Mobile (360px) */
@media (max-width: 360px) {
  .auth-form-wrapper {
    padding: 24px 16px;
  }

  .auth-title {
    font-size: 22px;
  }

  .form-label {
    font-size: 13px;
  }

  .form-input {
    padding: 11px 14px 11px 42px;
    font-size: 16px;
  }

  .submit-btn {
    padding: 11px 16px;
    font-size: 14px;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .auth-brand,
  .social-buttons,
  .auth-divider,
  .terms-text {
    display: none;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus Visible for Keyboard Navigation */
.form-input:focus-visible,
.submit-btn:focus-visible,
.social-btn:focus-visible,
.checkbox-input:focus-visible {
  outline: 2px solid var(--primary-purple);
  outline-offset: 2px;
}

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

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .form-input,
  .submit-btn,
  .social-btn {
    border-width: 2px;
  }
}
