/* ===========================
   CSS Variables & Reset
   =========================== */
:root {
  --primary: #28a745;
  --primary-dark: #1e7e34;
  --primary-light: #28a745;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --error: #ef4444;
  --success: #10b981;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8f5e9 100%);
  min-height: 100vh;
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* ===========================
   Background Decoration
   =========================== */
.background-decoration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.circle {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(32, 201, 151, 0.1));
  animation: float 20s ease-in-out infinite;
}

.circle-1 {
  width: 300px;
  height: 300px;
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.circle-2 {
  width: 200px;
  height: 200px;
  bottom: -50px;
  left: -50px;
  animation-delay: 5s;
}

.circle-3 {
  width: 150px;
  height: 150px;
  top: 50%;
  left: 10%;
  animation-delay: 10s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(20px, -20px) scale(1.1); }
  50% { transform: translate(-20px, 20px) scale(0.9); }
  75% { transform: translate(20px, 20px) scale(1.05); }
}

/* ===========================
   Login Wrapper
   =========================== */
.login-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  gap: 40px;
}

/* ===========================
   Login Container
   =========================== */
.login-container {
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 480px;
  padding: 40px 32px;
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===========================
   Header Section
   =========================== */
.header-section {
  text-align: center;
  margin-bottom: 32px;
}

.logo-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 16px rgba(40, 167, 69, 0.25);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.logo-image {
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.brand-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.brand-subtitle {
  font-size: 15px;
  color: var(--gray-500);
  font-weight: 400;
}

/* ===========================
   Alert Messages
   =========================== */
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 24px;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert i {
  font-size: 18px;
  flex-shrink: 0;
}

.alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.alert-error i {
  color: var(--error);
}

.alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-success i {
  color: var(--success);
}

/* ===========================
   Form Styles
   =========================== */
.login-form {
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.form-label i {
  color: var(--primary);
  font-size: 14px;
}

.input-wrapper {
  position: relative;
}

.input-wrapper.focused {
  transform: translateY(-1px);
}

.form-input {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s ease;
  background: var(--white);
  color: var(--gray-900);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.form-input::placeholder {
  color: var(--gray-400);
}

.password-wrapper {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: var(--primary);
}

.password-toggle i {
  font-size: 16px;
}

/* ===========================
   Form Options
   =========================== */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

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

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--gray-300);
  border-radius: 4px;
  position: relative;
  transition: all 0.2s;
}

.remember-me input:checked + .checkmark {
  background: var(--primary);
  border-color: var(--primary);
}

.remember-me input:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 11px;
  font-weight: bold;
}

.label-text {
  font-size: 14px;
  color: var(--gray-600);
}

.forgot-link {
  font-size: 14px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.forgot-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ===========================
   Submit Button
   =========================== */
.submit-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
  position: relative;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--white);
  animation: spin 0.8s linear infinite;
}

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

/* ===========================
   Security Badge
   =========================== */
.security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  background: var(--gray-50);
  border-radius: 10px;
  margin: 24px 0;
  font-size: 13px;
  color: var(--gray-600);
}

.security-badge i {
  color: var(--primary);
  font-size: 16px;
}

/* ===========================
   Divider
   =========================== */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 24px 0;
  color: var(--gray-400);
  font-size: 14px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--gray-200);
}

.divider span {
  padding: 0 16px;
}

/* ===========================
   Register Link
   =========================== */
.register-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s;
  margin-bottom: 24px;
}

.register-link:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.register-link i {
  font-size: 16px;
}

/* ===========================
   Features Preview
   =========================== */
.features-preview {
  padding: 20px;
  background: var(--gray-50);
  border-radius: 12px;
  margin-bottom: 24px;
}

.features-preview h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 16px;
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  background: var(--white);
  border-radius: 10px;
  font-size: 13px;
  color: var(--gray-600);
  text-align: center;
}

.feature-item i {
  font-size: 20px;
  color: var(--primary);
}

/* ===========================
   Footer
   =========================== */
.page-footer {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--gray-200);
}

.support-text {
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.support-text i {
  color: var(--primary);
}

.support-text a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.support-text a:hover {
  text-decoration: underline;
}

.copyright {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 8px;
}

/* ===========================
   Side Panel (Desktop)
   =========================== */
.side-panel {
  display: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  color: var(--white);
  box-shadow: var(--shadow-xl);
}

.side-panel-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
  height: 100%;
}

.testimonial-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.quote-icon {
  font-size: 32px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 16px;
}

.testimonial-text {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 20px;
  font-style: italic;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-info strong {
  font-size: 14px;
}

.author-info span {
  font-size: 12px;
  opacity: 0.8;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item i {
  font-size: 24px;
  margin-bottom: 8px;
}

.stat-item strong {
  font-size: 20px;
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

.stat-item span {
  font-size: 11px;
  opacity: 0.9;
}

/* ===========================
   Responsive Design
   =========================== */
@media (min-width: 1024px) {
  .side-panel {
    display: flex;
  }
}

@media (max-width: 480px) {
  .login-wrapper {
    padding: 12px;
  }

  .login-container {
    padding: 28px 20px;
  }

  .brand-title {
    font-size: 24px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .form-options {
    flex-direction: column;
    align-items: flex-start;
  }
}

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