/* 
 * Login Page Specific Fixes
 * Fixed Welcome Section with Parallax Effect
 */

/* Override auth-page background to prevent conflicts */
.auth-page {
  background: #ffcc00;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Adjust main section */
.auth-section {
  padding: 0;
  min-height: 100vh;
  display: block;
}

/* New wrapper layout for fixed/scroll effect */
.auth-wrapper {
  display: flex;
  min-height: 100vh;
  max-width: none;
  margin: 0;
  padding: 0;
  position: relative;
}

/* Fixed welcome section - left side */
.auth-welcome {
  position: fixed;
  top: 0;
  left: 0;
  width: 35vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  z-index: 1;
  background: #ffcc00;
  color: var(--toby-dark);
}

/* Scrollable form section - right side */
.auth-form-container {
  position: relative !important;
  margin-left: 35vw !important;
  margin-top: 1.5rem !important;
  margin-bottom: 1.5rem !important;
  width: min(calc(65vw - 3rem), 480px) !important;
  min-height: calc(100vh - 3rem) !important;
  background: var(--white) !important;
  padding: 2rem 2.5rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.08) !important;
  border-radius: 1.5rem !important;
  margin-right: 1.5rem !important;
}

/* Force rounded corners with higher specificity */
.auth-page .auth-section .auth-wrapper .auth-form-container {
  border-radius: 1.5rem !important;
  overflow: hidden;
}

/* Additional specificity for the form container */
body.auth-page .auth-form-container.animate-fade-up {
  border-radius: 1.5rem !important;
}

/* Override any conflicting border-radius from other stylesheets */
.auth-form-container,
.auth-form-container.animate-fade-up,
div.auth-form-container {
  border-radius: 1.5rem !important;
}

/* Welcome content styling */
.welcome-content {
  max-width: 400px;
  width: 100%;
}

.welcome-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.2;
  color: var(--toby-dark);
}

.welcome-description {
  font-size: 1rem;
  color: var(--gray-700);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* Welcome features styling */
.welcome-features {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.feature-item:hover {
  background: rgba(255, 255, 255, 0.45);
  transform: translateX(5px);
}

.feature-icon {
  width: 2.25rem;
  height: 2.25rem;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--toby-dark);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

/* Make sure SVGs are block-level to avoid baseline offset and center properly */
.feature-icon svg {
  display: block;
  width: 18px !important;
  height: 18px !important;
}

.feature-item > span {
  display: block;
  align-self: center;
}

.feature-item span {
  font-weight: 600;
  color: var(--toby-dark);
  font-size: 0.9rem;
}

/* Form container improvements */
.auth-form {
  max-width: 100%;
  width: 100%;
  font-family: 'Stack Sans Text', sans-serif;
}

/* Content sections for user types */
.content-section {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
}

.content-section.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* User type selector buttons - unified styling */
.user-type-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: var(--gray-100);
  padding: 0.25rem;
  border-radius: 0.75rem;
}

.user-type-selector .user-type-btn {
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  font-weight: 500 !important;
  padding: 0.75rem 0.5rem !important;
  border-radius: 0.5rem !important;
  text-decoration: none !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
  border: none !important;
  cursor: pointer !important;
  text-align: center !important;
  min-height: 2.75rem !important;
  white-space: nowrap !important;
  background-color: transparent !important;
  color: var(--gray-600) !important;
  font-size: 0.85rem !important;
  line-height: 1.3 !important;
}

.user-type-selector .user-type-btn.active {
  background-color: var(--white) !important;
  color: var(--toby-dark) !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.user-type-selector .user-type-btn:hover {
  color: var(--toby-dark) !important;
  background-color: rgba(255, 255, 255, 0.5) !important;
}

.user-type-selector .user-type-btn.active:hover {
  background-color: var(--white) !important;
  transform: none !important;
}

.user-type-selector .user-type-btn svg {
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

/* Ensure inputs and buttons inside the auth form use the platform font */
.auth-form input,
.auth-form textarea,
.auth-form select,
.auth-form button,
.auth-form .input-wrapper input {
  font-family: inherit;
}

/* Logo in welcome section - Desktop */
.welcome-logo {
  margin-bottom: 1.5rem;
}

.welcome-logo img {
  height: 2.5rem;
  width: auto;
}

/* Mobile logo above form */
.mobile-logo {
  display: none;
  text-align: center;
  padding: 1.25rem 1rem 0.75rem;
  background: #ffcc00;
}

.mobile-logo img {
  height: 2rem;
  width: auto;
}

/* Responsive design */
@media (max-width: 1024px) {
  .auth-welcome {
    width: 38vw;
    padding: 2.5rem;
  }
  
  .auth-form-container {
    margin-left: 38vw !important;
    padding: 1.75rem !important;
    width: calc(62vw - 2rem) !important;
  }
  
  .welcome-title {
    font-size: 1.75rem;
  }
}

@media (max-width: 768px) {
  /* Switch to stacked layout on mobile */
  .auth-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }
  
  /* Hide welcome section completely on mobile */
  .auth-welcome {
    display: none !important;
  }
  
  /* Show mobile logo */
  .mobile-logo {
    display: block;
  }
  
  .auth-form-container {
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    min-height: auto !important;
    flex: 1;
    padding: 1.5rem 1.25rem 2rem !important;
    box-shadow: none !important;
    border-radius: 1.25rem 1.25rem 0 0 !important;
    align-items: flex-start !important;
  }
  
  /* Reduce form header spacing on mobile */
  .form-header {
    margin-bottom: 1.25rem;
    text-align: left;
  }
  
  .form-title {
    font-size: 1.5rem;
  }
  
  .form-title::after {
    left: 0;
    transform: none;
  }
  
  .form-subtitle {
    font-size: 0.875rem;
  }
  
  /* User type buttons on mobile */
  .user-type-selector {
    margin-bottom: 1.25rem;
  }
  
  .user-type-selector .user-type-btn {
    padding: 0.625rem 0.375rem !important;
    min-height: 2.5rem !important;
    font-size: 0.8rem !important;
    gap: 0.375rem !important;
  }
  
  .user-type-selector .user-type-btn svg {
    width: 16px !important;
    height: 16px !important;
  }
  
  /* Reduce form group spacing */
  .form-group {
    margin-bottom: 0.875rem;
  }
  
  .form-row {
    margin: 1rem 0;
  }
  
  /* Smaller divider margin */
  .auth-divider {
    margin: 1.25rem 0;
  }
}

@media (max-width: 480px) {
  .mobile-logo {
    padding: 1rem 1rem 0.5rem;
  }
  
  .mobile-logo img {
    height: 1.75rem;
  }
  
  .auth-form-container {
    padding: 1.25rem 1rem 1.5rem !important;
    border-radius: 1rem 1rem 0 0 !important;
  }
  
  .form-header {
    margin-bottom: 1rem;
  }
  
  .form-title {
    font-size: 1.35rem;
  }
  
  /* Keep buttons side by side on small screens */
  .user-type-selector {
    gap: 0.375rem;
  }
  
  .user-type-selector .user-type-btn {
    min-height: 2.25rem !important;
    font-size: 0.75rem !important;
    padding: 0.5rem 0.25rem !important;
  }
}

/* Input wrapper styles to position icons inside inputs */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-wrapper .input-icon {
  position: absolute;
  left: 1rem;
  color: var(--gray-500);
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.input-wrapper input,
.input-wrapper select {
  padding-left: 2.75rem; /* Add space for the icon */
  width: 100%;
}

/* Password eye toggle positioning */
.input-wrapper .password-toggle {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-wrapper .password-toggle svg {
  color: var(--gray-500);
  transition: color 0.2s ease;
}

.input-wrapper .password-toggle:hover svg {
  color: var(--toby-dark);
}

/* Smooth scrolling for the entire page */
html {
  scroll-behavior: smooth;
}

/* Additional visual enhancements */
.auth-form-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(255, 204, 0, 0.02) 0%, rgba(255, 255, 255, 0.98) 100%);
  pointer-events: none;
  z-index: -1;
}

/* Enhanced form styling */
.form-header {
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
}

.form-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--toby-dark);
  margin-bottom: 0.5rem;
  position: relative;
}

.form-title::after {
  content: '';
  position: absolute;
  bottom: -0.375rem;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: var(--toby-yellow);
  border-radius: 2px;
}

.form-subtitle {
  color: var(--gray-600);
  font-size: 0.9rem;
  margin: 0;
  margin-top: 1rem;
}

/* Form row styling */
.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.5rem 0;
}

/* Fix for the checkbox in form row */
.form-check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-check-input {
  width: 18px;
  height: 18px;
  accent-color: var(--toby-yellow);
}

.form-check-label {
  color: var(--gray-600);
  font-size: 0.95rem;
  cursor: pointer;
}

.forgot-password {
  color: var(--toby-dark);
  font-weight: 500;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.forgot-password:hover {
  color: var(--toby-yellow);
}

/* Improve auth divider and footer */
.auth-divider {
  position: relative;
  text-align: center;
  margin: 2rem 0;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gray-200);
}

.auth-divider span {
  position: relative;
  background: var(--white);
  padding: 0 1rem;
  color: var(--gray-500);
  font-size: 0.9rem;
}

.auth-footer {
  text-align: center;
}

.auth-footer p {
  color: var(--gray-600);
  font-size: 0.95rem;
}

.auth-footer a {
  color: var(--toby-dark);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-footer a:hover {
  color: var(--toby-yellow);
}

/* Button loading state */
.btn-primary .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 0.5rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Error message container */
.error-message {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  background: #FEF2F2;
  border: 1px solid #FEE2E2;
  color: #DC2626;
  border-radius: var(--border-radius-lg);
  font-size: 0.95rem;
}

/* Hidden elements */
.hidden {
  display: none !important;
}

/* Spinner animation for submit button */
.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--white);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  padding: 1rem 1.5rem;
  margin-bottom: 0.5rem;
  border-left: 4px solid;
  max-width: 320px;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(100%);
  animation: slideIn 0.3s ease forwards;
}

.toast-success {
  border-left-color: var(--toby-green);
}

.toast-error {
  border-left-color: #ef4444;
}

.toast-content strong {
  display: block;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
}

.toast-content p {
  color: var(--gray-600);
  margin: 0;
  font-size: 0.875rem;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Submit button alignment - center aligned */
.auth-form .btn-primary.submit-btn,
.auth-form button[type="submit"] {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: auto;
}

/* Alternative approach with flexbox for form actions container */
.auth-form .form-actions,
.auth-form .submit-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

.auth-form .form-actions .btn-primary,
.auth-form .submit-container .btn-primary {
  margin-left: auto;
  margin-right: auto;
}
