/* public/css/login.css */
/* SchoolBridge Tenant Login Styles */

/* CSS design tokens */
:root {
  --primary-color: #0052CC;
  --primary-light: #0066FF;
  --secondary-color: #06D6A0;
  --bg-base: #E8ECEF;
  --white: #ffffff;
  --gray-300: #CED4DA;
  --gray-400: #9AA6B2;
  --danger: #DC3545;
  --success: #06D6A0;
  --warning: #FFB703;
  --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --radius-3xl: 2rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
}

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

html, body { 
  height: 100%; 
  font-family: var(--font-family); 
}

/* Body */
body {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 50%, var(--secondary-color) 100%);
  display: flex; 
  align-items: center; 
  justify-content: center;
  padding: var(--space-4);
  min-height: 100vh; 
  color: #111827;
}

/* Container */
.login-container {
  display: flex; 
  width: 100%; 
  max-width: 1000px; 
  min-height: 550px;
  background: var(--bg-base); 
  border-radius: var(--radius-3xl);
  overflow: hidden; 
  box-shadow: -8px -8px 16px rgba(255, 255, 255, 0.8), 8px 8px 16px rgba(0, 82, 204, 0.2);
}

/* Left side - Form section */
.login-form-section { 
  flex: 1; 
  padding: var(--space-12); 
  display: flex; 
  align-items: center; 
  justify-content: center; 
}

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

/* Login header - CENTERED */
.login-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

/* USER LOGIN badge - CENTERED with proper spacing */
.user-login-badge { 
  display: inline-block; 
  padding: var(--space-3) var(--space-8); 
  background: linear-gradient(135deg, #FF6B9D, #C44569); 
  color: var(--white); 
  font-size: 1.25rem;
  font-weight: 600; 
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: -4px -4px 8px rgba(255, 255, 255, 0.3), 4px 4px 8px rgba(0, 82, 204, 0.2);
}

/* Right side - Branding section with proper spacing */
.branding-section { 
  flex: 1; 
  padding: var(--space-12); 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  flex-direction: column;
  background: linear-gradient(135deg, rgba(0, 82, 204, 0.95), rgba(0, 102, 255, 0.95) 50%, rgba(6, 214, 160, 0.95)); 
  color: white; 
  text-align: center;
}

.branding-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* Logo - CENTERED */
.logo { 
  width: 100px; 
  height: 100px; 
  background: white; 
  border-radius: var(--radius-xl); 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  margin: 0 auto var(--space-6);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2); 
}

.logo i {
  font-size: 3rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Brand title with proper spacing */
.brand-title { 
  font-size: 1.875rem; 
  font-weight: 700; 
  margin-bottom: var(--space-3);
  letter-spacing: -0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Brand subtitle with bottom spacing */
.brand-subtitle { 
  font-weight: 300;
  font-size: 1rem;
  opacity: 0.95;
  margin-bottom: var(--space-6);
}

/* Alerts */
.alert { 
  padding: var(--space-4); 
  border-radius: var(--radius-xl); 
  margin-bottom: var(--space-6); 
  display: flex; 
  gap: var(--space-3); 
  align-items: flex-start;
  font-size: 0.875rem;
  font-weight: 500;
}

.alert i {
  font-size: 1.125rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-success { 
  background: rgba(6, 214, 160, 0.1); 
  color: #047857; 
  border-left: 4px solid var(--success); 
}

.alert-danger { 
  background: rgba(220, 53, 69, 0.1); 
  color: #991b1b; 
  border-left: 4px solid var(--danger); 
}

.alert-warning { 
  background: rgba(255, 183, 3, 0.1); 
  color: #92400e; 
  border-left: 4px solid var(--warning); 
}

/* Form elements */
.form-group { 
  margin-bottom: var(--space-6); 
}

.input-group { 
  position: relative; 
}

.form-control {
  width: 100%; 
  padding: 1rem 3.5rem 1rem 1.25rem;
  font-size: 1rem; 
  font-family: var(--font-family);
  color: #374151;
  border-radius: var(--radius-full);
  border: none; 
  background: var(--bg-base); 
  outline: none; 
  box-shadow: inset -4px -4px 8px rgba(255, 255, 255, 0.5), inset 4px 4px 8px rgba(0, 82, 204, 0.15);
  transition: all 0.2s ease;
}

.form-control::placeholder {
  color: var(--gray-400);
  font-weight: 300;
}

.form-control:focus {
  box-shadow: inset -4px -4px 8px rgba(255, 255, 255, 0.5), inset 4px 4px 8px rgba(0, 82, 204, 0.15), 0 0 0 3px rgba(0, 82, 204, 0.1);
}

.form-control.error {
  box-shadow: inset -4px -4px 8px rgba(255, 255, 255, 0.5), inset 4px 4px 8px rgba(0, 82, 204, 0.15), 0 0 0 2px rgba(220, 53, 69, 0.3);
}

/* Input icons - for email field only */
.input-icon { 
  position: absolute; 
  right: 1.25rem; 
  top: 50%; 
  transform: translateY(-50%); 
  color: var(--gray-400);
  font-size: 1.125rem;
  pointer-events: none;
  z-index: 1;
}

/* Password toggle - SINGLE icon, properly positioned */
.password-toggle { 
  position: absolute; 
  right: 1.25rem; 
  top: 50%; 
  transform: translateY(-50%); 
  cursor: pointer; 
  color: var(--gray-400);
  font-size: 1.125rem;
  padding: var(--space-2);
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  z-index: 2;
}

.password-toggle:hover {
  color: var(--primary-color);
  background: rgba(0, 82, 204, 0.05);
}

/* Error messages */
.error-message { 
  display: none; 
  color: var(--danger); 
  font-size: 0.75rem; 
  font-weight: 500;
  margin-top: var(--space-2); 
  padding-left: var(--space-4); 
}

.error-message.show { 
  display: block; 
}

/* Form footer */
.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.remember-me {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

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

.checkbox-label {
  font-size: 0.875rem;
  color: #6B7280;
  cursor: pointer;
  user-select: none;
  margin: 0;
}

.forgot-link {
  font-size: 0.875rem;
  color: #6B7280;
  text-decoration: none;
  font-weight: 400;
  transition: color 0.2s ease;
}

.forgot-link:hover {
  color: var(--primary-color);
}

/* Buttons */
.btn { 
  width: 100%; 
  padding: 1rem; 
  border: none;
  border-radius: var(--radius-full); 
  font-size: 1rem;
  font-weight: 600; 
  font-family: var(--font-family);
  cursor: pointer;
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: var(--space-2); 
  text-transform: uppercase; 
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary { 
  background: linear-gradient(135deg, var(--secondary-color), #00D4FF); 
  color: white; 
  box-shadow: -6px -6px 12px rgba(255, 255, 255, 0.9), 6px 6px 12px rgba(0, 82, 204, 0.25); 
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: -8px -8px 16px rgba(255, 255, 255, 0.9), 8px 8px 20px rgba(0, 82, 204, 0.3);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: inset -4px -4px 8px rgba(255, 255, 255, 0.5), inset 4px 4px 8px rgba(0, 82, 204, 0.15);
}

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

.btn.loading .btn-text {
  opacity: 0;
}

.btn-spinner { 
  position: absolute;
  width: 22px; 
  height: 22px; 
  border: 3px solid rgba(255, 255, 255, 0.3); 
  border-top-color: white; 
  border-radius: 50%; 
  display: none; 
  animation: spin 0.8s linear infinite; 
}

.btn.loading .btn-spinner { 
  display: block; 
}

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

/* Divider */
.divider { 
  display: flex; 
  align-items: center; 
  gap: var(--space-3); 
  margin: var(--space-6) 0 var(--space-4) 0; 
}

.divider::before, 
.divider::after { 
  content: ''; 
  flex: 1; 
  height: 1px; 
  background: var(--gray-300); 
}

.divider-text {
  font-size: 0.75rem;
  color: #6B7280;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Google Login Button - Google Brand Colors */
.google-btn {
  margin-top: 0;
  background: white;
  color: #3C4043;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  gap: var(--space-3);
  border: 1px solid #DADCE0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.google-btn i {
  font-size: 1.25rem;
  background: linear-gradient(135deg, #4285F4 0%, #34A853 25%, #FBBC05 50%, #EA4335 75%, #4285F4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.google-btn:hover:not(:disabled) {
  background: #F8F9FA;
  border-color: #DADCE0;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.18);
}

.google-btn:active:not(:disabled) {
  background: #F1F3F4;
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* Responsive design */
@media (max-width: 900px) { 
  .login-container {
    flex-direction: column-reverse; 
    max-width: 500px;
  }
  
  .login-form-section {
    padding: var(--space-8);
  }
  
  .branding-section {
    padding: var(--space-8);
    min-height: 250px;
  }
  
  .brand-title {
    font-size: 1.5rem;
  }
  
  .brand-subtitle {
    font-size: 0.875rem;
  }
  
  .logo {
    width: 80px;
    height: 80px;
  }
  
  .logo i {
    font-size: 2.5rem;
  }
}

@media (max-width: 480px) { 
  body {
    padding: var(--space-3);
  }
  
  .login-container {
    border-radius: 1.5rem;
  }
  
  .login-form-section {
    padding: var(--space-6);
  }
  
  .branding-section {
    padding: var(--space-6);
    min-height: 200px;
  }
  
  .logo {
    width: 60px;
    height: 60px;
    margin-bottom: var(--space-4);
  }
  
  .logo i {
    font-size: 2rem;
  }
  
  .brand-title {
    font-size: 1.25rem;
  }
  
  .brand-subtitle {
    font-size: 0.75rem;
  }
  
  .user-login-badge {
    font-size: 1rem;
    padding: var(--space-2) var(--space-6);
  }
  
  .form-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Accessibility */
*:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

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