/* Modal Animations - IMPORTANT: Override all widths */
.auth-modal .modal-dialog {
  max-width: 420px !important;
  width: 420px !important;
  animation: modalSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#authModal .modal-dialog {
  max-width: 420px !important;
    width: 90% !important;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-modal .modal-content {
  border: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

/* Close Button */
.auth-modal .btn-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  opacity: 0.6;
  transition: all 0.3s ease;
  z-index: 10;
  font-size: 1.2rem;
}

.auth-modal .btn-close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

.form-toggle {
  display: flex;
  margin-bottom: 0;
  background: #f8f9fa;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.form-toggle button {
  flex: 1;
  padding: 0.95rem;
  border: none;
  background: transparent;
  color: #6c757d;
  font-weight: 600;
  font-size: 0.98em;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.form-toggle button:first-child {
  border-radius: 20px 0 0 0;
}

.form-toggle button:last-child {
  border-radius: 0 20px 0 0;
}

.form-toggle button.active {
  background: #fff;
  color: #058837;
}

.form-toggle button.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #058837;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.auth-modal .modal-body {
  padding: 1.8rem 2rem;
  background: #fff;
}

/* Form Slide Animation */
#login-form,
#signup-form {
  animation: fadeSlideIn 0.4s ease-out;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.auth-modal input:not([type="checkbox"]):not([type="file"]) {
  width: 100%;
  padding: 0.75rem 1rem;
  margin: 0.3rem 0;
  border-radius: 8px;
  border: 2px solid #e8e8e8;
  background: #fff;
  font-weight: 500;
  font-size: 0.95em;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.auth-modal input:not([type="checkbox"]):not([type="file"]):focus {
  outline: none;
  border-color: #058837;
  box-shadow: 0 4px 12px rgba(5, 136, 55, 0.15);
  transform: translateY(-1px);
}

.auth-modal input[type="file"] {
  padding: 0.6rem 0.8rem;
  margin: 0.3rem 0;
  border-radius: 8px;
  border: 2px solid #e8e8e8;
  background: #fff;
  font-size: 0.85em;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.auth-modal input[type="file"]:focus {
  outline: none;
  border-color: #058837;
  box-shadow: 0 4px 12px rgba(5, 136, 55, 0.15);
}

.auth-modal .btn-auth {
  width: 100%;
  padding: 0.85rem;
  margin-top: 1rem;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 1em;
  background: #058837;
  color: #fff;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(5, 136, 55, 0.3);
}

.auth-modal .btn-auth:hover {
  background: #046d2d;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(5, 136, 55, 0.4);
}

.auth-modal .btn-auth:active {
  transform: translateY(0);
}

.auth-modal .text-link {
  color: #058837;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
  font-size: 0.9em;
}

.auth-modal .text-link:hover {
  color: #046d2d;
  text-decoration: underline;
}

/* Updated Form Row - Stack on smaller modal */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.form-row .form-group {
  width: 100%;
}

.password-toggle {
  position: relative;
}

.password-toggle input {
  padding-right: 45px;
}

.password-toggle .toggle-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #999;
  transition: all 0.3s ease;
  font-size: 1.1rem;
}

.password-toggle .toggle-icon:hover {
  color: #058837;
  transform: translateY(-50%) scale(1.1);
}

.terms-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 1rem;
  padding: 0.9rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px solid #e8e8e8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.terms-wrapper input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #058837;
  flex-shrink: 0;
}

.terms-wrapper label {
  font-size: 0.85em;
  color: #555;
  line-height: 1.5;
  margin: 0;
}

.alert {
  border-radius: 8px;
  margin-bottom: 1rem;
  border: none;
  animation: slideDown 0.4s ease-out;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 0.75rem 1rem;
  font-size: 0.9em;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background: #d4edda;
  color: #155724;
}

.alert-danger {
  background: #f8d7da;
  color: #721c24;
}

small.text-muted {
  color: #6c757d !important;
  font-size: 0.8em;
  display: block;
  margin-top: 0.3rem;
  margin-bottom: 0.5rem;
}

/* Label Styling */
.auth-modal label:not(.terms-wrapper label) {
  font-size: 0.9em;
  font-weight: 600;
  color: #555;
  margin-bottom: 0.3rem;
  display: block;
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .auth-modal .modal-dialog {
    max-width: 95%;
    margin: 1rem auto;
  }
  .auth-modal .modal-dialog,
  #authModal .modal-dialog {
    width: 85% !important;
  }
  
  .auth-modal input:not([type="checkbox"]):not([type="file"]),
  .auth-modal input[type="file"],
  .auth-modal .btn-auth {
    box-sizing: border-box !important;
  }
  .auth-modal .modal-body {
    padding: 1.5rem 1.5rem;
  }

  .form-toggle button {
    font-size: 0.95em;
    padding: 0.9rem;
  }

  .auth-modal input:not([type="checkbox"]):not([type="file"]) {
    padding: 0.7rem 0.9rem;
    font-size: 0.9em;
  }

  .terms-wrapper {
    padding: 0.8rem;
  }

  .terms-wrapper label {
    font-size: 0.8em;
  }
}

/* Enhanced Header Styles - Solid Green Background */
header .navbar {
  background: #058837 !important;
  transition: all 0.4s ease;
  padding: 1.5rem 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(5, 136, 55, 0.3);
}

header .navbar.scrolled {
  background: #058837 !important;
  box-shadow: 0 4px 12px rgba(5, 136, 55, 0.4);
  padding: 0.75rem 0;
  backdrop-filter: none;
}

header .navbar .navbar-brand {
  color: white !important;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
  font-weight: 600;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

header .navbar.scrolled .navbar-brand {
  font-size: 1.3rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

header .navbar .navbar-brand img {
  border: 3px solid white;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  width: 50px;
  height: 50px;
  transition: all 0.3s ease;
}

header .navbar.scrolled .navbar-brand img {
  width: 40px;
  height: 40px;
  border-width: 2px;
}

header .navbar .nav-link {
  color: white !important;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
  font-weight: 500;
  font-size: 1.05rem;
  transition: all 0.3s ease;
  position: relative;
  padding-bottom: 0.5rem !important;
}

header .navbar.scrolled .nav-link {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  font-size: 1rem;
}

header .navbar .nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: white;
  transition: all 0.3s ease;
  transform: translateX(-50%);
  border-radius: 2px;
}

header .navbar .nav-link:not(.dropdown-toggle):hover::after {
  width: 80%;
}

header .navbar .nav-link:hover {
  color: rgba(255, 255, 255, 0.8) !important;
  transform: translateY(-2px);
}

header .navbar .nav-link.active {
  font-weight: bold;
  text-decoration: none;
}

header .navbar .nav-link.active::after {
  width: 80%;
  background: white;
}

header .dropdown-menu {
  background: white;
  border: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  overflow: hidden;
}

header .dropdown-item {
  color: #333 !important;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.75rem 1.5rem;
}

header .dropdown-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 70%;
  background: rgba(5, 136, 55, 0.1);
  transition: width 0.3s ease;
  border-radius: 0 5px 5px 0;
}

header .dropdown-item:hover {
  background: #058837;
  color: white !important;
  transform: translateX(5px);
  padding-left: 2rem;
}

header .dropdown-item:hover::before {
  width: 5px;
  background: white;
}

header .dropdown-item.text-danger {
  color: #dc3545 !important;
}

header .dropdown-item.text-danger:hover {
  color: white !important;
  background: #dc3545;
}

header .navbar-toggler {
  border: 2px solid white;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.6rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

header .navbar-toggler:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

header .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  width: 1.5rem;
  height: 1.5rem;
}

header .navbar .rounded-circle {
  border: 3px solid white;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

header .navbar .rounded-circle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.4);
}

header .btn-primary {
  background: white;
  color: #058837;
  border: 2px solid white;
  padding: 0.6rem 1.5rem;
  font-weight: 600;
  border-radius: 25px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

header .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
  background: transparent;
  color: white;
  border-color: white;
}

@media (max-width: 992px) {
  header .navbar {
    padding: 1.2rem 0;
  }

  header .navbar.scrolled {
    padding: 0.6rem 0;
  }

  header .navbar .navbar-brand {
    font-size: 1.3rem;
  }

  header .navbar .nav-link {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  header .navbar {
    padding: 1rem 0;
  }

  header .navbar.scrolled {
    padding: 0.5rem 0;
  }

  header .navbar .navbar-brand {
    font-size: 1.2rem;
  }

  header .navbar .navbar-brand img {
    width: 40px;
    height: 40px;
  }

  header .navbar-collapse {
    background: #058837;
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  }

  header .navbar .nav-link {
    padding: 0.75rem 1rem !important;
    margin: 0.25rem 0;
    border-radius: 5px;
  }

  header .navbar .nav-link::after {
    bottom: 0.25rem;
  }

  header .navbar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
  }
}