/* assets/css/pages/login.css
   Clean login styling using design variables
   Works for both standalone page and modal
*/

/* ═══════════════════════════════════════════════════════════
   SCOPED VARIABLES (Light theme defaults)
   ════════════════════════════════════════════════════════ */
.auth-scope {
  --auth-primary: var(--green-primary);
  --auth-primary-hover: #1f6d3d;
  --auth-text: var(--color-text);
  --auth-input-bg: var(--panel-bg);
  --auth-input-border: var(--panel-border-muted);
  --auth-input-placeholder: var(--gray-medium);
  --auth-card-bg: var(--panel-bg);
  --auth-card-border: var(--panel-border-subtle);
}

/* Dark theme overrides */
[data-theme="dark"] .auth-scope {
  --auth-primary: var(--green-soft);
  --auth-primary-hover: var(--green-medium);
}

/* ═══════════════════════════════════════════════════════════
   LAYOUT - Standalone Page
   ════════════════════════════════════════════════════════ */
.login-page-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--green-primary) 0%, var(--green-medium) 100%);
  padding: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════
   CARD CONTAINER
   ════════════════════════════════════════════════════════ */
.auth-scope .login-container {
  width: 100%;
  max-width: 460px;
}

.auth-scope .login-card {
  background: var(--auth-card-bg);
  border: 1px solid var(--auth-card-border);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════════════════ */
.auth-scope .login-card .brand-logo {
  height: 40px;
  width: auto;
}

.auth-scope .login-card h4 {
  color: var(--auth-text);
  font-size: 1.5rem;
  font-weight: 600;
}

.auth-scope .login-card .text-muted {
  color: var(--gray-medium) !important;
}

/* Logo visibility based on theme */
.auth-scope .logo-dark {
  display: none;
}

[data-theme="dark"] .auth-scope .logo-light {
  display: none;
}

[data-theme="dark"] .auth-scope .logo-dark {
  display: inline-block;
}

/* ═══════════════════════════════════════════════════════════
   FORM CONTROLS
   ════════════════════════════════════════════════════════ */
.auth-scope .form-group {
  position: relative;
  margin-bottom: 1.2rem;
}

.auth-scope .form-control {
  width: 100%;
  padding: 0.75rem 0.75rem 0.75rem 2.5rem;
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-input-border);
  border-radius: 6px;
  color: var(--auth-text);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-scope .form-control:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 0.2rem var(--green-primary-transparent);
  outline: none;
}

.auth-scope .form-control::placeholder {
  color: var(--auth-input-placeholder);
}

/* ═══════════════════════════════════════════════════════════
   FORM ICONS
   ════════════════════════════════════════════════════════ */
.auth-scope .form-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--auth-input-placeholder);
  pointer-events: none;
  transition: color 0.2s ease;
}

.auth-scope .form-icon-end {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--auth-input-placeholder);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.auth-scope .form-icon-end:hover {
  color: var(--auth-primary);
  transform: translateY(-50%) scale(1.1);
}

.auth-scope .form-control:focus ~ .form-icon,
.auth-scope .form-control:focus ~ .form-icon-end {
  color: var(--auth-primary);
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════ */
.auth-scope .btn-primary {
  background: var(--auth-primary);
  border-color: var(--auth-primary);
  color: #fff;
  font-weight: 500;
  padding: 0.75rem;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.auth-scope .btn-primary:hover:not(:disabled) {
  background: var(--auth-primary-hover);
  border-color: var(--auth-primary-hover);
  transform: translateY(-1px);
}

.auth-scope .btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Social buttons */
.auth-scope .social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.auth-scope .btn-google {
  background: #fff;
  border: 1px solid #dadce0;
  color: #3c4043;
}

.auth-scope .btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.auth-scope .btn-facebook {
  background: #1877f2;
  border: none;
  color: #fff;
}

.auth-scope .btn-facebook:hover {
  background: #155db2;
}

.auth-scope .btn-outline-success {
  border-color: var(--auth-primary);
  color: var(--auth-primary);
}

.auth-scope .btn-outline-success:hover {
  background: var(--auth-primary);
  border-color: var(--auth-primary);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════
   ALERTS
   ════════════════════════════════════════════════════════ */
.auth-scope .alert {
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.auth-scope .alert-danger {
  background: var(--color-warning-transparent);
  border-color: var(--color-warning);
  color: var(--auth-text);
}

.auth-scope .alert-success {
  background: var(--green-pale-transparent);
  border-color: var(--green-soft);
  color: var(--auth-text);
}

/* ═══════════════════════════════════════════════════════════
   LINKS
   ════════════════════════════════════════════════════════ */
.auth-scope a {
  color: var(--auth-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-scope a:hover {
  color: var(--auth-primary-hover);
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════
   DIVIDER
   ════════════════════════════════════════════════════════ */
.auth-scope .border-secondary-subtle {
  border-color: var(--auth-input-border) !important;
}

/* ═══════════════════════════════════════════════════════════
   SPINNER
   ════════════════════════════════════════════════════════ */
.auth-scope .spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

/* ═══════════════════════════════════════════════════════════
   MODAL SPECIFIC (when used in modal)
   ════════════════════════════════════════════════════════ */
#mobileLoginModal .modal-dialog {
  max-width: 540px;
}

#mobileLoginModal .auth-modal-content {
  background: transparent;
  border: 0;
  box-shadow: none;
}

#mobileLoginModal .modal-body {
  padding: 0;
  overflow: visible;
}

/* Mobile adjustments */
@media (max-width: 575.98px) {
  #mobileLoginModal .modal-dialog {
    margin: 1.25rem auto !important;
  }
  
  .auth-scope .login-card {
    padding: 1.5rem;
  }
  
  .login-page-wrapper {
    padding: 1rem;
  }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .auth-scope .login-card h4 {
    font-size: 1.25rem;
  }
  
  .auth-scope .social-btn {
    font-size: 0.85rem;
    padding: 0.5rem;
  }
}