/* Auth.module.css */

.authContainer {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 25%, #3b82f6 100%);
  position: relative;
  padding: 1rem;
  overflow: hidden;
}

.backgroundPattern {
  position: absolute;
  inset: 0;
  opacity: 0.1;
  pointer-events: none;
}

.circlePattern {
  position: absolute;
  top: 10%;
  right: 10%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  animation: float 6s ease-in-out infinite;
}

.gridPattern {
  position: absolute;
  bottom: 10%;
  left: 10%;
  width: 200px;
  height: 200px;
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.1) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
  animation: pulse 4s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.1;
  }
  50% {
    opacity: 0.3;
  }
}

.authCard {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.2);
  padding: 3rem;
  width: 100%;
  max-width: 440px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.authCard::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #60a5fa, #93c5fd);
  border-radius: 24px 24px 0 0;
}

.authHeader {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logoContainer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 20px;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
  position: relative;
}

.logoContainer::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  border-radius: 18px;
  z-index: -1;
}

.logoIcon {
  color: white;
  width: 32px;
  height: 32px;
}

.title {
  font-size: 2rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.5rem 0;
  background: linear-gradient(135deg, #1e293b, #475569);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
  color: #64748b;
  font-size: 1rem;
  margin: 0;
  font-weight: 500;
}

.authForm {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.errorMessage {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  color: #dc2626;
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideIn 0.3s ease-out;
}

.errorIcon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.inputGroup {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.label {
  font-weight: 600;
  color: #374151;
  font-size: 0.875rem;
  letter-spacing: 0.025em;
}

.inputWrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.inputIcon {
  position: absolute;
  left: 1rem;
  width: 20px;
  height: 20px;
  color: #9ca3af;
  z-index: 1;
}

.input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
  outline: none;
  color: blueviolet;
}

.input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: rgba(255, 255, 255, 0.95);
}

.input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.input::placeholder {
  color: #9ca3af;
}

.passwordToggle {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  z-index: 1;
}

.passwordToggle:hover {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.passwordToggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.submitButton {
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.submitButton::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 ease;
}

.submitButton:hover::before {
  left: 100%;
}

.submitButton:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

.submitButton:active {
  transform: translateY(0);
}

.submitButton:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.submitButton:disabled:hover {
  transform: none;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.authFooter {
  margin-top: 2rem;
  text-align: center;
  border-top: 1px solid #e5e7eb;
  padding-top: 1.5rem;
}

.footerText {
  color: #9ca3af;
  font-size: 0.875rem;
  margin: 0;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 640px) {
  .authContainer {
    padding: 0.5rem;
  }

  .authCard {
    padding: 2rem 1.5rem;
    max-width: 100%;
    margin: 0.5rem;
  }

  .title {
    font-size: 1.75rem;
  }

  .logoContainer {
    width: 70px;
    height: 70px;
  }

  .logoIcon {
    width: 28px;
    height: 28px;
  }

  .circlePattern {
    width: 200px;
    height: 200px;
    top: 5%;
    right: 5%;
  }

  .gridPattern {
    width: 150px;
    height: 150px;
    bottom: 5%;
    left: 5%;
  }
}

@media (max-width: 480px) {
  .authCard {
    padding: 1.5rem 1rem;
    border-radius: 16px;
  }

  .title {
    font-size: 1.5rem;
  }

  .subtitle {
    font-size: 0.875rem;
  }

  .input {
    padding: 0.875rem 0.875rem 0.875rem 2.5rem;
  }

  .inputIcon {
    left: 0.875rem;
    width: 18px;
    height: 18px;
  }

  .passwordToggle {
    right: 0.875rem;
  }

  .submitButton {
    padding: 0.875rem 1.5rem;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .authCard {
    background: white;
    border: 2px solid #000;
  }

  .input {
    border: 2px solid #000;
  }

  .submitButton {
    background: #000;
    border: 2px solid #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .circlePattern,
  .gridPattern,
  .submitButton::before,
  .spinner {
    animation: none;
  }

  .submitButton:hover {
    transform: none;
  }

  .errorMessage {
    animation: none;
  }
}
