/* Auth Pages Specific Styles (Login & Signup) */

/* Auth Page Layout */
.auth-page {
  background: linear-gradient(
    135deg,
    rgba(255, 122, 182, 0.1),
    rgba(216, 154, 216, 0.1)
  );
  height: 100vh;
  overflow: hidden;
}

/* Desktop layout - no scrolling */
@media (min-width: 769px) {
  .auth-page {
    height: 100vh;
    overflow: hidden;
  }
}

/* Mobile layout - allow scrolling */
@media (max-width: 768px) {
  .auth-page {
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
  }
}

/* Fixed header styling */
.auth-page header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Auth main content area */
.auth-main {
  height: calc(100vh - 5rem);
  margin-top: 5rem; /* Account for fixed header */
  padding-top: 1rem;
  padding-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Desktop layout - fixed height, no scrolling */
@media (min-width: 769px) {
  .auth-main {
    height: calc(100vh - 5rem);
    margin-top: 5rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Mobile layout - flexible height, allow scrolling */
@media (max-width: 768px) {
  .auth-main {
    min-height: calc(100vh - 4rem);
    margin-top: 4rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
  }
}

/* Auth Card Styling */
.auth-card {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 122, 182, 0.5) transparent;
}

/* Desktop layout - entire card scrollable within viewport */
@media (min-width: 769px) {
  .auth-card {
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    overflow-x: hidden;
  }
}

/* Mobile layout - entire card scrollable within viewport */
@media (max-width: 768px) {
  .auth-card {
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    overflow-x: hidden;
  }
}

/* Scrollbar styling for auth cards */
.auth-card::-webkit-scrollbar {
  width: 6px;
}

.auth-card::-webkit-scrollbar-track {
  background: transparent;
}

.auth-card::-webkit-scrollbar-thumb {
  background-color: rgba(255, 122, 182, 0.5);
  border-radius: 3px;
}

.auth-card::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 122, 182, 0.7);
}

.auth-card form {
  margin-bottom: 1rem;
}

/* Compact spacing for signup form */
.auth-card .space-y-3 > * + * {
  margin-top: 0.75rem;
}

.auth-card .space-y-4 > * + * {
  margin-top: 1rem;
}

/* Auth Input Styling */
.auth-input {
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: #ff7ab6;
  box-shadow: 0 0 0 3px rgba(255, 122, 182, 0.1);
  transform: translateY(-1px);
}

.auth-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Auth Button Styling */
.auth-button {
  background: linear-gradient(135deg, #ff7ab6, #ff9ac6);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.auth-button:hover {
  background: linear-gradient(135deg, #ff6ba8, #ff8bb8);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(255, 122, 182, 0.3);
}

.auth-button:active {
  transform: translateY(0);
}

.auth-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.auth-button:hover::before {
  left: 100%;
}

/* Form validation styles */
.auth-input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.auth-input.success {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Loading state */
.auth-button.loading {
  pointer-events: none;
  opacity: 0.7;
}

.auth-button.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Mobile optimizations for auth pages */
@media (max-width: 768px) {
  .auth-page {
    padding: 0;
  }

  .auth-page header {
    height: 4rem;
  }

  .auth-page header .text-2xl {
    font-size: 1.25rem;
  }

  .auth-card {
    margin: 0.5rem;
    padding: 1rem;
    border-radius: 1rem;
  }

  .auth-input {
    padding: 0.75rem 1rem;
    font-size: 16px; /* Prevent zoom on iOS */
  }

  .auth-button {
    padding: 0.75rem 1rem;
    font-size: 16px; /* Prevent zoom on iOS */
  }

  /* Reduce spacing on mobile */
  .auth-card form {
    gap: 0.75rem;
  }

  .auth-card .space-y-3 > * + * {
    margin-top: 0.5rem;
  }

  .auth-card .space-y-4 > * + * {
    margin-top: 0.75rem;
  }

  .auth-card .space-y-6 > * + * {
    margin-top: 0.75rem;
  }

  /* Ensure form fields are properly spaced */
  .auth-card form > div {
    margin-bottom: 0.5rem;
  }

  .auth-card form > div:last-child {
    margin-bottom: 0;
  }
}

@media (max-width: 480px) {
  .auth-page header {
    height: 3.5rem;
  }

  .auth-page header .text-2xl {
    font-size: 1.125rem;
  }

  .auth-card {
    margin: 0.25rem;
    padding: 0.75rem;
  }

  .auth-input {
    padding: 0.625rem 0.875rem;
    font-size: 16px;
  }

  .auth-button {
    padding: 0.625rem 0.875rem;
    font-size: 16px;
  }

  /* Even tighter spacing on very small screens */
  .auth-card form {
    gap: 0.5rem;
  }

  .auth-card .space-y-3 > * + * {
    margin-top: 0.375rem;
  }

  .auth-card .space-y-4 > * + * {
    margin-top: 0.5rem;
  }

  .auth-card .space-y-6 > * + * {
    margin-top: 0.5rem;
  }

  /* Ensure form fields are properly spaced on very small screens */
  .auth-card form > div {
    margin-bottom: 0.375rem;
  }

  .auth-card form > div:last-child {
    margin-bottom: 0;
  }

  /* Make labels smaller on very small screens */
  .auth-card label {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
  }

  /* Reduce input padding on very small screens */
  .auth-input {
    padding: 0.5rem 0.75rem;
    font-size: 14px;
  }

  /* Reduce button padding on very small screens */
  .auth-button {
    padding: 0.5rem 0.75rem;
    font-size: 14px;
  }
}
