/* === Pruebas Psicométricas — Frontend === */

.ppsi-container {
    max-width: 820px;
    margin: 40px auto;
    padding: 28px;
    background: #ffffff !important;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: #1e293b !important;
    line-height: 1.55;
}
.ppsi-container h1, .ppsi-container h2, .ppsi-container h3, .ppsi-container p,
.ppsi-container strong, .ppsi-container span, .ppsi-container label {
    color: inherit;
}
.ppsi-header { border-bottom: 1px solid #e2e8f0; margin-bottom: 24px; padding-bottom: 14px; }
.ppsi-header h1 { margin: 0 !important; font-size: 26px !important; color: #1a365d !important; }
.ppsi-subtitle { margin: 6px 0 0 !important; color: #475569 !important; font-size: 14px !important; }

/* Enunciados / progreso / paso — siempre sobre fondo blanco con texto oscuro */
.ppsi-step { color: #64748b !important; }
.ppsi-enunciado { color: #1a365d !important; }
#ppsi-test-mount h2 { color: #1a365d !important; }
#ppsi-test-mount p { color: #1e293b !important; }

.ppsi-welcome { background: #f1f5f9; border-radius: 10px; padding: 18px 20px; }
.ppsi-welcome p { margin: 0 0 10px; color: #1e293b !important; }

/* Consentimiento informado */
.ppsi-consent {
    background: #ffffff !important;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 16px 20px;
    margin: 16px 0;
    font-size: 13px;
    line-height: 1.55;
    color: #1e293b !important;
}
.ppsi-consent h3 {
    margin: 0 0 10px !important;
    color: #0e7490 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
}
.ppsi-consent p {
    margin: 6px 0 !important;
    color: #334155 !important;
    font-size: 13px !important;
}
.ppsi-consent p strong { color: #0f172a !important; }
.ppsi-consent-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #ecfeff;
    border: 1px solid #67e8f9;
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 14px;
    cursor: pointer;
    font-size: 13.5px;
    color: #0e7490 !important;
}
.ppsi-consent-check input[type="checkbox"] {
    -webkit-appearance: checkbox !important;
    appearance: checkbox !important;
    width: 18px !important;
    height: 18px !important;
    margin: 2px 0 0 0 !important;
    flex: 0 0 auto;
    accent-color: #0e7490;
    opacity: 1 !important;
}
.ppsi-consent-check span {
    flex: 1;
    color: #0f172a !important;
    line-height: 1.5;
}
.ppsi-consent-check span strong { color: #0e7490 !important; }

.ppsi-btn {
    display: inline-block !important;
    padding: 10px 20px !important; border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important; color: #1e293b !important;
    cursor: pointer !important; font-size: 15px !important; font-weight: 600 !important;
    transition: background .15s, border-color .15s;
    text-decoration: none !important;
    text-shadow: none !important;
}
.ppsi-btn:hover:not(:disabled) { background: #f8fafc !important; }
.ppsi-btn:disabled { opacity: .5 !important; cursor: not-allowed !important; }
.ppsi-btn-primary {
    background: #1a365d !important; border-color: #1a365d !important;
    color: #ffffff !important;
}
.ppsi-btn-primary:hover:not(:disabled) { background: #142749 !important; color: #ffffff !important; }

.ppsi-progress {
    height: 6px; background: #e2e8f0; border-radius: 99px;
    overflow: hidden; margin-bottom: 18px;
}
.ppsi-progress-bar { height: 100%; background: linear-gradient(90deg, #3182ce, #1a365d); transition: width .25s; }
.ppsi-step { font-size: 13px; color: #64748b; margin: 0 0 4px; text-transform: uppercase; letter-spacing: .06em; }
.ppsi-enunciado { font-size: 18px; margin: 0 0 18px; color: #1a365d; }

.ppsi-cleaver-grid {
    width: 100%; border-collapse: separate; border-spacing: 0;
    margin: 14px 0 18px; background: #fff !important;
    border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden;
}
.ppsi-cleaver-grid th, .ppsi-cleaver-grid td {
    padding: 10px 12px !important; border-bottom: 1px solid #e2e8f0;
    text-align: center; vertical-align: middle;
    background: #ffffff !important;
}
.ppsi-cleaver-grid thead th {
    background: #f8fafc !important; padding: 14px 12px !important;
}
.ppsi-cleaver-grid tbody tr:last-child td { border-bottom: none; }
.ppsi-cleaver-grid tbody tr:hover td { background: #f8fafc !important; }
.ppsi-cleaver-adj {
    text-align: left !important; font-weight: 600 !important;
    color: #1e293b !important; font-size: 15px !important;
}

/* Encabezados MÁS / MENOS como píldoras de alto contraste —
   legibles aunque el tema pinte el thead de cualquier color. */
.ppsi-cleaver-th {
    display: inline-block !important;
    padding: 6px 18px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: #ffffff !important;
    line-height: 1.2 !important;
}
.ppsi-cleaver-th--mas   { background: #1a365d !important; color: #ffffff !important; }
.ppsi-cleaver-th--menos { background: #c2410c !important; color: #ffffff !important; }

/* Botón visible (no depende del input nativo del navegador) */
.ppsi-cleaver-cell {
    display: inline-flex; align-items: center; justify-content: center;
    width: 46px; height: 46px;
    background: transparent; border: 0; padding: 0; margin: 0;
    cursor: pointer; border-radius: 50%;
    transition: background-color 0.15s, transform 0.1s;
    -webkit-appearance: none; appearance: none;
}
.ppsi-cleaver-cell:hover { background: #e2e8f0; }
.ppsi-cleaver-cell:active { transform: scale(0.95); }
.ppsi-cleaver-cell.is-selected.is-mas   { background: #dbeafe; }
.ppsi-cleaver-cell.is-selected.is-menos { background: #fed7aa; }

.ppsi-cleaver-dot { display: inline-block; line-height: 0; }
.ppsi-cleaver-dot svg { display: block; }

.ppsi-cleaver-status {
    margin: 4px 0 8px; padding: 8px 14px;
    background: #fff7ed; border-left: 3px solid #f59e0b;
    border-radius: 6px; font-size: 13px; color: #78350f;
}
.ppsi-cleaver-status.is-ok {
    background: #ecfdf5; border-left-color: #10b981; color: #065f46;
}

.ppsi-likert { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 10px 0 20px; }
.ppsi-likert-opt {
    border: 2px solid #cbd5e1; border-radius: 10px;
    padding: 14px 8px; text-align: center; cursor: pointer;
    background: #fff; transition: border-color .15s, transform .1s, background .15s;
    position: relative;
}
.ppsi-likert-opt:hover { border-color: #3182ce; transform: translateY(-1px); }
.ppsi-likert-opt.is-selected { border-color: #1a365d; background: #e6efff; }
/* Forzamos ocultar el input nativo aunque el tema le ponga otras reglas */
.ppsi-likert-opt input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 1px !important; height: 1px !important;
    margin: 0 !important;
}
.ppsi-likert-num { display: block; font-size: 22px; font-weight: 700; color: #1a365d; }
.ppsi-likert-lbl { display: block; font-size: 12px; color: #475569; margin-top: 4px; }
/* Marca visible cuando está seleccionado (independiente del input nativo) */
.ppsi-likert-opt.is-selected::after {
    content: "✓";
    position: absolute;
    top: 4px; right: 6px;
    color: #1a365d;
    font-weight: 700;
    font-size: 14px;
}

.ppsi-options, .ppsi-choices { display: grid; gap: 8px; margin: 10px 0 20px; }
.ppsi-option {
    display: flex; align-items: center; gap: 10px;
    border: 1px solid #cbd5e1; border-radius: 10px;
    padding: 12px 14px; cursor: pointer; background: #fff; font-size: 15px;
    transition: border-color .15s, background .15s;
    position: relative;
}
.ppsi-option:hover { border-color: #3182ce; }
.ppsi-option.is-selected { border-color: #1a365d; background: #e6efff; }
/* Radio nativo: lo mantenemos visible pase lo que pase con el tema externo */
.ppsi-option input[type="radio"] {
    -webkit-appearance: radio !important;
    appearance: radio !important;
    display: inline-block !important;
    opacity: 1 !important;
    width: 18px !important;
    height: 18px !important;
    margin: 0 4px 0 0 !important;
    accent-color: #1a365d;
    flex: 0 0 auto;
}
/* Indicador visual extra: marca de selección por la izquierda */
.ppsi-option.is-selected::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: #1a365d;
    border-radius: 10px 0 0 10px;
}

.ppsi-input {
    width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1;
    border-radius: 8px; font-size: 15px;
}

.ppsi-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }

.ppsi-timer-wrap { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 16px; }
.ppsi-timer {
    font-variant-numeric: tabular-nums; font-weight: 700;
    background: #1a365d; color: #fff; padding: 10px 16px;
    border-radius: 8px; font-size: 20px;
}
.ppsi-timer--low { background: #c53030; animation: ppsi-pulse 1s infinite; }
@keyframes ppsi-pulse { 50% { opacity: .6; } }

.ppsi-items { padding-left: 22px; }
.ppsi-items li { margin-bottom: 16px; }

.ppsi-instrucciones { color: #475569; font-size: 14px; background: #f1f5f9; padding: 10px 14px; border-radius: 8px; }

.ppsi-completed, .ppsi-notice, .ppsi-submitting {
    padding: 22px; background: #f1f5f9; border-radius: 12px; text-align: center;
}
.ppsi-completed h2 { margin: 0 0 8px; color: #065f46; }
.ppsi-notice { color: #9b2c2c; background: #fff5f5; border: 1px solid #fed7d7; }

@media (max-width: 640px) {
    .ppsi-likert { grid-template-columns: repeat(5, 1fr); }
    .ppsi-likert-lbl { display: none; }
    .ppsi-timer-wrap { flex-direction: column; }
}

/* Prueba mixta: pantalla de inicio de cada parte */
.ppsi-section-intro { background:#f1f5f9; border-left:4px solid #1a365d; border-radius:8px; padding:18px 22px; margin:12px 0 18px; }
.ppsi-section-intro h2 { margin-top:0; }
