/* === LOGIN PAGE ROOT VARIABLES === */
:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary-color: #10b981;
  --accent-color: #f59e0b;
  --text-dark: #1f2937;
  --text-gray: #6b7280;
  --text-light: #9ca3af;
  --bg-white: #ffffff;
  --bg-gray-50: #f9fafb;
  --bg-gray-100: #f3f4f6;
  --border-gray: #e5e7eb;
  --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);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* === LOGIN PAGE BODY STYLES === */
body:has(.login-split-container) {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Fallback for browsers that don't support :has() */
.login-page-body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* === LOGIN SPLIT SCREEN DESIGN === */
.login-split-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Left Panel - Marketing Content */
.login-marketing-panel {
  flex: 1;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.login-marketing-panel::-webkit-scrollbar {
  display: none;
}

.login-marketing-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.marketing-content {
  position: relative;
  color: white;
  max-width: 500px;
  text-align: left;
  animation: slideInLeft 0.6s ease-out;
}

.marketing-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 3rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.marketing-logo:hover {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

.marketing-logo i {
  font-size: 2rem;
  color: #fff;
}

.marketing-hero {
  margin-bottom: 3rem;
}

.marketing-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 0%, #e0e7ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.marketing-subtitle {
  font-size: 1.1rem;
  line-height: 1.6;
  opacity: 0.9;
  margin-bottom: 0;
}

.marketing-features {
  margin-bottom: 3rem;
}

 .login-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  animation: fadeIn 0.8s ease-out;
  animation-fill-mode: both;
}

 .login-feature-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

 .login-feature-item:nth-child(1) { animation-delay: 0.1s; }
 .login-feature-item:nth-child(2) { animation-delay: 0.2s; }
 .login-feature-item:nth-child(3) { animation-delay: 0.3s; }

 .login-feature-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

 .login-feature-icon i {
  font-size: 1.5rem;
  color: white;
}

 .login-feature-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: white;
}

 .login-feature-content p {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 0;
  line-height: 1.4;
}

.marketing-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: fadeIn 0.6s ease-out;
  animation-fill-mode: both;
}

.marketing-stats .stat-item:nth-child(1) { animation-delay: 0.4s; }
.marketing-stats .stat-item:nth-child(2) { animation-delay: 0.5s; }
.marketing-stats .stat-item:nth-child(3) { animation-delay: 0.6s; }

.stat-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  margin-top: 0.25rem;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Right Panel - Login Form */
.login-form-panel {
  flex: 1;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

.login-form-container {
  width: 100%;
  max-width: 400px;
  animation: slideInUp 0.6s ease-out;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: #64748b;
  font-size: 1rem;
  margin-bottom: 0;
}

/* Logo mobile */
.login-logo-mobile {
  display: none;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
}

.login-logo-mobile a {
  font-size: 2rem !important;
  color: var(--primary-color) !important;
  text-decoration: none !important;
  font-family: 'Montserrat', 'Poppins', Arial, sans-serif;
  font-weight: 900;
  letter-spacing: 1.5px;
  background: none;
  line-height: 1;
}

.login-logo-mobile .logo-dot-ext {
  color: var(--primary-dark);
  font-size: 2.3rem;
  margin-left: 0.05em;
}

/* Logo white variant */
.logo-login-white {
  color: #fff !important;
  text-shadow: 0 2px 12px rgba(0,0,0,0.10);
  cursor: pointer;
}

.logo-login-white .logo-dot-ext {
  color: #fff !important;
}

.logo-login-white:hover, .logo-login-white:focus {
  color: #fff !important;
  text-decoration: none;
  filter: brightness(1.08);
}

/* === FLASH MESSAGES === */
.flash-messages {
  margin-bottom: 1.5rem;
}

.flash-messages .alert {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  border: none;
  margin-bottom: 0.5rem;
}

.alert-danger {
  background: #fef2f2;
  color: #dc2626;
}

.alert-success {
  background: linear-gradient(90deg, #d1fae5 0%, #6ee7b7 100%);
  color: #065f46;
  border: 1.5px solid #34d399;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 1.08rem;
  box-shadow: 0 2px 12px 0 rgba(16, 185, 129, 0.10);
  padding: 1.1rem 1.5rem 1.1rem 1.1rem;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.7em;
  animation: fadeIn 0.7s cubic-bezier(.4,0,.2,1);
}

.alert-success i {
  color: #059669;
  font-size: 1.7em;
  margin-right: 0.5em;
  flex-shrink: 0;
}

/* Bootstrap utility classes */
.d-flex {
  display: flex !important;
}

.align-items-center {
  align-items: center !important;
}

.me-2 {
  margin-right: 0.5rem !important;
}

/* === FORM STYLES === */
.login-form {
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

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

.input-wrapper {
  position: relative;
}

.input-wrapper:hover .input-icon {
  color: #667eea;
  transition: color 0.2s ease;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 1rem;
  z-index: 1;
}

.form-control {
  width: 100%;
  padding: 12px 16px 12px 40px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #fafafa;
  font-family: inherit;
}

.form-control:hover {
  border-color: #d1d5db;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: #667eea;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.password-toggle:hover {
  color: #667eea;
}

.password-toggle:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.remember-me input[type="checkbox"] {
  margin: 0;
}

.forgot-password {
  color: #667eea;
  text-decoration: none;
  transition: color 0.2s ease;
}

.forgot-password:hover {
  color: #5a67d8;
  text-decoration: underline;
}

/* === BUTTONS === */
.btn-login-primary {
  width: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.btn-login-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn-login-primary:hover::before {
  left: 100%;
}

.btn-login-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

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

.btn-login-primary:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.btn-login-primary.loading {
  pointer-events: none;
  position: relative;
}

.btn-login-primary.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  margin: auto;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: button-loading-spinner 1s ease infinite;
}

@keyframes button-loading-spinner {
  from {
    transform: rotate(0turn);
  }
  to {
    transform: rotate(1turn);
  }
}

.login-divider {
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
}

.login-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e5e7eb;
}

.login-divider span {
  background: white;
  padding: 0 1rem;
  color: #9ca3af;
  font-size: 0.9rem;
  position: relative;
}

.register-section {
  text-align: center;
  margin-bottom: 1.5rem;
}

.register-text {
  color: #64748b;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.btn-register-secondary {
  display: inline-block;
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  padding: 8px 16px;
  border: 2px solid #667eea;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.btn-register-secondary:hover {
  background: #667eea;
  color: white;
  text-decoration: none;
}

.btn-register-secondary:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.login-footer {
  text-align: center;
}

.terms-text {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 0;
  line-height: 1.4;
}

.terms-link {
  color: #667eea;
  text-decoration: none;
}

.terms-link:hover {
  text-decoration: underline;
}

/* === FORM VALIDATION STATES === */
.form-control.is-valid {
  border-color: #22c55e;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2322c55e' d='m2.3 6.73.94-.94 1.42 1.42L7.83 4.04l-.94-.94L4.66 5.33z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

.form-control.is-invalid {
  border-color: #ef4444;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m6 3v4m0 2h.01'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #ef4444;
}

.valid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #22c55e;
}

/* === ANIMATIONS === */
@keyframes slideInUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-30px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
  .login-split-container {
    flex-direction: column;
    min-height: 100vh;
  }
  
  .login-marketing-panel {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .login-form-panel {
    width: 100% !important;
    min-width: 0;
    max-width: 100vw;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    background: var(--bg-white);
    box-shadow: none;
  }
  
  .login-form-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 2.5rem 1.2rem 1.5rem 1.2rem;
    box-shadow: none;
    background: transparent;
    margin-top: 6.2rem !important;
  }
  
  .login-form-container .login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
  }
  
  .login-form-container .login-title {
    margin-top: 0.5rem;
    text-align: center;
  }
  
  .login-logo-mobile {
    display: flex !important;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    width: 100vw;
    max-width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-white);
    padding: 1.2rem 0 0.7rem 0;
    border-bottom: 1px solid var(--border-gray);
    text-align: center;
  }
  
  .login-logo-mobile a {
    font-size: 2.1rem !important;
    color: var(--primary-color) !important;
    text-align: center;
    width: auto;
    margin: 0 auto;
    display: inline-block;
    font-family: 'Montserrat', 'Poppins', Arial, sans-serif;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-decoration: none !important;
    background: none;
    line-height: 1;
  }
  
  .login-logo-mobile .logo-dot-ext {
    color: var(--primary-dark);
    font-size: 2.3rem;
    margin-left: 0.05em;
  }
}

@media (min-width: 769px) {
  .login-logo-mobile {
    display: none !important;
  }
}
