/* ===== AUTHENTICATION PAGES STYLES ===== */
/* Designed for Desa Digital Administration System */
/* Version: 1.0 */
/* Last Updated: June 2023 */

/* ===== BASE STYLES ===== */
:root {
  /* Color Palette */
  --primary: #4361ee;
  --primary-dark: #3a56d4;
  --secondary: #3f37c9;
  --accent: #4895ef;
  --danger: #f72585;
  --success: #4cc9f0;
  --warning: #f8961e;
  --light: #f8f9fa;
  --dark: #212529;
  --gray: #6c757d;
  --light-gray: #e9ecef;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  
  /* Typography */
  --font-base: 'Poppins', sans-serif;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.8rem;
  
  /* Effects */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ===== LAYOUT STYLES ===== */
.login-container {
  display: flex;
  min-height: 100vh;
  background-color: #f5f7ff;
  font-family: var(--font-base);
}

.login-wrapper {
  display: flex;
  width: 100%;
  max-width: 1200px;
  margin: auto;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}

/* ===== BRANDING SECTION ===== */
.login-branding {
  flex: 1;
  padding: var(--space-xl);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-branding::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}

.login-branding::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}

.brand-logo {
  margin-bottom: var(--space-md);
  z-index: 1;
}

.brand-logo img {
  width: 100px;
  height: auto;
  object-fit: contain;
}

.brand-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-xs);
  z-index: 1;
}

.brand-subtitle {
  font-size: var(--text-base);
  opacity: 0.9;
  margin-bottom: var(--space-lg);
  z-index: 1;
  max-width: 80%;
}

.brand-features {
  margin-top: var(--space-lg);
  width: 100%;
  z-index: 1;
}

.feature-item {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
  padding: var(--space-sm);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.2);
  transition: var(--transition);
}

.feature-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

.feature-item i {
  margin-right: var(--space-xs);
  font-size: 1.2rem;
}

/* ===== FORM SECTION ===== */
.login-form-container {
  flex: 1;
  padding: var(--space-xl);
  display: flex;
  justify-content: center;
  align-items: center;
  background: white;
}

.login-form-wrapper {
  width: 100%;
  max-width: 400px;
  animation: fadeInUp 0.6s ease-out;
}

.form-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--dark);
  margin-bottom: var(--space-xs);
}

.form-subtitle {
  color: var(--gray);
  margin-bottom: var(--space-lg);
  font-size: var(--text-base);
}

/* ===== FORM ELEMENTS ===== */
.login-form {
  margin-top: var(--space-lg);
}

.form-group {
  position: relative;
  margin-bottom: var(--space-md);
}

.form-control {
  width: 100%;
  padding: var(--space-md) var(--space-md) var(--space-md) 3rem;
  border: 2px solid var(--light-gray);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  transition: var(--transition);
  height: 52px;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
  outline: none;
}

.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray);
  transition: var(--transition);
}

.form-control:focus + .input-icon {
  color: var(--primary);
}

/* ===== FLOATING LABELS ===== */
.floating-label {
  position: relative;
}

.floating-label label {
  position: absolute;
  left: 3rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray);
  pointer-events: none;
  transition: var(--transition);
  background: transparent;
  padding: 0 0.25rem;
}

.floating-label.focused label,
.floating-label input:focus + label,
.floating-label input:not(:placeholder-shown) + label {
  top: 0;
  left: 1rem;
  font-size: var(--text-sm);
  background: white;
  color: var(--primary);
  transform: translateY(-50%) scale(0.9);
}

/* ===== PASSWORD TOGGLE ===== */
.password-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  transition: var(--transition);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: var(--primary);
}

/* ===== FORM OPTIONS ===== */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.form-check {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.form-check-input {
  margin-right: var(--space-xs);
  cursor: pointer;
}

.forgot-password {
  color: var(--gray);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: var(--transition);
}

.forgot-password:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ===== BUTTON STYLES ===== */
.btn-login {
  width: 100%;
  padding: var(--space-md);
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: var(--space-sm);
  position: relative;
  overflow: hidden;
}

.btn-login:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-login::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.btn-login:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

.btn-icon {
  margin-left: var(--space-xs);
  transition: var(--transition);
}

.btn-login:hover .btn-icon {
  transform: translateX(3px);
}

/* ===== SOCIAL LOGIN ===== */
.social-login {
  margin: var(--space-lg) 0;
  text-align: center;
}

.divider {
  position: relative;
  color: var(--gray);
  margin: var(--space-md) 0;
  font-size: var(--text-sm);
}

.divider::before,
.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: var(--light-gray);
}

.divider::before {
  left: 0;
}

.divider::after {
  right: 0;
}

.social-buttons {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
}

.social-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: var(--transition);
  font-size: var(--text-base);
}

.social-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.social-btn.google {
  background: #db4437;
}

.social-btn.facebook {
  background: #4267b2;
}

.social-btn.twitter {
  background: #1da1f2;
}

/* ===== REGISTER LINK ===== */
.register-link {
  text-align: center;
  margin-top: var(--space-lg);
  color: var(--gray);
  font-size: var(--text-base);
}

.register-link a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.register-link a:hover {
  text-decoration: underline;
}

/* ===== ALERT MESSAGES ===== */
.alert {
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  font-size: var(--text-sm);
}

.alert-danger {
  background: #fdecea;
  color: #d32f2f;
  border-left: 4px solid #d32f2f;
}

.alert i {
  margin-right: var(--space-xs);
}

/* ===== VALIDATION FEEDBACK ===== */
.invalid-feedback {
  display: flex;
  align-items: center;
  color: #d32f2f;
  font-size: var(--text-sm);
  margin-top: var(--space-xs);
}

.invalid-feedback i {
  margin-right: var(--space-xs);
}

.is-invalid {
  border-color: #d32f2f !important;
}

.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.2) !important;
}

/* ===== LOADER STYLES ===== */
.login-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(3px);
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ===== ANIMATIONS ===== */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 1;
  }
  20% {
    transform: scale(25, 25);
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(40, 40);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shake {
  0%, 100% {transform: translateX(0);}
  20%, 60% {transform: translateX(-5px);}
  40%, 80% {transform: translateX(5px);}
}

.animated {
  animation-duration: 0.5s;
  animation-fill-mode: both;
}

.shake {
  animation-name: shake;
}

.fadeIn {
  animation-name: fadeIn;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 992px) {
  .login-wrapper {
    flex-direction: column;
    max-width: 500px;
    margin: var(--space-md) auto;
  }
  
  .login-branding {
    padding: var(--space-lg);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }
  
  .login-form-container {
    padding: var(--space-lg);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
  }
  
  .brand-title {
    font-size: var(--text-xl);
  }
  
  .form-title {
    font-size: var(--text-xl);
  }
}

@media (max-width: 576px) {
  .login-wrapper {
    border-radius: 0;
    margin: 0;
    min-height: 100vh;
  }
  
  .login-branding,
  .login-form-container {
    padding: var(--space-md);
  }
  
  .brand-title {
    font-size: var(--text-lg);
  }
  
  .form-title {
    font-size: var(--text-lg);
  }
  
  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
  
  .forgot-password {
    margin-top: var(--space-sm);
  }
  
  .divider::before,
  .divider::after {
    width: 25%;
  }
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
}

.strength-text {
    font-size: 0.75rem;
    display: block;
    text-align: right;
}