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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #374151;
  background: #f8fafc;
}

/* Login Page Styles */
.login-container {
  min-height: 100vh;
  display: flex;
}

/* Left Side - Illustration */
.login-left {
    display: none;
    width: 50%;
    background: linear-gradient(135deg, #c5fff7 0%, #dbeafe 100%);
    justify-content: center;
    align-items: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.login-left-content {
  max-width: 28rem;
  text-align: center;
  z-index: 10;
}

.login-left h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1baf98;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.login-left p {
  font-size: 1.125rem;
  color: #6b7280;
  margin-bottom: 2rem;
  font-weight: 400;
}

/* Illustration */
.illustration-container {
  position: relative;
}

.illustration-main {
  width: 16rem;
  height: 16rem;
  margin: 0 auto;
  position: relative;
}

.chart-card {
  position: absolute;
  inset: 0;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  padding: 1.5rem;
  transform: rotate(3deg);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
}

.chart-bar {
  width: 2rem;
  border-radius: 0.25rem 0.25rem 0 0;
  transition: transform 0.3s ease;
}

.chart-bar:hover {
  transform: translateY(-2px);
}

.chart-bar-1 {
  height: 40%;
  background: linear-gradient(to top, #a78bfa, #c4b5fd);
}

.chart-bar-2 {
  height: 70%;
  background: linear-gradient(to top, #60a5fa, #93c5fd);
}

.chart-bar-3 {
  height: 55%;
  background: linear-gradient(to top, #a78bfa, #c4b5fd);
}

.chart-bar-4 {
  height: 85%;
  background: linear-gradient(to top, #60a5fa, #93c5fd);
}

.lightbulb {
  position: absolute;
  top: -1rem;
  left: -1rem;
  width: 4rem;
  height: 4rem;
  background: #fef3c7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.lightbulb-inner {
  width: 2rem;
  height: 2rem;
  background: #fbbf24;
  border-radius: 50%;
  position: relative;
}

.lightbulb-inner::after {
  content: '';
  position: absolute;
  inset: 0.25rem;
  background: #fde68a;
  border-radius: 50%;
}

.pie-chart {
  position: absolute;
  bottom: -0.5rem;
  right: -0.5rem;
  width: 5rem;
  height: 5rem;
  background: white;
  border-radius: 50%;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  padding: 0.5rem;
}

.pie-chart-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid #a78bfa;
  border-top-color: #60a5fa;
  border-right-color: #60a5fa;
  animation: spin 3s linear infinite;
}

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

/* Background decoration */
.bg-decoration {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.1;
}

.bg-circle-1 {
  position: absolute;
  top: 5rem;
  left: 2.5rem;
  width: 8rem;
  height: 8rem;
  background: #c4b5fd;
  border-radius: 50%;
}

.bg-circle-2 {
  position: absolute;
  bottom: 5rem;
  right: 2.5rem;
  width: 6rem;
  height: 6rem;
  background: #93c5fd;
  border-radius: 50%;
}

/* Right Side - Login Form */
.login-right {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #f0f4ff;
}

.login-form-container {
  width: 100%;
  max-width: 28rem;
}

/* Logo and Title */
.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.logo-icon {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  padding: 0.75rem;
  border-radius: 50%;
  box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
}

.login-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.login-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 400;
}

/* Social Login Buttons */
.social-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.social-button {
  width: 100%;
  height: 3rem;
  border: 1px solid;
  border-radius: 0.5rem;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-size: 0.875rem;
}

.google-button {
  border-color: #fecaca;
  color: #dc2626;
}

.google-button:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

.facebook-button {
  border-color: #bfdbfe;
  color: #2563eb;
}

.facebook-button:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.social-icon {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.75rem;
}

/* Divider */
.divider {
  position: relative;
  margin-bottom: 1.5rem;
}

.divider-line {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
}

.divider-border {
  width: 100%;
  border-top: 1px solid #e5e7eb;
}

.divider-text {
  position: relative;
  display: flex;
  justify-content: center;
  font-size: 0.875rem;
}

.divider-label {
  background: white;
  padding: 0 1rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  font-size: 0.75rem;
}

/* Login Tabs */
.login-tabs {
  display: flex;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
  border-radius: 0.5rem 0.5rem 0 0;
}

.tab-button {
  flex: 1;
  padding: 0.75rem 1rem;
  text-align: center;
  font-weight: 500;
  font-size: 0.875rem;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  border-radius: 0.5rem 0.5rem 0 0;
}

.tab-active {
  color: #3b82f6;
  background: white;
  border-bottom: 2px solid #3b82f6;
  font-weight: 600;
}

.tab-inactive {
  color: #6b7280;
}

.tab-inactive:hover {
  color: #374151;
  background: #f1f5f9;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

/* Checkbox styles for terms agreement */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  cursor: pointer;
}

.checkbox-input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: #3b82f6;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.checkbox-text {
  color: #6b7280;
  flex: 1;
}

.terms-link {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.terms-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  display: block;
}

.input-container {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  color: #9ca3af;
  transition: color 0.2s ease;
}

.form-input {
  padding-left: 2.5rem;
  height: 3rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: #f9fafb;
  width: 100%;
  font-size: 1rem;
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: white;
}

.form-input:focus + .input-icon {
  color: #3b82f6;
}

.password-input {
  padding-right: 2.5rem;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
  padding: 0.25rem;
  border-radius: 0.25rem;
}

.password-toggle:hover {
  color: #6b7280;
  background: #f3f4f6;
}

.forgot-password {
  text-align: left;
}

.forgot-link {
  font-size: 0.875rem;
  color: #3b82f6;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
  font-weight: 500;
}

.forgot-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Submit Button */
.submit-button {
    width: 100%;
    height: 3rem;
    background: linear-gradient(135deg, #1d4ed8, #1ab394);
    color: white;
    font-weight: 600;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    letter-spacing: 0.025em;
}

.submit-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.submit-button:active:not(:disabled) {
  transform: translateY(0);
}

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

/* Sign Up Link */
.signup-link {
  text-align: center;
  margin-top: 1.5rem;
}

.signup-text {
  font-size: 0.875rem;
  color: #6b7280;
}

.signup-button {
  color: #3b82f6;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.signup-button:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Loading State */
.loading {
  position: relative;
  color: transparent;
}

.loading::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  top: 50%;
  left: 50%;
  margin-left: -0.5rem;
  margin-top: -0.5rem;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Error and Success Messages */
.error-message {
  animation: slideIn 0.3s ease-out;
}

.success-message {
  animation: slideIn 0.3s ease-out;
}

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

/* Form transitions */
.form-group {
  transition: all 0.3s ease;
}

/* Signup mode specific styles */
#nameGroup,
#confirmPasswordGroup {
  animation: fadeIn 0.3s ease-out;
}

#termsGroup {
  animation: fadeIn 0.3s ease-out;
  margin-top: 0.5rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
  }
  to {
    opacity: 1;
    max-height: 100px;
    margin-bottom: 1.25rem;
  }
}

/* Responsive Design */
@media (min-width: 1024px) {
  .login-left {
    display: flex;
  }
  
  .login-right {
    width: 50%;
  }
}

@media (max-width: 768px) {
  .login-right {
    padding: 1.5rem;
  }
  
  .login-form-container {
    max-width: 24rem;
  }
  
  .login-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 640px) {
  .login-right {
    padding: 1rem;
  }
  
  .login-left h1 {
    font-size: 1.875rem;
  }
  
  .illustration-main {
    width: 12rem;
    height: 12rem;
  }
  
  .login-form-container {
    max-width: 20rem;
  }
  
  .social-buttons {
    gap: 0.5rem;
  }
  
  .social-button {
    height: 2.75rem;
    font-size: 0.8125rem;
  }
}

/* Focus visible for accessibility */
.tab-button:focus-visible,
.social-button:focus-visible,
.form-input:focus-visible,
.password-toggle:focus-visible,
.forgot-link:focus-visible,
.submit-button:focus-visible,
.signup-button:focus-visible,
.checkbox-input:focus-visible,
.terms-link:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .form-input {
    border-width: 2px;
  }
  
  .submit-button {
    border: 2px solid #1d4ed8;
  }
}

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