/* Auth-specific styles */
.auth-section {
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  background: linear-gradient(180deg, var(--color-bg-dark), var(--color-bg-dark-alt));
}

.auth-container {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

.auth-form {
  background: var(--color-card-bg);
  border-radius: var(--radius-l);
  padding: 48px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  transition:
    transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

.auth-form::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-2));
  border-radius: var(--radius-l) var(--radius-l) 0 0;
}

.auth-form:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.7);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--color-text);
  letter-spacing: -0.5px;
}

.auth-subtitle {
  color: var(--color-muted);
  font-size: 1.1rem;
  margin: 0;
  opacity: 0.9;
}

.auth-form-content {
  margin-bottom: 24px;
}

.auth-submit {
  width: 100%;
  margin-top: 16px;
  font-size: 1.05rem;
  font-weight: 800;
}

.auth-footer {
  text-align: center;
}

.auth-footer p {
  color: var(--color-muted);
  font-size: 0.95rem;
  margin: 0;
}

.auth-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s var(--ease);
  position: relative;
}

.auth-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.3s var(--ease);
}

.auth-link:hover {
  color: var(--color-primary-2);
}

.auth-link:hover::after {
  width: 100%;
}

/* Form animations */
.auth-form {
  animation: fadeInUp 0.5s var(--ease);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .auth-section {
    padding: 40px 0;
    min-height: calc(100vh - 120px);
  }

  .auth-form {
    padding: 36px 28px;
    border-radius: var(--radius-m);
  }

  .auth-title {
    font-size: 1.9rem;
    margin-bottom: 10px;
  }

  .auth-subtitle {
    font-size: 1rem;
  }

  .auth-header {
    margin-bottom: 28px;
  }

  .auth-form-content {
    margin-bottom: 20px;
  }
}

@media (max-width: 480px) {
  .auth-section {
    padding: 30px 0;
  }

  .auth-form {
    padding: 28px 24px;
    border-radius: var(--radius-s);
  }

  .auth-title {
    font-size: 1.7rem;
  }

  .auth-subtitle {
    font-size: 0.95rem;
  }

  .auth-header {
    margin-bottom: 24px;
  }
}

/* ── Mobile responsive: unified auth for all devices ── */
@media (max-width: 768px) {
  .header-container {
    justify-content: space-between;
    padding: 10px 16px;
    margin: 0;
  }

  .logo img {
    height: 50px;
  }

  .logo span {
    font-size: 1.1rem;
  }

  /* Hide desktop nav links on mobile */
  .nav-menu {
    display: none;
  }

  .auth-section {
    padding: 20px 16px;
    min-height: calc(100vh - 80px);
  }

  .auth-form {
    padding: 28px 20px;
    border-radius: 14px;
    margin: 0 4px;
  }

  .auth-title {
    font-size: 1.6rem;
  }

  .auth-subtitle {
    font-size: 0.9rem;
  }

  .captcha-image-row {
    flex-direction: column;
    gap: 8px;
  }

  .captcha-container img {
    width: 150px;
    height: 60px;
  }

  /* Footer mobile */
  .footer {
    padding: 30px 16px;
    text-align: center;
  }

  .footer .container {
    padding: 0;
  }

  .switch-view-container {
    display: none;
  }
}

/* ==========================================
   CAPTCHA STYLES
   ========================================== */

.captcha-container {
  margin: 20px 0;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-m);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.captcha-container label {
  display: block;
  margin-bottom: 0;
}

.captcha-image-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.captcha-container img {
  display: block;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-s);
  background: white;
  cursor: default;
  width: 180px;
  height: 70px;
}

.refresh-btn-icon {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-s);
  cursor: pointer;
  font-size: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.3s var(--ease),
    border-color 0.3s var(--ease),
    transform 0.2s var(--ease);
}

.refresh-btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: rotate(30deg);
}

.refresh-btn-icon:active {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(0.95);
}

.captcha-container input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-s);
  font-size: 16px;
  text-align: center;
  color: var(--color-text);
  transition:
    border-color 0.3s var(--ease),
    background 0.3s var(--ease);
}

.captcha-container input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: rgba(0, 0, 0, 0.4);
}

/* Turnstile container — centrado sin cortar el widget */
.captcha-container [id^="turnstile-"] {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 65px;
}

.terms-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0 6px;
}

.terms-checkbox-group input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.password-toggle .material-icons {
  font-size: 20px;
  line-height: 1;
}

.terms-checkbox-group label {
  color: var(--color-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.terms-checkbox-group a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

.terms-checkbox-group a:hover {
  color: var(--color-primary-2);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  background: var(--color-card-bg);
  border-radius: var(--radius-l);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 24px 32px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--color-text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--color-muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text);
}

.modal-body {
  padding: 24px 32px 32px;
}

/* ==========================================
   ERROR & FEEDBACK BANNERS
   ========================================== */

.error-message,
#forgot-password-feedback {
  position: sticky;
  top: 6px;
  z-index: 100;
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ff1744 0%, #d50000 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow:
    0 4px 24px rgba(255, 23, 68, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.15);
  border: none;
  animation: errorSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(4px);
}

.error-message::before,
#forgot-password-feedback::before {
  content: "⚠️";
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
}

#forgot-password-feedback {
  position: relative;
  top: auto;
  margin-top: 15px;
  margin-bottom: 15px;
}

#forgot-password-feedback.success-message {
  background: linear-gradient(135deg, #00c853 0%, #009624 100%);
  box-shadow:
    0 4px 24px rgba(0, 200, 83, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.15);
}

#forgot-password-feedback.success-message::before {
  content: "✅";
}

@keyframes errorSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-28px) scale(0.96);
  }
  60% {
    transform: translateY(4px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


.modal-body .error-message,
.modal-body #forgot-password-feedback {
  position: relative;
  top: auto;
}
