/* ==========================================
   CSS VARIABLES (Design Tokens)
   ========================================== */
:root {
  /* Color palette */
  --primary-color: #4361ee;
  --primary-dark: #3a56d4;
  --primary-light: #4a6bff;
  --secondary-color: #7209b7;
  --success-color: #2a9d8f;
  --error-color: #e63946;
  --warning: #ffc107;
  --info: #0dcaf0;
  
  /* Extended color system */
  --bg: #f5f7fb;
  --surface: #ffffff;
  --muted: #6c757d;
  --text: #212529;
  --text-color: #333;
  --light-gray: rgba(230, 230, 200, 0.1);
  --medium-gray: #e9ecef;
  --dark-gray: #6c757d;

  /* Semantic colors */
  --border-color: rgba(16, 24, 40, 0.04);
  --border-light: rgba(255, 255, 255, 0.06);
  --hover-overlay: rgba(67, 97, 238, 0.03);
  --focus-ring: rgba(67, 97, 238, 0.15);

  /* Spacing & sizing */
  --gap-xs: 0.4rem;
  --gap-sm: 0.8rem;
  --gap: 1.2rem;
  --gap-lg: 1.6rem;
  --radius: 0.5rem;
  --radius-sm: 0.25rem;
  --radius-lg: 0.75rem;
  --card-padding: 1rem;

  /* Typography */
  --font-sans: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --base-size: 14px;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --line-height: 1.5;

  /* Elevation */
  --shadow-sm: 0 2px 6px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 6px 20px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.3s ease;

  /* Z-index layers */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal: 5040;
  --z-popover: 5050;
  --z-tooltip: 5060;
  --z-toast: 5070;
}

/* Login Modal Styles */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-overlay.active {
    display: flex;
    opacity: 1;
}

.login-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 10;
}

.login-close:hover {
    background: #f5f5f5;
    color: #333;
}

.login-container {
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
}

.login-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px;
}

.login-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 6px;
}

.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.forgot-link {
    font-size: 13px;
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: #5a67d8;
    text-decoration: underline;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    transition: all 0.2s;
}

.input-group:focus-within {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-icon {
    padding: 0 12px;
    color: #666;
    display: flex;
    align-items: center;
}

.input-group input {
    flex: 1;
    padding: 14px 12px;
    border: none;
    background: transparent;
    font-size: 15px;
    color: #333;
    outline: none;
}

.input-group input::placeholder {
    color: #999;
}

.password-toggle {
    padding: 0 12px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #333;
}

.eye-off-icon {
    display: none;
}

.password-toggle.active .eye-icon {
    display: none;
}

.password-toggle.active .eye-off-icon {
    display: block;
}

.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.form-check input {
    display: none;
}

.check-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.check-box {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.2s;
}

.form-check input:checked + .check-label .check-box {
    background: #667eea;
    border-color: #667eea;
}

.form-check input:checked + .check-label .check-box::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.check-text {
    user-select: none;
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.btn-loader {
    display: none;
    animation: spin 1s linear infinite;
}

.login-btn.loading .btn-text {
    opacity: 0;
}

.login-btn.loading .btn-loader {
    display: block;
    position: absolute;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.divider {
    position: relative;
    margin: 24px 0;
    text-align: center;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e9ecef;
}

.divider-text {
    position: relative;
    background: white;
    padding: 0 12px;
    font-size: 13px;
    color: #666;
}

.signup-link {
    text-align: center;
    margin: 20px 0;
}

.signup-link p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.signup-text {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.signup-text:hover {
    color: #5a67d8;
    text-decoration: underline;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.security-note svg {
    color: #10b981;
}

/* Responsive */
@media (max-width: 480px) {
    .login-container {
        padding: 32px 24px;
    }
    
    .login-modal {
        width: 95%;
    }
}





/* ==========================================
   NOTIFICATIONS & MODALS
   ========================================== */
.toast-container {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: var(--z-toast);
}

.notifier-container {
  position: fixed;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  padding: 0.9375rem;
  pointer-events: none;
  font-family: var(--font-sans);
}

.notifier-top-right {
  top: 15px;
  right: 15px;
  align-items: flex-end;
}

.notifier-bottom-right {
  bottom: 15px;
  right: 15px;
  align-items: flex-end;
}

.notifier-top-left {
  top: 15px;
  left: 15px;
  align-items: flex-start;
}

.notifier-bottom-left {
  bottom: 15px;
  left: 15px;
  align-items: flex-start;
}

.notifier {
  min-width: 280px;
  max-width: 380px;
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  overflow: hidden;
  padding: 0.625rem 0.9375rem;
  border-left: 3px solid transparent;
  color: #333;
  font-size: var(--text-xs);
  font-weight: 500;
  pointer-events: all;
  animation: slideIn 0.5s ease forwards;
  opacity: 0;
  transform: translateX(30px);
}

@keyframes slideIn {
  0% {
    opacity: 0;
    transform: translateX(30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(30px);
  }
}

.notifier .icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.notifier .close-btn {
  margin-left: auto;
  cursor: pointer;
  font-weight: bold;
  color: #999;
  transition: color var(--transition-base);
}

.notifier .close-btn:hover { 
  color: #333; 
}

.notifier-success {
  border-left-color: var(--success-color);
  background: #eaf7ec;
}

.notifier-success .icon { 
  color: var(--success-color); 
}

.notifier-error {
  border-left-color: var(--error-color);
  background: #fdecea;
}

.notifier-error .icon { 
  color: var(--error-color); 
}

.notifier-warning {
  border-left-color: var(--warning);
  background: #fff8e5;
}

.notifier-warning .icon { 
  color: var(--warning); 
}

.notifier-info {
  border-left-color: var(--info);
  background: #e9f8fb;
}

.notifier-info .icon { 
  color: var(--info); 
}