/* Professional Font Stack & Variables */
:root {
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  --primary-color: #63C8FF;
  --primary-dark: #67C090;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --light-color: #f8fafc;
  --dark-color: #1e293b;
  --border-color: #d1d5db;
  --background-color: #ffffff;
  --text-muted: #6b7280;
  --text-primary: #111827;
  --input-bg: #ffffff;
  --input-border: #d1d5db;
  --input-border-focus: #3b82f6;
  --input-shadow-focus: rgba(59, 130, 246, 0.08);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-md: 0 3px 5px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 12px -3px rgba(0, 0, 0, 0.08), 0 3px 5px -2px rgba(0, 0, 0, 0.03);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 6px;
  --border-radius-sm: 4px;
  --border-radius-lg: 8px;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 20px;
  --spacing-2xl: 24px;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  background-color: #f9fafb;
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
}

/* Main Layout */
.main-content {
  flex: 1;
  display: flex;
  min-height: 100vh;
  background: white;
}

/* Left Side - Slider Section */
.slider-section {
  flex: 1;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-2xl) var(--spacing-lg);
  overflow: hidden;
  transition: background-image 0.5s ease-in-out;
}

.slider-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 360px;
  height: auto;
  margin-bottom: var(--spacing-lg);
  text-align: center;
}

.slide {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  display: none;
}

.slide.active {
  opacity: 1;
  display: block;
}

.slide-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.slide-icon {
  display: block;
  margin: 0 auto var(--spacing-md);
  width: 48px; /* Maintained size */
  height: 48px; /* Maintained size */
  filter: brightness(0) invert(1);
}

.slide-title {
  color: white;
  font-size: 1.5rem; /* Maintained size */
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  line-height: 1.2;
}

.slide-description {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem; /* Reduced from 0.9rem */
  line-height: 1.4;
  max-width: 260px;
  margin: 0 auto;
}

.slider-dots {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-lg);
  position: relative;
  z-index: 1;
  justify-content: center;
}

.slider-dot {
  width: 6px; /* Reduced from 8px */
  height: 6px; /* Reduced from 8px */
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: var(--transition);
}

.slider-dot.active {
  background: white;
  transform: scale(1.1); /* Reduced from 1.2 */
}

/* Right Side - Form Section */
.form-section {
  flex: 1;
  background-color: white;
  background-image: url('../assets/cubes.png');
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  position: relative;
}

/* Login Form Container - Precisely aligned */
.login-container {
  width: 100%;
  max-width: 340px;
  background-color: transparent;
  border-radius: var(--border-radius);
  padding: var(--spacing-2xl);
  position: relative;
  z-index: 1;
}

/* Login Header */
.login-header {
  text-align: center;
  margin-bottom: var(--spacing-2xl);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--spacing-md);
}

.login-logo img {
  width: 60px; /* Maintained size */
  height: auto;
}

.login-title {
  font-family: var(--font-family);
  font-size: 1.5rem; /* Maintained size */
  font-weight: 700;
  margin-top: var(--spacing-sm);
  margin-bottom: var(--spacing-xs);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.login-title .word-the {
  color: var(--text-muted);
}

.login-title .word-diy {
  color: var(--primary-color);
}

.login-title .word-tech {
  color: var(--primary-dark);
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.75rem; /* Reduced from 0.85rem */
  font-weight: 400;
  margin-bottom: 0;
}

/* Minimalistic Alert - Positioned above username */
.form-alert {
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  font-size: 0.75rem; /* Small, minimalistic */
  font-weight: 500;
  line-height: 1.3;
  border: 1px solid transparent;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  visibility: hidden;
}

.form-alert.show {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.form-alert-icon {
  margin-right: var(--spacing-sm);
  font-size: 0.875rem;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.form-alert-message {
  flex-grow: 1;
  font-weight: 400;
}

/* Alert variants */
.form-alert-success {
  background-color: rgba(240, 253, 244, 0.7);
  color: #065f46;
  border-color: rgba(16, 185, 129, 0.2);
}

.form-alert-danger {
  background-color: rgba(254, 242, 242, 0.7);
  color: #991b1b;
  border-color: rgba(239, 68, 68, 0.2);
}

.form-alert-warning {
  background-color: rgba(255, 251, 235, 0.7);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.2);
}

.form-alert-info {
  background-color: rgba(239, 246, 255, 0.7);
  color: #1e40af;
  border-color: rgba(59, 130, 246, 0.2);
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
}

.form-group.full-width {
  grid-column: 1 / -1;
}

/* Form Elements - Precisely sized */
.form-group {
  margin-bottom: var(--spacing-lg);
  position: relative;
}

.form-label {
  display: block;
  margin-bottom: 5px; /* Reduced from 6px */
  font-weight: 500;
  font-size: 0.75rem; /* Reduced from 0.8rem */
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.form-control {
  width: 100%;
  padding: 10px 14px; /* Reduced from 12px 16px */
  font-size: 0.8rem; /* Reduced from 0.85rem */
  font-family: var(--font-family);
  border: 1.5px solid var(--input-border);
  border-radius: var(--border-radius-sm);
  background-color: rgba(255, 255, 255, 0.9);
  transition: var(--transition);
  color: var(--text-primary);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-control::placeholder {
  color: #9ca3af;
  font-weight: 400;
  font-size: 0.75rem; /* Reduced */
}

.form-control:focus {
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 2px var(--input-shadow-focus); /* Reduced from 3px */
  background-color: #ffffff;
}

.form-control:hover:not(:focus) {
  border-color: #9ca3af;
}

/* Password Field */
.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 42px; /* Reduced from 48px */
}

.password-toggle {
  position: absolute;
  right: 10px; /* Reduced from 12px */
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem; /* Reduced from 16px */
  padding: 4px; /* Reduced from 6px */
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: var(--text-primary);
  background-color: rgba(0, 0, 0, 0.05);
}

/* Password Strength */
.password-strength {
  height: 3px; /* Reduced from 4px */
  margin-top: 6px; /* Reduced from 8px */
  border-radius: 2px;
  background-color: #f3f4f6;
  overflow: hidden;
}

.password-strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: all 0.3s ease;
  width: 0%;
}

.strength-weak .password-strength-fill {
  background-color: var(--danger-color);
  width: 25%;
}

.strength-fair .password-strength-fill {
  background-color: var(--warning-color);
  width: 50%;
}

.strength-good .password-strength-fill {
  background-color: #3b82f6;
  width: 75%;
}

.strength-strong .password-strength-fill {
  background-color: var(--success-color);
  width: 100%;
}

.password-strength-text {
  font-size: 0.7rem; /* Reduced from 12px */
  margin-top: 4px; /* Reduced from 6px */
  font-weight: 500;
  color: var(--text-muted);
}

/* Form Options */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

/* Checkbox */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 6px; /* Reduced from 8px */
}

.form-check-input {
  width: 16px; /* Reduced from 18px */
  height: 16px; /* Reduced from 18px */
  margin: 0;
  border: 1.5px solid var(--input-border);
  border-radius: 3px; /* Reduced from 4px */
  background-color: rgba(255, 255, 255, 0.9);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  margin-top: 1px;
}

.form-check-input:checked {
  background-color: var(--input-border-focus);
  border-color: var(--input-border-focus);
}

.form-check-input:checked::after {
  content: '';
  position: absolute;
  top: 0px;
  left: 4px;
  width: 4px; /* Reduced from 5px */
  height: 8px; /* Reduced from 10px */
  border: solid white;
  border-width: 0 1.5px 1.5px 0; /* Reduced from 2px */
  transform: rotate(45deg);
}

.form-check-input:focus {
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 2px var(--input-shadow-focus); /* Reduced from 3px */
  outline: none;
}

.form-check-label {
  font-size: 0.75rem; /* Reduced from 14px */
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.3;
  cursor: pointer;
}

/* Links */
.forgot-password {
  font-size: 0.75rem; /* Reduced from 14px */
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

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

/* Turnstile Container */
.turnstile-container {
  display: flex;
  justify-content: center;
  margin-bottom: var(--spacing-lg);
}

/* Buttons */
.btn-submit {
  width: 100%;
  padding: 10px 20px; /* Reduced from 12px 24px */
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border: none;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 0.8rem; /* Reduced from 15px */
  font-family: var(--font-family);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  margin-bottom: var(--spacing-md);
  letter-spacing: -0.01em;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -5px rgba(99, 200, 255, 0.3);
}

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

.btn-submit:disabled {
  background: var(--secondary-color);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Create Account Section */
.create-account-section {
  text-align: center;
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-color);
}

.create-account-text {
  font-size: 0.7rem; /* Reduced from 0.8rem */
  color: var(--secondary-color);
  margin-bottom: var(--spacing-sm);
}

.btn-create-account {
  width: 100%;
  padding: 10px 20px; /* Reduced from 12px 24px */
  background-color: var(--light-color); /* Changed from transparent */
  color: var(--text-primary); /* Changed from text-muted */
  border: 1.5px solid var(--input-border);
  border-radius: var(--border-radius-sm);
  font-weight: 500;
  font-size: 0.8rem; /* Reduced from 15px */
  font-family: var(--font-family);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
  text-align: center;
  letter-spacing: -0.01em;
}

.btn-create-account:hover {
  background-color: #e2e8f0; /* Slightly darker light color on hover */
  border-color: var(--text-primary); /* Changed from text-muted */
  color: var(--text-primary);
  text-decoration: none;
  transform: translateY(-1px);
}

/* Contact Section */
.contact-section {
  text-align: center;
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--border-color);
}

.btn-contact {
  width: 100%;
  padding: 10px 20px; /* Reduced */
  background-color: var(--light-color); /* Changed from transparent */
  color: var(--text-primary); /* Changed from text-muted */
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
  text-align: center;
  font-size: 0.8rem; /* Reduced */
}

.btn-contact:hover {
  background-color: #e2e8f0; /* Slightly darker light color on hover */
  border-color: var(--text-primary); /* Changed from secondary-color */
  color: var(--text-primary); /* Changed from white */
  text-decoration: none;
  transform: translateY(-1px);
}

/* Product Dropdown */
.product-dropdown {
  position: relative;
}

.product-dropdown-toggle {
  background-color: rgba(255, 255, 255, 0.9);
  border: 1.5px solid var(--input-border);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: 0.7rem; /* Reduced from 0.8rem */
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between; /* Pushes arrow to the right */
  padding: 10px 14px; /* Matches form-control padding */
  width: 100%; /* Makes it fill the width */
  transition: var(--transition);
}

.product-dropdown-toggle:hover {
  color: var(--primary-color);
  border-color: #9ca3af; /* Matches form-control hover */
}

.product-dropdown-toggle .fa-chevron-down {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.6rem;
  margin-left: 8px; /* Added space */
}

.product-dropdown.open .product-dropdown-toggle .fa-chevron-down {
  transform: rotate(180deg);
}

.product-dropdown-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-lg);
  list-style: none;
  padding: var(--spacing-xs) 0;
  margin: 0;
  min-width: 160px; /* Reduced from 180px */
  z-index: 1000;
  opacity: 0;
  transform: translateY(6px) scale(0.95);
  transform-origin: bottom center;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.product-dropdown.open .product-dropdown-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.product-dropdown-menu a {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md); /* Reduced */
  color: var(--dark-color);
  text-decoration: none;
  font-size: 0.7rem; /* Reduced from 0.8rem */
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.product-dropdown-menu a:hover {
  background-color: rgba(241, 245, 249, 0.9);
  color: var(--primary-color);
}

.product-dropdown-menu a.selected,
.product-dropdown-menu a.selected:hover {
  background-color: var(--primary-color);
  color: white;
}

/* Footer */
.site-footer {
  background-color: #f8f9fa;
  padding: var(--spacing-md);
  text-align: center;
  font-size: 0.7rem; /* Reduced from 0.8rem */
  color: var(--secondary-color);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xs);
}

.footer-link {
  color: var(--secondary-color);
  text-decoration: none;
  font-size: 0.7rem; /* Reduced */
}

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

/* Form Validation States */
.is-invalid {
  border-color: var(--danger-color);
  background-image: none;
}

.is-invalid:focus {
  border-color: var(--danger-color);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

/* Loading States */
.btn-submit.loading {
  pointer-events: none;
}

body.loading {
  pointer-events: none;
}

body.loading .login-container {
  pointer-events: auto;
}

/* Responsive Design - Mobile First Approach */
@media (min-width: 320px) and (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .main-content {
    flex-direction: column;
  }

  .slider-section {
    flex: none;
    height: 200px; /* Reduced */
    padding: var(--spacing-md) var(--spacing-sm);
  }

  .slider-container {
    max-width: 240px; /* Reduced */
  }

  .slide-icon {
    width: 36px; /* Reduced */
    height: 36px; /* Reduced */
  }

  .slide-title {
    font-size: 1.2rem; /* Slightly reduced */
  }

  .slide-description {
    font-size: 0.7rem; /* Reduced */
    max-width: 200px;
  }

  .login-container {
    max-width: 300px;
    padding: var(--spacing-lg);
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }

  .form-group.full-width {
    grid-column: span 1;
  }

  .form-control {
    padding: 9px 12px; /* Reduced */
    font-size: 0.8rem;
  }

  .btn-submit,
  .btn-create-account {
    padding: 9px 18px; /* Reduced */
    font-size: 0.8rem;
  }

  .slider-dot {
    width: 5px;
    height: 5px;
  }

  .form-alert {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.7rem;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .main-content {
    flex-direction: column;
  }

  .slider-section {
    flex: none;
    height: 220px;
    padding: var(--spacing-lg) var(--spacing-md);
  }

  .slider-container {
    max-width: 280px;
  }

  .slide-icon {
    width: 40px;
    height: 40px;
  }

  .login-container {
    max-width: 320px;
    padding: var(--spacing-xl);
  }

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

  .form-group.full-width {
    grid-column: span 1;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .login-container {
    max-width: 340px;
  }

  .slider-section {
    padding: var(--spacing-xl) var(--spacing-lg);
  }

  .form-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
  }
}

@media (min-width: 1025px) {
  .main-content {
    flex-direction: row;
  }

  .slider-section,
  .form-section {
    flex: 1;
  }

  .login-container {
    max-width: 360px;
    padding: var(--spacing-2xl);
  }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .form-control,
  .btn-submit,
  .btn-create-account {
    border-width: 0.5px;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --background-color: #1f2937;
    --text-primary-dark: #f9fafb;
    --text-muted-dark: #d1d5db;
    --border-color-dark: #4b5563;
  }

  body {
    background-color: #111827;
    color: var(--text-primary-dark);
  }

  .form-section {
    background-color: #ffffff;
  }

  .login-container .login-title,
  .login-container .form-label,
  .login-container .password-strength-text,
  .login-container .form-check-label,
  .login-container .create-account-text,
  .login-container .btn-create-account,
  .login-container .btn-contact,
  .login-container .product-dropdown-toggle {
    color: var(--text-primary);
  }

  .login-container .login-subtitle,
  .login-container .password-strength-text,
  .login-container .create-account-text,
  .login-container .form-check-label {
      color: var(--text-muted);
  }

  .form-control {
    background-color: var(--input-bg);
    color: var(--text-primary);
    border-color: var(--input-border);
  }

  .product-dropdown-menu {
    background-color: #fff;
    border: 1px solid var(--border-color);
  }

  .product-dropdown-menu a {
    color: var(--text-primary);
  }

  .product-dropdown-menu a:hover {
    background-color: #f8fafc;
    color: var(--primary-color);
  }

  .site-footer {
      background-color: #111827;
      border-top-color: var(--border-color-dark);
      color: var(--text-muted-dark);
  }

  .footer-link {
      color: var(--text-muted-dark);
  }

  /* Modal Styling for Dark Mode */
  .modal-content {
    background-color: #1f2937; /* Dark background for modal */
    color: var(--text-primary-dark); /* Light text */
    border-color: var(--border-color-dark);
  }

  .modal-header {
    border-color: var(--border-color-dark);
  }

  .modal-title {
    color: var(--text-primary-dark); /* White heading */
  }

  .modal-body {
    color: var(--text-primary-dark); /* White body text */
  }

  .modal-body .form-label,
  .modal-body .form-select {
      color: var(--text-primary-dark);
  }

  .modal-body .form-select {
      background-color: #374151;
      border-color: var(--border-color-dark);
      color: var(--text-primary-dark);
  }
  .modal-body .form-select option {
      background-color: #374151; /* Ensure options are dark */
      color: var(--text-primary-dark);
  }

  .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%); /* Make close button white */
  }
}

/* NEW: Dropdown invalid state */
.product-dropdown.is-invalid .product-dropdown-toggle {
    border: 1.5px solid var(--danger-color);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

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

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .form-control {
    border-width: 2px;
  }

  .form-control:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
  }

  .btn-submit {
    border: 2px solid transparent;
  }
}

/* Print Styles */
@media print {
  .slider-section,
  .btn-submit,
  .btn-create-account,
  .btn-contact {
    display: none;
  }

  .main-content {
    flex-direction: column;
  }

  .form-section {
    background: white;
  }
}


/* Left Side - Slider Section */
.slider-section {
  flex: 1;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-2xl) var(--spacing-lg);
  overflow: hidden;
  transition: background-image 0.5s ease-in-out;
}

.slider-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 360px;
  height: auto;
  margin-bottom: var(--spacing-lg);
  text-align: center;
}

.slide {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  display: none;
}

.slide.active {
  opacity: 1;
  display: block;
}

.slide-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.slide-icon {
  display: block;
  margin: 0 auto var(--spacing-md);
  width: 48px; /* Maintained size */
  height: 48px; /* Maintained size */
  filter: brightness(0) invert(1);
}

.slide-title {
  color: white;
  font-size: 1.5rem; /* Maintained size */
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  line-height: 1.2;
}

.slide-description {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem; /* Reduced from 0.9rem */
  line-height: 1.4;
  max-width: 260px;
  margin: 0 auto;
}

.slider-dots {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-lg);
  position: relative;
  z-index: 1;
  justify-content: center;
}

.slider-dot {
  width: 6px; /* Reduced from 8px */
  height: 6px; /* Reduced from 8px */
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: var(--transition);
}

.slider-dot.active {
  background: white;
  transform: scale(1.1); /* Reduced from 1.2 */
}

/* Right Side - Form Section */
.form-section {
  flex: 1;
  background-color: white;
  background-image: url('../assets/cubes.png');
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  position: relative;
}

/* Login Form Container - Precisely aligned */
.login-container {
  width: 100%;
  max-width: 340px;
  background-color: transparent;
  border-radius: var(--border-radius);
  padding: var(--spacing-2xl);
  position: relative;
  z-index: 1;
}

/* Login Header */
.login-header {
  text-align: center;
  margin-bottom: var(--spacing-2xl);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--spacing-md);
}

.login-logo img {
  width: 60px; /* Maintained size */
  height: auto;
}

.login-title {
  font-family: var(--font-family);
  font-size: 1.5rem; /* Maintained size */
  font-weight: 700;
  margin-top: var(--spacing-sm);
  margin-bottom: var(--spacing-xs);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.login-title .word-the {
  color: var(--text-muted);
}

.login-title .word-diy {
  color: var(--primary-color);
}

.login-title .word-tech {
  color: var(--primary-dark);
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.75rem; /* Reduced from 0.85rem */
  font-weight: 400;
  margin-bottom: 0;
}

/* Minimalistic Alert - Positioned above username */
.form-alert {
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  font-size: 0.75rem; /* Small, minimalistic */
  font-weight: 500;
  line-height: 1.3;
  border: 1px solid transparent;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  visibility: hidden;
}

.form-alert.show {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.form-alert-icon {
  margin-right: var(--spacing-sm);
  font-size: 0.875rem;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.form-alert-message {
  flex-grow: 1;
  font-weight: 400;
}

/* Alert variants */
.form-alert-success {
  background-color: rgba(240, 253, 244, 0.7);
  color: #065f46;
  border-color: rgba(16, 185, 129, 0.2);
}

.form-alert-danger {
  background-color: rgba(254, 242, 242, 0.7);
  color: #991b1b;
  border-color: rgba(239, 68, 68, 0.2);
}

.form-alert-warning {
  background-color: rgba(255, 251, 235, 0.7);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.2);
}

.form-alert-info {
  background-color: rgba(239, 246, 255, 0.7);
  color: #1e40af;
  border-color: rgba(59, 130, 246, 0.2);
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
}

.form-group.full-width {
  grid-column: 1 / -1;
}

/* Form Elements - Precisely sized */
.form-group {
  margin-bottom: var(--spacing-lg);
  position: relative;
}

.form-label {
  display: block;
  margin-bottom: 5px; /* Reduced from 6px */
  font-weight: 500;
  font-size: 0.75rem; /* Reduced from 0.8rem */
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.form-control {
  width: 100%;
  padding: 10px 14px; /* Reduced from 12px 16px */
  font-size: 0.8rem; /* Reduced from 0.85rem */
  font-family: var(--font-family);
  border: 1.5px solid var(--input-border);
  border-radius: var(--border-radius-sm);
  background-color: rgba(255, 255, 255, 0.9);
  transition: var(--transition);
  color: var(--text-primary);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-control::placeholder {
  color: #9ca3af;
  font-weight: 400;
  font-size: 0.75rem; /* Reduced */
}

.form-control:focus {
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 2px var(--input-shadow-focus); /* Reduced from 3px */
  background-color: #ffffff;
}

.form-control:hover:not(:focus) {
  border-color: #9ca3af;
}

/* Password Field */
.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 42px; /* Reduced from 48px */
}

.password-toggle {
  position: absolute;
  right: 10px; /* Reduced from 12px */
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem; /* Reduced from 16px */
  padding: 4px; /* Reduced from 6px */
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: var(--text-primary);
  background-color: rgba(0, 0, 0, 0.05);
}

/* Password Strength */
.password-strength {
  height: 3px; /* Reduced from 4px */
  margin-top: 6px; /* Reduced from 8px */
  border-radius: 2px;
  background-color: #f3f4f6;
  overflow: hidden;
}

.password-strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: all 0.3s ease;
  width: 0%;
}

.strength-weak .password-strength-fill {
  background-color: var(--danger-color);
  width: 25%;
}

.strength-fair .password-strength-fill {
  background-color: var(--warning-color);
  width: 50%;
}

.strength-good .password-strength-fill {
  background-color: #3b82f6;
  width: 75%;
}

.strength-strong .password-strength-fill {
  background-color: var(--success-color);
  width: 100%;
}

.password-strength-text {
  font-size: 0.7rem; /* Reduced from 12px */
  margin-top: 4px; /* Reduced from 6px */
  font-weight: 500;
  color: var(--text-muted);
}

/* Form Options */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

/* Checkbox */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 6px; /* Reduced from 8px */
}

.form-check-input {
  width: 16px; /* Reduced from 18px */
  height: 16px; /* Reduced from 18px */
  margin: 0;
  border: 1.5px solid var(--input-border);
  border-radius: 3px; /* Reduced from 4px */
  background-color: rgba(255, 255, 255, 0.9);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  margin-top: 1px;
}

.form-check-input:checked {
  background-color: var(--input-border-focus);
  border-color: var(--input-border-focus);
}

.form-check-input:checked::after {
  content: '';
  position: absolute;
  top: 0px;
  left: 4px;
  width: 4px; /* Reduced from 5px */
  height: 8px; /* Reduced from 10px */
  border: solid white;
  border-width: 0 1.5px 1.5px 0; /* Reduced from 2px */
  transform: rotate(45deg);
}

.form-check-input:focus {
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 2px var(--input-shadow-focus); /* Reduced from 3px */
  outline: none;
}

.form-check-label {
  font-size: 0.75rem; /* Reduced from 14px */
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.3;
  cursor: pointer;
}

/* Links */
.forgot-password {
  font-size: 0.75rem; /* Reduced from 14px */
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

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

/* Turnstile Container */
.turnstile-container {
  display: flex;
  justify-content: center;
  margin-bottom: var(--spacing-lg);
}

/* Buttons */
.btn-submit {
  width: 100%;
  padding: 10px 20px; /* Reduced from 12px 24px */
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border: none;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 0.8rem; /* Reduced from 15px */
  font-family: var(--font-family);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  margin-bottom: var(--spacing-md);
  letter-spacing: -0.01em;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -5px rgba(99, 200, 255, 0.3);
}

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

.btn-submit:disabled {
  background: var(--secondary-color);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Create Account Section */
.create-account-section {
  text-align: center;
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-color);
}

.create-account-text {
  font-size: 0.7rem; /* Reduced from 0.8rem */
  color: var(--secondary-color);
  margin-bottom: var(--spacing-sm);
}

.btn-create-account {
  width: 100%;
  padding: 10px 20px; /* Reduced from 12px 24px */
  background-color: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--input-border);
  border-radius: var(--border-radius-sm);
  font-weight: 500;
  font-size: 0.8rem; /* Reduced from 15px */
  font-family: var(--font-family);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
  text-align: center;
  letter-spacing: -0.01em;
}

.btn-create-account:hover {
  background-color: #f8fafc;
  border-color: var(--text-muted);
  color: var(--text-primary);
  text-decoration: none;
  transform: translateY(-1px);
}

/* Contact Section */
.contact-section {
  text-align: center;
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--border-color);
}

.btn-contact {
  width: 100%;
  padding: 10px 20px; /* Reduced */
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
  text-align: center;
  font-size: 0.8rem; /* Reduced */
}

.btn-contact:hover {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
}

/* Product Dropdown */
.product-dropdown {
  position: relative;
}

.product-dropdown-toggle {
  background-color: rgba(255, 255, 255, 0.9);
  border: 1.5px solid var(--input-border);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: 0.7rem; /* Reduced from 0.8rem */
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between; /* Pushes arrow to the right */
  padding: 10px 14px; /* Matches form-control padding */
  width: 100%; /* Makes it fill the width */
  transition: var(--transition);
}

.product-dropdown-toggle:hover {
  color: var(--primary-color);
  border-color: #9ca3af; /* Matches form-control hover */
}

.product-dropdown-toggle .fa-chevron-down {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.6rem;
  margin-left: 8px; /* Added space */
}

.product-dropdown.open .product-dropdown-toggle .fa-chevron-down {
  transform: rotate(180deg);
}

.product-dropdown-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-lg);
  list-style: none;
  padding: var(--spacing-xs) 0;
  margin: 0;
  min-width: 160px; /* Reduced from 180px */
  z-index: 1000;
  opacity: 0;
  transform: translateY(6px) scale(0.95);
  transform-origin: bottom center;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.product-dropdown.open .product-dropdown-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.product-dropdown-menu a {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md); /* Reduced */
  color: var(--dark-color);
  text-decoration: none;
  font-size: 0.7rem; /* Reduced from 0.8rem */
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.product-dropdown-menu a:hover {
  background-color: rgba(241, 245, 249, 0.9);
  color: var(--primary-color);
}

.product-dropdown-menu a.selected,
.product-dropdown-menu a.selected:hover {
  background-color: var(--primary-color);
  color: white;
}

/* Footer */
.site-footer {
  background-color: #f8f9fa;
  padding: var(--spacing-md);
  text-align: center;
  font-size: 0.7rem; /* Reduced from 0.8rem */
  color: var(--secondary-color);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xs);
}

.footer-link {
  color: var(--secondary-color);
  text-decoration: none;
  font-size: 0.7rem; /* Reduced */
}

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

/* Form Validation States */
.is-invalid {
  border-color: var(--danger-color);
  background-image: none;
}

.is-invalid:focus {
  border-color: var(--danger-color);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

/* Loading States */
.btn-submit.loading {
  pointer-events: none;
}

body.loading {
  pointer-events: none;
}

body.loading .login-container {
  pointer-events: auto;
}

/* Responsive Design - Mobile First Approach */
@media (min-width: 320px) and (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .main-content {
    flex-direction: column;
  }

  .slider-section {
    flex: none;
    height: 200px; /* Reduced */
    padding: var(--spacing-md) var(--spacing-sm);
  }

  .slider-container {
    max-width: 240px; /* Reduced */
  }

  .slide-icon {
    width: 36px; /* Reduced */
    height: 36px; /* Reduced */
  }

  .slide-title {
    font-size: 1.2rem; /* Slightly reduced */
  }

  .slide-description {
    font-size: 0.7rem; /* Reduced */
    max-width: 200px;
  }

  .login-container {
    max-width: 300px;
    padding: var(--spacing-lg);
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }

  .form-group.full-width {
    grid-column: span 1;
  }

  .form-control {
    padding: 9px 12px; /* Reduced */
    font-size: 0.8rem;
  }

  .btn-submit,
  .btn-create-account {
    padding: 9px 18px; /* Reduced */
    font-size: 0.8rem;
  }

  .slider-dot {
    width: 5px;
    height: 5px;
  }

  .form-alert {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.7rem;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .main-content {
    flex-direction: column;
  }

  .slider-section {
    flex: none;
    height: 220px;
    padding: var(--spacing-lg) var(--spacing-md);
  }

  .slider-container {
    max-width: 280px;
  }

  .slide-icon {
    width: 40px;
    height: 40px;
  }

  .login-container {
    max-width: 320px;
    padding: var(--spacing-xl);
  }

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

  .form-group.full-width {
    grid-column: span 1;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .login-container {
    max-width: 340px;
  }

  .slider-section {
    padding: var(--spacing-xl) var(--spacing-lg);
  }

  .form-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
  }
}

@media (min-width: 1025px) {
  .main-content {
    flex-direction: row;
  }

  .slider-section,
  .form-section {
    flex: 1;
  }

  .login-container {
    max-width: 360px;
    padding: var(--spacing-2xl);
  }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .form-control,
  .btn-submit,
  .btn-create-account {
    border-width: 0.5px;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --background-color: #1f2937;
    --text-primary-dark: #f9fafb;
    --text-muted-dark: #d1d5db;
    --border-color-dark: #4b5563;
  }

  body {
    background-color: #111827;
    color: var(--text-primary-dark);
  }

  .form-section {
    background-color: #ffffff;
  }

  .login-container .login-title,
  .login-container .form-label,
  .login-container .password-strength-text,
  .login-container .form-check-label,
  .login-container .create-account-text,
  .login-container .btn-create-account,
  .login-container .btn-contact,
  .login-container .product-dropdown-toggle {
    color: var(--text-primary);
  }

  .login-container .login-subtitle,
  .login-container .password-strength-text,
  .login-container .create-account-text,
  .login-container .form-check-label {
      color: var(--text-muted);
  }

  .form-control {
    background-color: var(--input-bg);
    color: var(--text-primary);
    border-color: var(--input-border);
  }

  .product-dropdown-menu {
    background-color: #fff;
    border: 1px solid var(--border-color);
  }

  .product-dropdown-menu a {
    color: var(--text-primary);
  }

  .product-dropdown-menu a:hover {
    background-color: #f8fafc;
    color: var(--primary-color);
  }

  .site-footer {
      background-color: #111827;
      border-top-color: var(--border-color-dark);
      color: var(--text-muted-dark);
  }

  .footer-link {
      color: var(--text-muted-dark);
  }

  /* Modal Styling for Dark Mode */
  .modal-content {
    background-color: #1f2937; /* Dark background for modal */
    color: var(--text-primary-dark); /* Light text */
    border-color: var(--border-color-dark);
  }

  .modal-header {
    border-color: var(--border-color-dark);
  }

  .modal-title {
    color: var(--text-primary-dark); /* White heading */
  }

  .modal-body {
    color: var(--text-primary-dark); /* White body text */
  }

  .modal-body .form-label,
  .modal-body .form-select {
      color: var(--text-primary-dark);
  }

  .modal-body .form-select {
      background-color: #374151;
      border-color: var(--border-color-dark);
      color: var(--text-primary-dark);
  }
  .modal-body .form-select option {
      background-color: #374151; /* Ensure options are dark */
      color: var(--text-primary-dark);
  }

  .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%); /* Make close button white */
  }
}

/* NEW: Dropdown invalid state */
.product-dropdown.is-invalid .product-dropdown-toggle {
    border: 1.5px solid var(--danger-color);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

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

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .form-control {
    border-width: 2px;
  }

  .form-control:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
  }

  .btn-submit {
    border: 2px solid transparent;
  }
}

/* Print Styles */
@media print {
  .slider-section,
  .btn-submit,
  .btn-create-account,
  .btn-contact {
    display: none;
  }

  .main-content {
    flex-direction: column;
  }

  .form-section {
    background: white;
  }
}
