/* ============================================================
   Sistema MFA — style.css (corregido y mejorado)
   Tipografía: IBM Plex Sans + IBM Plex Mono (técnico/formal)
   Paleta:     azul marino institucional + acento cian
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:      #0d1b2a;
  --navy-mid:  #1b2d42;
  --cyan:      #00c2cb;
  --cyan-dim:  #007f85;
  --white:     #f4f7fa;
  --gray-light:#e2e8f0;
  --gray-mid:  #94a3b8;
  --error:     #e74c3c;
  --success:   #27ae60;
  --info:      #2980b9;
  --font-sans: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --radius:    6px;
  --shadow:    0 8px 32px rgba(0,0,0,0.18);
}

body {
  font-family: var(--font-sans);
  background: var(--navy);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(0,194,203,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(0,194,203,0.05) 0%, transparent 50%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ─── Shell: sidebar + panel ──────────────────────────────── */
.shell {
  display: flex;
  width: 100%;
  max-width: 860px;
  min-height: 520px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* ─── Barra lateral ──────────────────────────────────────── */
.steps-sidebar {
  width: 210px;
  flex-shrink: 0;
  background: var(--navy-mid);
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 36px;
}
.brand-icon { font-size: 22px; color: var(--cyan); }
.brand-name {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.04em;
}

.step-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: default;
  transition: background 0.2s;
}
.step-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray-mid);
  min-width: 20px;
  transition: color 0.2s;
}
.step-label {
  font-size: 13px;
  color: var(--gray-mid);
  transition: color 0.2s;
}

.step-item.active {
  background: rgba(0,194,203,0.12);
}
.step-item.active .step-num,
.step-item.active .step-label { color: var(--cyan); }

.step-item.completed .step-num,
.step-item.completed .step-label { color: var(--white); opacity: 0.6; }

.sidebar-footer {
  margin-top: auto;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--gray-mid);
  line-height: 1.8;
}

/* ─── Panel principal ─────────────────────────────────────── */
.main-panel {
  flex: 1;
  background: var(--white);
  padding: 40px 36px;
  overflow-y: auto;
}

.panel-section { animation: fadeIn 0.3s ease; }

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

.section-header { margin-bottom: 28px; }
.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--cyan-dim);
  background: rgba(0,194,203,0.1);
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.success-tag { color: var(--success); background: rgba(39,174,96,0.1); }

.section-header h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}
.section-header p {
  font-size: 13px;
  color: var(--gray-mid);
  line-height: 1.6;
}

/* ─── Formularios ─────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
input[type="text"],
input[type="password"],
input[type="tel"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-light);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--navy);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
input::placeholder { color: var(--gray-mid); opacity: 1; }
input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0,194,203,0.15);
}

/* ─── Botón principal ─────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 12px 20px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.2s, transform 0.1s;
  margin-top: 8px;
}
.btn-primary:hover  { background: var(--navy-mid); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── Mensajes de estado ──────────────────────────────────── */
.msg {
  font-size: 13px;
  min-height: 20px;
  margin: 8px 0;
  padding: 0 2px;
  border-radius: 3px;
  transition: all 0.2s;
}
.msg.error   { color: var(--error); }
.msg.success { color: var(--success); }
.msg.info    { color: var(--info); }

/* ─── OTP Display ─────────────────────────────────────────── */
.otp-display-box {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.otp-label {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.otp-code {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 0.18em;
}
.otp-hint {
  font-size: 10px;
  color: var(--gray-mid);
  text-align: center;
  font-style: italic;
  margin-top: 2px;
}

/* ─── Barra de progreso del timer ────────────────────────── */
.timer-bar-wrap {
  height: 4px;
  background: var(--gray-light);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}
.timer-bar {
  height: 100%;
  width: 100%;
  background: var(--cyan);
  border-radius: 2px;
  transform-origin: left;
}
.timer-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gray-mid);
  margin-bottom: 14px;
}

/* ─── Video / Cámara ─────────────────────────────────────── */
.video-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
  background: #000;
}
video {
  width: 100%;
  display: block;
  border-radius: var(--radius);
}
.video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.face-frame {
  width: 140px;
  height: 170px;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  opacity: 0.6;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 0.9; transform: scale(1.03); }
}

/* ─── Panel de éxito ─────────────────────────────────────── */
.access-log {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.log-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.log-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  flex-shrink: 0;
}
.log-event { color: var(--white); flex: 1; }
.log-date  { color: var(--gray-mid); font-size: 10px; }

.divider {
  border: none;
  border-top: 1px solid var(--gray-light);
  margin: 24px 0;
}

/* ─── Cuestionario ───────────────────────────────────────── */
.survey-wrap { }

.survey-header { margin-bottom: 22px; }
.survey-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}
.survey-header p {
  font-size: 13px;
  color: var(--gray-mid);
  margin-bottom: 10px;
}
.scale-legend {
  display: flex;
  gap: 12px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--cyan-dim);
}

.survey-section { margin-bottom: 24px; }
.survey-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-mid);
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--gray-light);
}

.survey-item { margin-bottom: 16px; }
.question-text {
  font-size: 13px;
  color: var(--navy);
  line-height: 1.5;
  margin-bottom: 8px;
}
.q-num {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--cyan-dim);
  margin-right: 4px;
}

/* Escala Likert */
.likert-scale {
  display: flex;
  gap: 8px;
}
.likert-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.likert-option input[type="radio"] { display: none; }
.likert-val {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--gray-light);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-mid);
  transition: all 0.15s;
}
.likert-option:hover .likert-val {
  border-color: var(--cyan);
  color: var(--cyan);
}
.likert-option input:checked + .likert-val {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--cyan);
}

/* Tabla de resultados */
.survey-result {
  margin-top: 24px;
  padding: 20px;
  background: var(--navy);
  border-radius: var(--radius);
  color: var(--white);
}
.survey-result h4 {
  font-size: 15px;
  color: var(--cyan);
  margin-bottom: 8px;
}
.survey-result p {
  font-size: 13px;
  color: var(--gray-mid);
  margin-bottom: 14px;
}
.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-family: var(--font-mono);
}
.result-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-mid);
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.result-table td {
  padding: 8px 8px;
  color: var(--white);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.result-table td:last-child { color: var(--cyan); text-align: right; }
.total-row td { color: var(--white) !important; }
.total-row td:last-child { color: var(--cyan) !important; font-size: 16px; }

.survey-note {
  font-size: 11px !important;
  font-style: italic;
  margin-top: 12px !important;
}

/* ─── Alternar Login / Registro ───────────────────────────── */
.auth-switch {
  font-size: 12px;
  color: var(--gray-mid);
  text-align: center;
  margin-top: 16px;
}
.auth-switch a {
  color: var(--cyan-dim);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.auth-switch a:hover { border-color: var(--cyan-dim); }

/* ─── Resumen de datos guardados ──────────────────────────── */
.data-saved {
  background: rgba(39,174,96,0.08);
  border: 1px solid rgba(39,174,96,0.25);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.data-saved-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--success);
  margin-bottom: 8px;
}
.data-saved-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--navy);
  padding: 3px 0;
}
.data-saved-row span:last-child { color: var(--cyan-dim); font-weight: 600; }
.btn-secondary {
  margin-top: 12px;
  width: 100%;
  padding: 9px 16px;
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--gray-light);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-secondary:hover { border-color: var(--cyan); color: var(--cyan-dim); }

/* ─── Input del OTP (centrado y espaciado) ────────────────── */
.otp-input {
  text-align: center;
  letter-spacing: 0.4em;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
}
#resendBtn { margin-top: 8px; }
#resendBtn:disabled { opacity: 0.5; cursor: not-allowed; border-color: var(--gray-light); color: var(--gray-mid); }

/* ─── Utilidad ────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .shell { flex-direction: column; max-width: 100%; }
  .steps-sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; padding: 16px; gap: 8px; }
  .brand { width: 100%; }
  .step-list { flex-direction: row; }
  .sidebar-footer { display: none; }
  .main-panel { padding: 24px 18px; }
  .likert-scale { flex-wrap: wrap; }
}
