/* ===== Auth Modal ===== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 10, 40, 0.7);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal {
  background: #fff;
  border-radius: 12px;
  padding: 36px 32px 32px;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  animation: slideUp 0.2s ease;
}

.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.15s;
}
.modal-close:hover { color: #333; }

.modal-tab-group {
  display: flex;
  border-bottom: 2px solid #eee;
  margin-bottom: 24px;
  gap: 0;
}

.modal-tab {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #999;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.modal-tab.active { color: #001f5b; border-bottom-color: #c8102e; }
.modal-tab:hover:not(.active) { color: #555; }

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #001f5b;
  margin-bottom: 20px;
}

.modal-pane { }
.modal-pane.hidden { display: none; }

/* Radio group (Sexo) */
.radio-group {
  display: flex;
  gap: 24px;
  margin-top: 6px;
}
.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.92rem;
  color: #333;
  font-weight: 400;
  user-select: none;
}
.radio-option input[type="radio"] {
  display: none;
}
.radio-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ccc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s;
}
.radio-circle::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #001f5b;
  opacity: 0;
  transition: opacity 0.15s;
}
.radio-option input[type="radio"]:checked + .radio-circle {
  border-color: #001f5b;
}
.radio-option input[type="radio"]:checked + .radio-circle::after {
  opacity: 1;
}

/* Form elements */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 5px;
}
.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: #1a1a2e;
  background: #fafafa;
}
.form-group input:focus {
  border-color: #001f5b;
  box-shadow: 0 0 0 3px rgba(0,31,91,0.08);
  background: #fff;
}
.form-group input.error { border-color: #c8102e; }

.field-error {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: #c8102e;
  min-height: 16px;
}

.form-error {
  background: #fff0f2;
  border: 1px solid #f5c6cb;
  color: #721c24;
  border-radius: 5px;
  padding: 9px 12px;
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.form-success {
  background: #eefaf0;
  border: 1px solid #b7e4c7;
  color: #1e7a34;
  border-radius: 5px;
  padding: 9px 12px;
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.modal-link-row {
  text-align: right;
  font-size: 0.85rem;
  margin: -8px 0 16px;
}
.modal-link-row a {
  color: #001f5b;
  text-decoration: none;
  font-weight: 600;
}
.modal-link-row a:hover { color: #c8102e; text-decoration: underline; }
#forgotPane .modal-link-row { text-align: center; margin: 16px 0 0; }

/* Submit button state */
.btn-block { margin-top: 8px; }

.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
  .modal { padding: 28px 20px 24px; }
}

/* ===== Intro del curso (splash de instrucciones, primera vez) =====
   El título y el botón quedan fijos (flex column); solo el contenido
   (video + texto) hace scroll interno — el botón nunca se oculta ni se
   desplaza con el scrollbar, sin importar cuánto texto haya ── */
.modal-course-intro {
  max-width: 1280px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.course-intro-scroll {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.course-intro-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #d9d9d9;
  margin-bottom: 20px;
}
.course-intro-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}
.course-intro-video-placeholder {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #666;
  font-size: 0.95rem;
  text-align: center;
}
.course-intro-video-placeholder span { font-size: 2.2rem; }
/* Si el <video> falla (fuente ausente), oculta el reproductor y muestra el placeholder */
.course-intro-video-ph .course-intro-video { display: none; }
.course-intro-video-ph .course-intro-video-placeholder { display: flex; }
.course-intro-video-ph .course-intro-video-controls { display: none; }

/* Controles propios (sin barra de tiempo, para que no se pueda adelantar):
   solo play/pausa y silencio, superpuestos sobre el video */
.course-intro-video-controls {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  gap: 8px;
}
.civc-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.civc-btn:hover { background: rgba(0, 0, 0, 0.75); }

.course-intro-text {
  color: #333;
  font-size: 0.95rem;
  line-height: 1.6;
}

#courseIntroAcceptBtn {
  flex-shrink: 0;
  margin-top: 20px;
}
#courseIntroAcceptBtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
#courseIntroAcceptBtn:disabled:hover {
  background: var(--navy);
  border-color: var(--navy);
}
.course-intro-text p + p { margin-top: 12px; }
