/* 
 * Register 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), 580px) !important;
  min-height: calc(100vh - 3rem) !important;
  background: var(--white) !important;
  padding: 2rem 2.5rem !important;
  display: flex !important;
  align-items: flex-start !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;
}

/* Submit button alignment - align to right */
.auth-form .btn-primary.submit-btn,
.auth-form button[type="submit"] {
  display: block;
  margin-left: auto;
  margin-right: 0;
}

/* Alternative approach with flexbox for form actions container */
.auth-form .form-actions,
.auth-form .submit-container {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.auth-form .form-actions .btn-primary,
.auth-form .submit-container .btn-primary {
  margin-left: auto;
  margin-right: 0;
}

/* Make sure input / select / textarea inside auth form inherit the same font */
.auth-form input,
.auth-form textarea,
.auth-form select,
.auth-form button,
.auth-form .input-wrapper input {
  font-family: inherit;
}

/* 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 .btn-primary,
.user-type-selector .btn-secondary,
.user-type-selector button[data-type] {
  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 .btn-primary.active,
.user-type-selector .btn-secondary.active,
.user-type-selector button[data-type].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 .btn-primary:hover,
.user-type-selector .btn-secondary:hover,
.user-type-selector button[data-type]:hover {
  color: var(--toby-dark) !important;
  background-color: rgba(255, 255, 255, 0.5) !important;
}

.user-type-selector .btn-primary.active:hover,
.user-type-selector .btn-secondary.active:hover,
.user-type-selector button[data-type].active:hover {
  background-color: var(--white) !important;
  transform: none !important;
}

.user-type-selector .btn-primary svg,
.user-type-selector .btn-secondary svg,
.user-type-selector button[data-type] svg {
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

/* 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 .btn-primary,
  .user-type-selector .btn-secondary,
  .user-type-selector button[data-type] {
    padding: 0.625rem 0.375rem !important;
    min-height: 2.5rem !important;
    font-size: 0.8rem !important;
    gap: 0.375rem !important;
  }
  
  .user-type-selector .btn-primary svg,
  .user-type-selector .btn-secondary svg,
  .user-type-selector button[data-type] svg {
    width: 16px !important;
    height: 16px !important;
  }
  
  /* Reduce form group spacing */
  .form-group {
    margin-bottom: 0.875rem;
  }
  
  /* Smaller divider margin */
  .auth-divider {
    margin: 1.25rem 0;
  }
  
  /* Smaller step header */
  .step-header {
    margin-bottom: 1.25rem;
    text-align: left;
  }
  
  .step-header h3 {
    font-size: 1.125rem;
  }
  
  .step-header p {
    font-size: 0.85rem;
  }
  
  /* Navigation buttons mobile */
  .onboarding-navigation {
    margin-top: 1.5rem;
    gap: 0.75rem;
  }
  
  .onboarding-navigation .btn-secondary,
  .onboarding-navigation .btn-primary {
    min-width: auto;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
  }
}

@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 .btn-primary,
  .user-type-selector .btn-secondary,
  .user-type-selector button[data-type] {
    min-height: 2.25rem !important;
    font-size: 0.75rem !important;
    padding: 0.5rem 0.25rem !important;
  }
  
  .step-header {
    margin-bottom: 1rem;
  }
  
  .step-header h3 {
    font-size: 1.1rem;
  }
  
  .step-header p {
    font-size: 0.8rem;
  }
  
  /* Smaller form inputs */
  .form-group label {
    font-size: 0.85rem;
    margin-bottom: 0.375rem;
  }
  
  .input-wrapper input,
  .input-wrapper select {
    padding: 0.625rem 0.75rem 0.625rem 2.5rem;
    font-size: 0.9rem;
  }
  
  .input-wrapper .input-icon {
    width: 18px;
    height: 18px;
    left: 0.75rem;
  }
}

/* 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%;
}

.input-wrapper textarea {
  padding-top: 0.75rem;
  padding-left: 1rem;
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

/* 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);
}

/* Progress steps alignment fixes */
.progress-steps::before {
  top: 50%; /* Ensure the line passes through the middle */
  transform: translateY(-50%); /* Perfect centering */
  z-index: 1;
}

.step {
  position: relative;
  z-index: 2;
}

/* Improved step navigation */
.onboarding-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  gap: 1rem;
}

/* When only one button is visible, position correctly */
.onboarding-navigation .prev-btn[style*="display: none"] ~ .next-btn,
.onboarding-navigation .prev-btn[style*="display: none"] ~ .submit-btn {
  margin-left: auto;
}

/* Button alignment */
.onboarding-navigation .btn-secondary,
.onboarding-navigation .btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 120px;
}

/* Prev button to the left */
.onboarding-navigation .prev-btn {
  margin-right: auto;
}

/* Next/Submit button to the right */
.onboarding-navigation .next-btn,
.onboarding-navigation .submit-btn {
  margin-left: auto;
}

/* 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: 0.875rem;
}



/* Terms row styling */
.terms-row {
  margin: 1.25rem 0;
  /* Force single-column layout so the checkbox fills the row */
  grid-template-columns: 1fr;
}

/* Ensure the checkbox container fills the available width */
.terms-row .form-check {
  width: 100%;
  display: flex;
  /* Span the full row if parent grid has multiple columns */
  grid-column: 1 / -1;
}

/* Fix for the checkbox in terms row */
.form-check {
  display: flex;
  align-items: flex-start;
  padding: 0.875rem;
  gap: 0.75rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius-lg);
  transition: all 0.2s ease;
}

.form-check:hover {
  background: rgba(255, 204, 0, 0.05);
  border-color: rgba(255, 204, 0, 0.3);
}

/* Make checkbox bigger and more visible */
.form-check .form-check-input,
.form-check input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  min-height: 1.25rem;
  margin: 0;
  margin-top: 0.125rem;
  cursor: pointer;
  accent-color: var(--toby-yellow);
  border: 2px solid var(--gray-400);
  border-radius: 4px;
  flex-shrink: 0;
}

.form-check .form-check-input:checked,
.form-check input[type="checkbox"]:checked {
  background-color: var(--toby-yellow);
  border-color: var(--toby-yellow);
}

.form-check .form-check-label,
.form-check label {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--gray-700);
  cursor: pointer;
}

.form-check .form-check-label a,
.form-check label a {
  color: var(--toby-dark);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-check .form-check-label a:hover,
.form-check label a:hover {
  color: #b38f00;
}

/* Improve auth divider and footer */
.auth-divider {
  position: relative;
  text-align: center;
  margin: 1.5rem 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 0.875rem;
  color: var(--gray-500);
  font-size: 0.8rem;
}

.auth-footer {
  text-align: center;
}

.auth-footer p {
  color: var(--gray-600);
  font-size: 0.875rem;
}

.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);
}

/* Hide progress bar completely */
.onboarding-progress {
  display: none !important;
}

/* Fix steps on small screens */
@media (max-width: 480px) {
  .progress-steps {
    margin-bottom: 2rem;
  }
  
  .step-label {
    font-size: 0.75rem;
    max-width: 80px;
  }
  
  .step-number {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
  }
  
  .progress-bar {
    top: 1.25rem;
    left: 1.25rem;
    right: 1.25rem;
  }
}

/* Onboarding Steps - Show/Hide functionality */
.onboarding-step {
  display: none;
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.3s ease;
}

.onboarding-step.active {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

.step-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.step-header h3 {
  color: var(--gray-900);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
  font-family: var(--font-display);
}

.step-header p {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin: 0;
}

/* Hide walker-specific steps by default */
.walker-step {
  display: none !important;
}

.walker-step.active {
  display: block !important;
}

/* Progress indicator visibility for walker steps */
.progress-steps .walker-step {
  display: none;
}

/* When walker type is selected, show walker step in progress */
.user-type-walker .progress-steps .walker-step {
  display: flex;
}

/* 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);
  }
}

/* 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;
}

/* Password strength indicator */
.password-strength {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.strength-bar {
  height: 4px;
  background-color: var(--gray-200);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.strength-fill {
  height: 100%;
  transition: width 0.3s ease, background-color 0.3s ease;
  border-radius: 2px;
}

.strength-fill.strength-weak {
  background-color: #ef4444;
}

.strength-fill.strength-medium {
  background-color: #f59e0b;
}

.strength-fill.strength-strong {
  background-color: #10b981;
}

.strength-text {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* Form validation styles */
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* 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);
  }
}

/* Form hint text */
.form-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 0.375rem;
  line-height: 1.4;
}

/* User-only fields - hide when walker is selected */
body.user-type-walker .user-only-field {
  display: none;
}

/* Referral code field styling */
.form-group[data-field="referral"] input {
  text-transform: uppercase;
}

/* Input wrapper and icons styling */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
  z-index: 1;
}

.input-wrapper input,
.input-wrapper select {
  padding-left: 2.5rem;
}

.input-wrapper .password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-wrapper .password-toggle:hover {
  color: var(--gray-600);
}

/* Style for required asterisk on labels (stronger, applied globally) */
.required-asterisk {
  color: #d9534f !important; /* red */
  margin-left: 0.25rem;
  font-weight: 700;
  display: inline-block;
  line-height: 1;
  font-size: 0.95em;
}
