/* Contenedor Principal */
.tpco-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Colores */
:root {
    --tpco-primary-blue: #003366; /* Azul Marino */
    --tpco-primary-yellow: #FFD700; /* Amarillo Escolar */
    --tpco-text-dark: #222;
    --tpco-text-light: #555;
    --tpco-border: #ddd;
    --tpco-bg-light: #f9f9f9;
}

/* Tipografía */
.tpco-container h2, .tpco-container h3, .tpco-container h4 {
    color: var(--tpco-primary-blue);
    margin-top: 0;
}
.tpco-container p {
    color: var(--tpco-text-light);
    line-height: 1.6;
}

/* Formularios */
.tpco-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
.tpco-field {
    display: flex;
    flex-direction: column;
}
.tpco-field label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--tpco-text-dark);
}
.tpco-field input[type="text"],
.tpco-field input[type="email"],
.tpco-field input[type="tel"],
.tpco-field input[type="number"],
.tpco-field select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--tpco-border);
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box; /* Importante para el padding */
}
.tpco-field input:focus, .tpco-field select:focus {
    border-color: var(--tpco-primary-blue);
    box-shadow: 0 0 0 2px rgba(0, 51, 102, 0.2);
    outline: none;
}

/* Checkboxes y Radios */
.tpco-field-inline {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}
.tpco-field-inline input[type="checkbox"],
.tpco-field-inline input[type="radio"] {
    margin-right: 10px;
    flex-shrink: 0;
}
.tpco-field-inline label {
    font-weight: normal;
    color: var(--tpco-text-light);
    margin: 0;
    line-height: 1.5;
}
.tpco-consentimientos {
    border-top: 1px solid var(--tpco-border);
    margin-top: 20px;
    padding-top: 20px;
}
#tpco-tutor-datos {
    border-left: 3px solid var(--tpco-primary-yellow);
    padding-left: 15px;
    margin-top: 15px;
}

/* Botones */
.tpco-button-primary, .tpco-button-secondary {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.tpco-button-primary {
    background-color: var(--tpco-primary-blue);
    color: #ffffff;
}
.tpco-button-primary:hover {
    background-color: #004a99;
}
.tpco-button-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}
.tpco-button-secondary {
    background-color: #f0f0f0;
    color: var(--tpco-text-dark);
}
.tpco-button-secondary:hover {
    background-color: #e0e0e0;
}

/* Loader */
.tpco-loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--tpco-primary-blue);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: tpco-spin 1s linear infinite;
    margin: 20px auto;
}
@keyframes tpco-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alertas */
.tpco-alert {
    padding: 15px;
    margin-top: 20px;
    border-radius: 4px;
    border: 1px solid transparent;
}
.tpco-alert-error {
    color: #a94442;
    background-color: #f2dede;
    border-color: #ebccd1;
}
.tpco-success-message {
    color: #3c763d;
    background-color: #dff0d8;
    border-color: #d6e9c6;
    padding: 15px;
    border-radius: 4px;
}

/* Test (Paso 2) */
#tpco-test-container {
    border-top: 1px solid var(--tpco-border);
    margin-top: 20px;
    padding-top: 20px;
}
#tpco-progress-bar-container {
    width: 100%;
    background-color: #f0f0f0;
    border-radius: 8px;
    height: 30px;
    position: relative;
    margin-bottom: 20px;
}
#tpco-progress-bar {
    width: 0%;
    height: 100%;
    background-color: var(--tpco-primary-yellow);
    border-radius: 8px;
    transition: width 0.3s ease;
}
#tpco-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--tpco-primary-blue);
    font-weight: 600;
}

/* Preguntas */
.tpco-question-block {
    padding: 20px;
    margin-bottom: 20px;
    background: var(--tpco-bg-light);
    border-radius: 8px;
    border: 1px solid var(--tpco-border);
}
.tpco-question-block.tpco-unanswered {
    border-left: 4px solid #a94442; /* Rojo error */
    box-shadow: 0 0 10px rgba(169, 68, 66, 0.1);
}
.tpco-question-block p {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--tpco-text-dark);
    margin-bottom: 15px;
}
.tpco-options-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.tpco-options-list li {
    margin-bottom: 10px;
}
.tpco-options-list label {
    display: block;
    padding: 10px;
    border: 1px solid var(--tpco-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.1s ease;
}
.tpco-options-list input[type="radio"] {
    margin-right: 10px;
}
.tpco-options-list label:hover {
    background: #fdfdfd;
    border-color: #bbb;
}
.tpco-options-list input[type="radio"]:checked + label {
    background: #e7f0f7; /* Azul claro */
    border-color: var(--tpco-primary-blue);
    font-weight: 500;
}
/* Ocultar el radio button real */
.tpco-options-list input[type="radio"] {
    display: none;
}


/* Navegación Test */
.tpco-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

/* Resultados (Gráfica) */
#tpco-chart-container {
    max-width: 100%;
    margin-top: 20px;
}


/* FIX: Estilo para el botón de Finalizar Test */
/* <-- AQUÍ ESTÁ EL ARREGLO (FIX 4B) */
.tpco-button-finalizar {
    background-color: #FFD700 !important; /* Amarillo escolar */
    color: #003366 !important; /* Letras azul marino */
    border: 1px solid #003366 !important;
}
.tpco-button-finalizar:hover {
    background-color: #e6c300 !important; /* Amarillo más oscuro */
    color: #003366 !important;
}