/* Login Page Styles - Basado en ReservaGym oficial */

.login-page {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-family);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Login Container */
.login-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: var(--space-lg);
}

/* Background */
.login-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.background-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.background-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgb(44 62 80 / 80%) 0%,
    rgb(44 62 80 / 60%) 50%,
    rgb(255 107 53 / 30%) 100%
  );
}

/* Login Card */
.login-card {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 20px 40px var(--shadow-color);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
}

/* Header */
.login-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.login-logo img {
  width: 40px;
  height: 40px;
}

.brand-text {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--primary-color);
}

.login-title {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  line-height: var(--line-height-tight);
  margin-bottom: 20px;
}

/* Animated Gym Name Styles */
.gym-name-animated {
  position: relative;
  display: inline-block;
  background: linear-gradient(135deg, #ff6b35, #f7931e, #ff6b35);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 3s ease-in-out infinite;
  font-weight: var(--font-weight-black);
  text-shadow: 0 0 30px rgb(255 107 53 / 30%);
  transition: all 0.3s ease;
  cursor: default;
}

.gym-name-animated:hover {
  transform: scale(1.02);
  filter: brightness(1.1);
}

.gym-name-animated::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, #ff6b35, #f7931e, #ff6b35);
  background-size: 200% 200%;
  border-radius: 4px;
  z-index: -1;
  opacity: 0.1;
  animation: gradientShift 3s ease-in-out infinite;
}

/* Animation for gym name transitions */
.gym-name-animated.fade-out {
  animation: fadeOutUp 0.6s ease-in-out forwards;
}

.gym-name-animated.fade-in {
  animation: fadeInDown 0.6s ease-in-out forwards;
}

.gym-name-animated.scale-pulse {
  animation: scalePulse 0.8s ease-in-out forwards;
}

/* Keyframe animations */
@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes fadeOutUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
  }
}

@keyframes fadeInDown {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(1.1);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes scalePulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Typing effect animation */
.gym-name-animated.typing {
  overflow: hidden;
  border-right: 2px solid #ff6b35;
  animation:
    typing 1.5s steps(20, end),
    blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink-caret {
  0%,
  100% {
    border-color: transparent;
  }
  50% {
    border-color: #ff6b35;
  }
}

/* Slide and rotate animation */
.gym-name-animated.slide-rotate {
  animation: slideRotate 0.8s ease-in-out forwards;
}

@keyframes slideRotate {
  0% {
    transform: translateX(0) rotate(0deg);
    opacity: 1;
  }
  50% {
    transform: translateX(20px) rotate(5deg);
    opacity: 0.3;
  }
  100% {
    transform: translateX(-20px) rotate(-2deg);
    opacity: 0;
  }
}

/* Bounce effect */
.gym-name-animated.bounce-in {
  animation: bounceIn 0.9s ease-out forwards;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(-30px);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1) translateY(0);
  }
  70% {
    opacity: 1;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Glitch effect */
.gym-name-animated.glitch {
  animation: glitch 0.6s ease-in-out;
}

@keyframes glitch {
  0%,
  100% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 2px);
  }
  40% {
    transform: translate(-2px, -2px);
  }
  60% {
    transform: translate(2px, 2px);
  }
  80% {
    transform: translate(2px, -2px);
  }
}

/* Sparkle particles effect */
.gym-name-animated.sparkle::after {
  content: "✨";
  position: absolute;
  top: -10px;
  right: -15px;
  font-size: 12px;
  animation: sparkleFloat 2s ease-in-out infinite;
  opacity: 0.8;
}

@keyframes sparkleFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.8;
  }
  50% {
    transform: translateY(-8px) rotate(180deg);
    opacity: 1;
  }
}

.login-subtitle {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
}

/* Form Styles */
.login-form {
  margin-bottom: var(--space-2xl);
}

.form-group {
  margin-bottom: var(--space-xl);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.form-field {
  width: 100%;
  padding: 8px 2.5rem 8px 12px; /* ⬅️ reduce padding vertical y deja espacio a la derecha */
  height: 44px; /* opcional pero ayuda a mantener uniformidad */
  line-height: 1.2; /* para que no se corte el texto */
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background: var(--input-bg);
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.form-field:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgb(255 107 53 / 10%);
}

.form-field::placeholder {
  color: var(--text-tertiary);
}

.form-field.error {
  border-color: var(--error-color);
  box-shadow: 0 0 0 3px rgb(220 53 69 / 10%);
}

/* Password Field */
.password-field {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  border-radius: 4px;
  transition: color 0.2s ease;
}

.password-toggle:hover {
  color: var(--primary-color);
}

/* Checkbox */
.checkbox-group {
  margin-bottom: var(--space-lg);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  position: relative;
  background: var(--input-bg);
  transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

/* Error Styles */
.field-error {
  margin-top: var(--space-xs);
  font-size: var(--font-size-sm);
  color: var(--error-color);
  display: none;
}

.field-error.show {
  display: block;
}

.form-error {
  background: rgb(220 53 69 / 10%);
  border: 1px solid rgb(220 53 69 / 20%);
  border-radius: 8px;
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.error-icon {
  font-size: var(--font-size-lg);
}

.error-text {
  font-size: var(--font-size-sm);
  color: var(--error-color);
  line-height: var(--line-height-relaxed);
}

/* Submit Button */
.submit-button {
  width: 100%;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 16px 24px;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.submit-button:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgb(255 107 53 / 30%);
}

.submit-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.button-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgb(255 255 255 / 30%);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Login Footer */
.login-footer {
  text-align: center;
}

.help-section {
  margin-bottom: var(--space-lg);
}

.help-link {
  color: var(--primary-color);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: color 0.2s ease;
}

.help-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.divider {
  margin: var(--space-xl) 0;
  position: relative;
}

.divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-color);
}

.divider span {
  background: var(--card-bg);
  color: var(--text-tertiary);
  padding: 0 var(--space-md);
  font-size: var(--font-size-sm);
}

.back-section {
  margin-bottom: var(--space-lg);
}

.back-text {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.back-link {
  color: var(--primary-color);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.nav-section {
  padding-top: var(--space-lg);
  border-top: 1px solid var(--gray-100);
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--font-size-sm);
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--primary-color);
}

/* Privacy Notice */
.privacy-notice {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgb(255 255 255 / 95%);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--gray-200);
  padding: var(--space-md);
  z-index: 10;
}

.privacy-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  text-align: center;
}

.privacy-icon {
  font-size: var(--font-size-sm);
}

.privacy-link {
  color: var(--primary-color);
  text-decoration: none;
}

.privacy-link:hover {
  text-decoration: underline;
}

/* Modal Styles */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 50%);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgb(0 0 0 / 15%);
  max-width: 500px;
  width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-xl);
  border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin: 0;
}

.modal-close {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--gray-100);
  border: none;
  font-size: var(--font-size-lg);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--gray-200);
}

.modal-body {
  padding: var(--space-xl);
}

.modal-footer {
  padding: var(--space-xl);
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
}

/* Help Modal Specific Styles */
.help-modal {
  max-width: 600px;
}

.help-section {
  margin-bottom: var(--space-2xl);
}

.help-section:last-child {
  margin-bottom: 0;
}

.help-section h4 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.help-steps,
.help-options {
  margin: var(--space-md) 0;
  padding-left: var(--space-lg);
}

.help-steps li,
.help-options li {
  margin-bottom: var(--space-sm);
  line-height: var(--line-height-relaxed);
  color: var(--text-secondary);
}

.help-steps strong,
.help-options strong {
  color: var(--text-primary);
}

.help-tip {
  background: rgb(255 107 53 / 10%);
  border: 1px solid rgb(255 107 53 / 20%);
  border-radius: 8px;
  padding: var(--space-md);
  margin: var(--space-md) 0;
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  line-height: var(--line-height-relaxed);
}

.tip-icon {
  font-size: var(--font-size-lg);
  flex-shrink: 0;
}

.help-options a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
}

.help-options a:hover {
  text-decoration: underline;
}

/* Success Modal */
.success-modal {
  display: flex;
  align-items: center;
  justify-content: center;
}
.success-modal-content {
  text-align: center;
  max-width: 360px;
  width: 90%;
  background: var(--modal-bg);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 10px 25px rgb(0 0 0 / 15%);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
}
.success-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}
.animate-fade-in {
  animation: fadeInScale 0.3s ease;
}
@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
.animate-fade-out {
  animation: fadeOutScale 0.3s ease forwards;
}
@keyframes fadeOutScale {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.8);
  }
}

.success-actions {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

/* Responsive Design */
@media (width <= 768px) {
  .login-container {
    padding: var(--space-md);
  }

  .login-card {
    padding: 2rem 1.5rem;
    margin-bottom: 60px; /* Space for privacy notice */
  }

  .login-title {
    font-size: var(--font-size-2xl);
  }

  .privacy-notice {
    position: relative;
    margin-top: var(--space-lg);
  }

  /* Modal responsive */
  .modal-content {
    width: 95vw;
    margin: var(--space-lg);
  }

  .help-modal {
    max-width: none;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }
}

@media (width <= 480px) {
  .login-card {
    padding: 1.5rem 1rem;
    border-radius: 12px;
  }

  .login-title {
    font-size: var(--font-size-xl);
  }

  .form-field {
    padding: 12px 14px;
  }

  .submit-button {
    padding: 14px 20px;
  }

  .privacy-content {
    flex-direction: column;
    gap: var(--space-xs);
  }
}

/* Footer Styles - Login Page */
.footer {
  padding: var(--space-2xl) 0;
  background: rgb(44 62 80 / 95%);
  backdrop-filter: blur(10px);
  color: white;
  position: relative;
  z-index: 2;
  border-top: 1px solid rgb(255 255 255 / 10%);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
}

.footer-logo img {
  height: 2rem;
  filter: brightness(1) invert(0);
}

.footer-links {
  display: flex;
  gap: var(--space-xl);
}

.footer-links a {
  color: rgb(255 255 255 / 80%);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: white;
  text-decoration: underline;
}

.footer-bottom {
  text-align: center;
  padding-top: var(--space-lg);
  border-top: 1px solid rgb(255 255 255 / 20%);
  color: rgb(255 255 255 / 70%);
  font-size: var(--font-size-sm);
}

/* Footer responsive for login page */
@media (width <= 768px) {
  .footer {
    padding: var(--space-xl) 0;
  }

  .footer-content {
    flex-direction: column;
    gap: var(--space-lg);
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
  }

  .footer-bottom {
    padding-top: var(--space-md);
  }
}

@media (width <= 480px) {
  .footer-links {
    flex-direction: column;
    gap: var(--space-sm);
  }
}
