/* Estilos Públicos para Cuestionario MT Turismo */

/* Variables CSS para personalización */
:root {
    --cmt-font-family-system: inherit, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --cmt-font-family-modern: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --cmt-font-family-classic: Georgia, "Times New Roman", Times, serif;
    --cmt-font-family-custom: inherit;
}

/* Reset y base */
.cmt-questionnaire-container * {
    box-sizing: border-box;
}

/* Todas las respuestas tienen el mismo estilo unificado */

.cmt-questionnaire-container {
    /*font-family: var(--cmt-font-family-system);*/
    color: #333;
    width: 100%;
    /*padding: 20px;*/
}

/* Mejorar espaciado del contenedor principal */
.cmt-content {
    padding: 25px 30px;
    background: #fff;
    border-radius: 8px;
    margin-top: 20px;
}

/* Grid layout para preguntas */
.cmt-questions-grid {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.cmt-questions-grid.cmt-grid-1 {
    grid-template-columns: 1fr;
}

.cmt-questions-grid.cmt-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.cmt-questions-grid.cmt-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Responsive: En móvil siempre 1 columna */
@media (max-width: 768px) {
    .cmt-questions-grid.cmt-grid-2,
    .cmt-questions-grid.cmt-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* En tablet, máximo 2 columnas */
@media (max-width: 1024px) {
    .cmt-questions-grid.cmt-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Estilos para preguntas en grid */
.cmt-questions-grid .cmt-question {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    height: fit-content;
}

.cmt-questions-grid .cmt-question-title {
    font-size: 1.2em;
    margin-bottom: 12px;
    color: var(--cmt-primary-color, #007cba);
    line-height: 1.3;
}

.cmt-questions-grid .cmt-question-description {
    font-size: 0.9em;
    margin-bottom: 15px;
    color: #666;
    line-height: 1.4;
}

/* Layout tradicional (sin grid) */
.cmt-step:not(.cmt-questions-grid) .cmt-question {
    margin-bottom: 25px;
    /* padding: 20px 0; */
    border-bottom: 1px solid #eee;
}

.cmt-step:not(.cmt-questions-grid) .cmt-question:last-child {
    border-bottom: none;
}

/* Clases para diferentes familias de fuentes */
.cmt-questionnaire-container.cmt-font-system {
    font-family: var(--cmt-font-family-system);
}

.cmt-questionnaire-container.cmt-font-modern {
    font-family: var(--cmt-font-family-modern);
}

.cmt-questionnaire-container.cmt-font-classic {
    font-family: var(--cmt-font-family-classic);
}

.cmt-questionnaire-container.cmt-font-custom {
    font-family: var(--cmt-font-family-custom);
}

/* Loading */
.cmt-loading {
    text-align: center;
    padding: 60px 20px;
}

.cmt-loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: cmt-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes cmt-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cmt-loading p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* Questionnaire */
.cmt-questionnaire {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: visible;
    transition: all 0.3s ease;
}

/* Header */
.cmt-header {
    background: linear-gradient(135deg, #007cba 0%, #00a0d2 100%);
    color: white;
    padding: 30px 30px 20px 30px;
    text-align: center;
}

.cmt-header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
}

.cmt-header p {
    margin: 0 0 25px 0;
    font-size: 16px;
    opacity: 0.9;
}

/* Progress Bar */
.cmt-progress-container {
    padding: 20px 30px 10px;
    background: #f8f9fa;
}

.cmt-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cmt-step-counter {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.cmt-progress-percentage {
    font-weight: 600;
    color: #007cba;
    font-size: 14px;
}

.cmt-progress-bar {
    height: 8px;
    background: #e1e5e9;
    border-radius: 4px;
    overflow: hidden;
}

.cmt-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007cba, #00a0d2);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Content */
.cmt-content {
    padding: 30px;
}

.cmt-step {
    display: none;
}

.cmt-step.active {
    display: block;
    animation: cmt-fade-in 0.3s ease-in;
}

@keyframes cmt-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cmt-step-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.cmt-step-description {
    font-size: 16px;
    color: #666;
    margin: 0 0 30px 0;
    line-height: 1.5;
}

/* User Info Form */
.cmt-user-form {
    display: flex;
    flex-direction: column;
    /* grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); */
    gap: 20px;
    margin-bottom: 30px;
}

.cmt-field-group {
    display: flex;
    flex-direction: column;
}

.cmt-field-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.cmt-field-label.required::after {
    content: " *";
    color: #d63638;
}

.cmt-field-input {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
}

.cmt-field-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.cmt-field-input.error {
    border-color: #d63638;
}

.cmt-field-error {
    color: #d63638;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.cmt-field-error.visible {
    display: block;
}

/* Questions */
.cmt-question {
    margin-bottom: 40px;
    min-height: 280px; /* Altura mínima para consistencia */
    display: flex;
    flex-direction: column;
}

/* Para grilla de preguntas, establecer altura uniforme */
.cmt-questions-grid .cmt-question {
    min-height: 320px; /* Altura mayor para grid layout */
    height: 100%; /* Llenar el contenedor disponible */
}


/* Para preguntas de paso simple, altura consistente */
.cmt-step:not(.cmt-questions-grid) .cmt-question {
    min-height: 280px;
}

.cmt-question-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.4;
    flex-shrink: 0; /* No reducir el tamaño del título */
}

.cmt-question-description {
    font-size: 14px;
    color: #666;
    margin: 0 0 20px 0;
    line-height: 1.5;
    flex-shrink: 0; /* No reducir el tamaño de la descripción */
}

.cmt-answers {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1; /* Permite que las respuestas ocupen el espacio disponible */
}

.cmt-answer-option {
    position: relative;
    display: block;
    padding: 12px 20px;
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.cmt-answer-option:hover {
    background: #e9ecef;
    border-color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.15);
}

.cmt-answer-option.selected {
    background: #007cba;
    border-color: #007cba;
    color: #fff;
}

.cmt-answer-option.selected .cmt-answer-text {
    color: #fff;
}

.cmt-answer-option input[type="radio"],
.cmt-answer-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cmt-answer-text {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
}

.cmt-answer-value {
    font-size: 12px;
    color: #666;
    margin-left: 10px;
    opacity: 0.7;
}

/* Scale Questions */
.cmt-scale-answers {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    flex: 1; /* Permite que las respuestas de escala ocupen el espacio disponible */
}

.cmt-scale-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 80px;
}

.cmt-scale-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #e1e5e9;
    background: #f8f9fa;
    color: #333;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.cmt-scale-button:hover {
    border-color: #007cba;
    background: #e7f3ff;
    transform: scale(1.1);
}

.cmt-scale-button.selected {
    background: #007cba;
    border-color: #007cba;
    color: white;
}

.cmt-scale-label {
    font-size: 12px;
    color: #666;
    text-align: center;
    line-height: 1.2;
}

.cmt-scale-extremes {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

/* Navigation */
.cmt-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    background: #f8f9fa;
    border-top: 1px solid #e1e5e9;
}

.cmt-nav-left,
.cmt-nav-right {
    display: flex;
    gap: 10px;
}

.cmt-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cmt-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.cmt-btn-primary {
    background: #007cba;
    color: white;
}

.cmt-btn-primary:hover:not(:disabled) {
    background: #005177;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.cmt-btn-secondary {
    background: #6c757d;
    color: white;
}

.cmt-btn-secondary:hover:not(:disabled) {
    background: #545b62;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.cmt-btn-outline {
    background: transparent;
    border: 2px solid #007cba;
    color: #007cba;
}

.cmt-btn-outline:hover:not(:disabled) {
    background: #007cba;
    color: white;
}

/* Results */
.cmt-results {
    text-align: center;
    padding: 40px 30px;
}

.cmt-results-header {
    margin-bottom: 30px;
}

.cmt-results-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px 0;
}

.cmt-results-subtitle {
    font-size: 16px;
    color: #666;
    margin: 0;
}

.cmt-score-display {
    background: linear-gradient(135deg, #007cba, #00a0d2);
    color: white;
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
}

.cmt-score-number {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 10px;
}

.cmt-score-text {
    font-size: 18px;
    opacity: 0.9;
}

.cmt-maturity-level {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
}

.cmt-maturity-title {
    font-size: 20px;
    font-weight: 600;
    color: #007cba;
    margin: 0 0 10px 0;
}

.cmt-maturity-description {
    font-size: 16px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.cmt-recommendations {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
    text-align: left;
}

.cmt-recommendations h3 {
    font-size: 18px;
    color: #333;
    margin: 0 0 15px 0;
}

.cmt-recommendations ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cmt-recommendations li {
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
    position: relative;
    padding-left: 25px;
}

.cmt-recommendations li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: #00a32a;
    font-weight: bold;
    font-size: 18px;
}

.cmt-recommendations li:last-child {
    border-bottom: none;
}

.cmt-email-notification {
    background: #e7f3ff;
    border: 1px solid #007cba;
    border-radius: 6px;
    padding: 15px;
    margin: 20px 0;
    font-size: 14px;
    color: #005177;
}

/* Error States */
.cmt-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 20px;
    color: #721c24;
    text-align: center;
    margin: 20px 0;
}

.cmt-validation-summary {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 15px;
    color: #721c24;
    margin: 20px 0;
    display: none;
}

.cmt-validation-summary.visible {
    display: block;
}

.cmt-validation-summary ul {
    margin: 0;
    padding-left: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cmt-questionnaire-container {
        padding: 10px;
    }

    .cmt-questionnaire {
        border-radius: 8px;
    }

    .cmt-header {
        padding: 20px;
    }

    /* Ajustar alturas mínimas en mobile */
    .cmt-question {
        min-height: 240px; /* Altura menor en mobile */
    }

    .cmt-questions-grid .cmt-question {
        min-height: 260px; /* Altura menor para grid en mobile */
    }

    .cmt-step:not(.cmt-questions-grid) .cmt-question {
        min-height: 240px;
    }

    .cmt-header h1 {
        font-size: 24px;
    }

    .cmt-content {
        padding: 20px;
    }

    .cmt-step-title {
        font-size: 20px;
    }

    .cmt-user-form {
        /*grid-template-columns: 1fr; */
        gap: 15px;
    }

    .cmt-navigation {
        padding: 20px;
        flex-direction: column;
        gap: 15px;
    }

    .cmt-nav-left,
    .cmt-nav-right {
        width: 100%;
        justify-content: center;
    }

    .cmt-btn {
        flex: 1;
        justify-content: center;
    }

    .cmt-scale-answers {
        flex-wrap: wrap;
        gap: 15px;
    }

    .cmt-scale-button {
        width: 45px;
        height: 45px;
        font-size: 14px;
    }

    .cmt-score-number {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .cmt-header h1 {
        font-size: 20px;
    }

    .cmt-step-title {
        font-size: 18px;
    }

    .cmt-content {
        padding: 15px;
    }

    .cmt-navigation {
        padding: 15px;
    }

    .cmt-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .cmt-questionnaire,
    .cmt-step,
    .cmt-answer-option,
    .cmt-btn,
    .cmt-scale-button,
    .cmt-progress-fill {
        animation: none;
        transition: none;
    }
}

/* === NUEVOS SISTEMAS DE NAVEGACIÓN Y PROGRESO === */

/* Indicadores de pasos con círculos (Tipo 1) */
.cmt-steps-indicator {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 0;
    padding: 0 20px;
    position: relative;
}

.cmt-steps-indicator::before {
    content: '';
    position: absolute;
    top: 25px;
    left: 50px;
    right: 50px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    z-index: 1;
}

.cmt-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    max-width: 150px;
    position: relative;
    z-index: 2;
}

.cmt-step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    border: 3px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    position: relative;
}

.cmt-step-circle.completed {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.cmt-step-circle.current {
    background: #fff;
    border-color: #fff;
    color: #007cba;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
}

.cmt-step-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.3;
    margin-bottom: 4px;
}

.cmt-step-description {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.2;
}

.cmt-step-item.completed .cmt-step-title {
    color: #28a745;
}

.cmt-step-item.current .cmt-step-title {
    color: #fff;
}

/* Vista horizontal con scroll (Tipo 3) */
.cmt-steps-horizontal {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 15px 20px;
    margin: 0;
    gap: 15px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.5) rgba(255, 255, 255, 0.2);
    justify-content: center;
    align-items: center;
}

.cmt-steps-horizontal::-webkit-scrollbar {
    height: 6px;
}

.cmt-steps-horizontal::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.cmt-steps-horizontal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
}

.cmt-step-card {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
    min-height: 120px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.cmt-step-card.completed {
    border-color: #28a745;
    background: #f8fff9;
}

.cmt-step-card.current {
    border-color: #fff !important;
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
    transform: translateY(-3px);
    color: #007cba !important;
    animation: currentStepPulse 2s ease-in-out infinite;
}

@keyframes currentStepPulse {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(0, 124, 186, 0.7);
    }
    50% {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 0 8px rgba(0, 124, 186, 0);
    }
}

.cmt-step-card-number {
    display: inline-block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    line-height: 30px;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 10px;
}

.cmt-step-card.completed .cmt-step-card-number {
    background: #28a745;
    color: white;
}

.cmt-step-card.current .cmt-step-card-number {
    background: #007cba !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.4);
    transform: scale(1.1);
}

.cmt-step-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.3;
}

.cmt-step-card.current .cmt-step-card-title {
    color: #007cba !important;
    font-weight: 700;
}

.cmt-step-card-description {
    font-size: 12px;
    color: #666;
    line-height: 1.2;
}

/* Navegación por URL - Pasos clickeables */
.cmt-step-card.cmt-step-clickable {
    cursor: pointer;
    position: relative;
}

.cmt-step-card.cmt-step-clickable:not(.current):hover {
    border-color: var(--cmt-primary-color);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.cmt-step-card.cmt-step-clickable:not(.current):hover .cmt-step-card-number {
    background: var(--cmt-primary-color);
    color: white;
    transform: scale(1.05);
}

/* Indicador visual para pasos accesibles */
.cmt-step-card.cmt-step-clickable:not(.current):not(.completed):after {
    content: "👆";
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--cmt-primary-color);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cmt-step-card.cmt-step-clickable:not(.current):not(.completed):hover:after {
    opacity: 1;
}

/* Transición suave para números de paso */
.cmt-step-card-number {
    transition: all 0.3s ease;
}

/* Responsive para indicadores de pasos */
@media (max-width: 768px) {
    .cmt-steps-indicator {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .cmt-steps-indicator::before {
        display: none;
    }

    .cmt-step-item {
        max-width: 120px;
    }

    .cmt-step-circle {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .cmt-step-title {
        font-size: 12px;
    }

    .cmt-step-description {
        font-size: 10px;
    }

    .cmt-steps-horizontal {
        padding: 10px 15px;
        gap: 10px;
    }

    .cmt-step-card {
        width: 160px;
        min-width: 160px;
        max-width: 160px;
        min-height: 110px;
        padding: 12px;
    }

    .cmt-step-card.current {
        transform: translateY(-2px); /* Menos movimiento en mobile */
    }

    @keyframes currentStepPulse {
        0%, 100% {
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(0, 124, 186, 0.7);
        }
        50% {
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 0 6px rgba(0, 124, 186, 0);
        }
    }
}

/* Estados de error para preguntas */
.cmt-question-error {
    border: 2px solid #dc3545 !important;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    background-color: rgba(220, 53, 69, 0.05);
    animation: cmt-error-pulse 0.5s ease-in-out;
}

.cmt-question-error .cmt-question-title {
    color: #dc3545;
}

@keyframes cmt-error-pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0.1); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* Estados de error para campos de usuario */
.cmt-field-group.cmt-field-error {
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    background-color: rgba(220, 53, 69, 0.05);
    animation: cmt-error-pulse 0.5s ease-in-out;
}

.cmt-field-group.cmt-field-error .cmt-field-label {
    color: #dc3545;
}

.cmt-field-input.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

/* Política de privacidad */
.cmt-privacy-policy {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.cmt-privacy-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
}

.cmt-privacy-label input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
    margin-top: 2px;
}

.cmt-privacy-link {
    color: #007cba;
    text-decoration: underline;
    font-weight: 500;
}

.cmt-privacy-link:hover {
    color: #005a87;
}

.cmt-privacy-policy .cmt-field-error {
    margin-top: 8px;
    margin-left: 24px;
}

/* Layout de filas para campos de usuario */
.cmt-questionnaire-container .cmt-user-form .cmt-field-row {
    display: flex !important;
    gap: 20px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.cmt-questionnaire-container .cmt-user-form .cmt-field-half {
    flex: 1;
    width: calc(50% - 10px);
    min-width: 0;
}

.cmt-questionnaire-container .cmt-user-form .cmt-field-full {
    width: 100%;
    flex: none;
}

/* Asegurar que los field-group dentro de las filas se comporten correctamente */
.cmt-questionnaire-container .cmt-user-form .cmt-field-row .cmt-field-group {
    margin-bottom: 0 !important;
    box-sizing: border-box;
}

.cmt-questionnaire-container .cmt-user-form .cmt-field-row .cmt-field-input {
    width: 100% !important;
    box-sizing: border-box;
}

/* Responsive para campos de usuario */
@media (max-width: 768px) {
    .cmt-questionnaire-container .cmt-user-form .cmt-field-row {
        flex-direction: column !important;
        gap: 15px;
    }

    .cmt-questionnaire-container .cmt-user-form .cmt-field-half {
        width: 100% !important;
    }
}

/* Focus states for accessibility */
.cmt-answer-option:focus,
.cmt-scale-button:focus,
.cmt-btn:focus,
.cmt-field-input:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cmt-questionnaire {
        border: 2px solid #000;
    }

    .cmt-answer-option {
        border-color: #000;
    }

    .cmt-answer-option:hover,
    .cmt-answer-option.selected {
        background: #000;
        color: #fff;
    }
}

/* Print styles */
@media print {
    .cmt-navigation,
    .cmt-loading {
        display: none;
    }

    .cmt-questionnaire {
        box-shadow: none;
        border: 1px solid #000;
    }

    .cmt-step {
        display: block !important;
        page-break-inside: avoid;
    }
}

/* ===== PAGINACIÓN ===== */
.cmt-pagination-info {
    background: #f1f3f4;
    padding: 15px 20px;
    border-radius: 6px;
    margin: 20px 0;
    text-align: center;
    font-size: 14px;
    color: #5f6368;
    border: 1px solid #e8eaed;
}

.cmt-pagination-info .cmt-page-number {
    font-weight: 600;
    color: #1a73e8;
}

.cmt-pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 25px 0;
    padding: 0 20px;
}

.cmt-pagination-controls .cmt-btn {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 6px;
    min-width: 120px;
}

.cmt-prev-page-btn {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #dadce0;
}

.cmt-prev-page-btn:hover:not(:disabled) {
    background: #e8f0fe;
    border-color: #1a73e8;
    color: #1a73e8;
}

.cmt-next-page-btn {
    background: #1a73e8;
    color: white;
    border: 1px solid #1a73e8;
}

.cmt-next-page-btn:hover:not(:disabled) {
    background: #1557b0;
    border-color: #1557b0;
}

.cmt-prev-page-btn:disabled,
.cmt-next-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f1f3f4;
    color: #9aa0a6;
    border-color: #dadce0;
}

.cmt-page-indicator {
    font-size: 14px;
    color: #5f6368;
    font-weight: 500;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 4px;
    min-width: 80px;
    text-align: center;
}

/* === ESTILOS PARA INSIGNIAS Y RESULTADOS MEJORADOS === */

/* Contenedor de mensaje de agradecimiento */
.cmt-thank-you-message {
    font-size: 18px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Contenedor de puntuación mejorado */
.cmt-score-display {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 30px 0;
}

/* Insignia */
.cmt-badge {
    font-size: 64px;
    margin-bottom: 15px;
    text-shadow: 0 3px 6px rgba(0,0,0,0.3);
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.2));
    background: none !important;
}

/* Círculo de puntuación con colores por insignia */
.cmt-score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    position: relative;
}

.cmt-score-circle::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    opacity: 0.3;
    z-index: -1;
}

/* Insignia Oro - Círculo dorado */
.cmt-score-circle.cmt-badge-gold {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: 4px solid #FFD700;
}

.cmt-score-circle.cmt-badge-gold::before {
    background: linear-gradient(135deg, #FFD700, #FFA500);
}

/* Insignia Plata - Círculo plateado */
.cmt-score-circle.cmt-badge-silver {
    background: linear-gradient(135deg, #C0C0C0, #A9A9A9);
    border: 4px solid #C0C0C0;
}

.cmt-score-circle.cmt-badge-silver::before {
    background: linear-gradient(135deg, #C0C0C0, #A9A9A9);
}

/* Insignia Bronce - Círculo bronce */
.cmt-score-circle.cmt-badge-bronze {
    background: linear-gradient(135deg, #CD7F32, #A0522D);
    border: 4px solid #CD7F32;
}

.cmt-score-circle.cmt-badge-bronze::before {
    background: linear-gradient(135deg, #CD7F32, #A0522D);
}

/* Sin insignia - Círculo gris */
.cmt-score-circle.cmt-badge-none {
    background: linear-gradient(135deg, #6c757d, #495057);
    border: 4px solid #6c757d;
}

.cmt-score-circle.cmt-badge-none::before {
    background: linear-gradient(135deg, #6c757d, #495057);
}

/* Número de puntuación */
.cmt-score-number {
    font-size: 34px;
    font-weight: 900;
    color: white !important;
    text-shadow: 0 3px 6px rgba(0,0,0,0.4);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Texto de puntuación */
.cmt-score-text {
    font-size:22px;
    color: #ffffff;
    margin-top: 10px;
    text-align: center;
    font-weight: 600;
}

/* Animaciones para las insignias */
.cmt-badge {
    animation: badgeAppear 0.8s ease-out;
}

.cmt-score-circle {
    animation: circleGrow 0.6s ease-out 0.2s both;
}

@keyframes badgeAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) rotateY(180deg);
    }
    50% {
        transform: scale(1.1) rotateY(0deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

@keyframes circleGrow {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive para dispositivos móviles */
@media (max-width: 768px) {
    .cmt-badge {
        font-size: 48px;
    }

    .cmt-score-circle {
        width: 120px;
        height: 120px;
    }

    .cmt-score-number {
        font-size: 32px;
        font-weight: 900;
    }

    .cmt-thank-you-message {
        font-size: 16px;
        padding: 15px;
    }
}

/* === Popover para descripciones de preguntas === */
.cmt-question-title {
    position: relative;
    display: inline-block;
}

.cmt-question-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    cursor: pointer;
    position: relative;
    color: #6c757d;
    transition: color 0.2s ease;
    margin-left: 4px;
    vertical-align: top;
}

.cmt-question-info-icon:hover {
    color: var(--cmt-primary-color, #007cba);
}

.cmt-question-info-icon svg {
    width: 14px;
    height: 14px;
}

.cmt-question-popover {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    min-width: 220px;
    max-width: 300px;
    white-space: normal;
}

/* Posicionamiento inteligente del popover */
.cmt-question-popover.position-left {
    left: 0;
    transform: translateX(0);
}

.cmt-question-popover.position-right {
    left: auto;
    right: 0;
    transform: translateX(0);
}

.cmt-question-popover.position-above {
    top: auto;
    bottom: calc(100% + 6px);
}

.cmt-question-popover.active {
    opacity: 1;
    visibility: visible;
}

/* El hover ahora se maneja completamente con JavaScript para posicionamiento inteligente */

/* Flecha del popover */
.cmt-question-popover::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-right: none;
    border-bottom: none;
    z-index: 1;
}

/* Flechas para diferentes posiciones */
.cmt-question-popover.position-left::before {
    left: 20px;
    transform: translateX(0) rotate(45deg);
}

.cmt-question-popover.position-right::before {
    left: auto;
    right: 20px;
    transform: translateX(0) rotate(45deg);
}

.cmt-question-popover.position-above::before {
    top: auto;
    bottom: -5px;
    transform: translateX(-50%) rotate(225deg);
}

.cmt-question-popover-content {
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.4;
    color: #333;
    position: relative;
    z-index: 2;
    background: #fff;
    border-radius: 8px;
}

/* Ajuste responsivo para dispositivos touch */
@media (hover: none) and (pointer: coarse) {
    .cmt-question-popover {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-width: 90%;
        width: 90%;
    }

    .cmt-question-popover::before {
        display: none;
    }

    .cmt-question-popover.active {
        box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
    }
}

/* Estilos para resultados detallados */
.cmt-detailed-results {
    padding: 20px;
}

.cmt-results-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e5e9;
}

.cmt-results-header h2 {
    margin: 0;
    color: var(--cmt-primary-color, #007cba);
}

.cmt-btn-back {
    background: #f1f1f1 !important;
    color: #333 !important;
    border: 1px solid #ccc !important;
    text-decoration: none;
}

.cmt-btn-back:hover {
    background: #e0e0e0 !important;
}

.cmt-results-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.cmt-results-summary h3 {
    margin-top: 0;
    color: #333;
}

.cmt-answers-detail h3 {
    color: #333;
    margin-bottom: 20px;
}

.cmt-detailed-answer {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.cmt-detailed-answer .cmt-question-title {
    margin-bottom: 8px;
    color: var(--cmt-primary-color, #007cba);
}

.cmt-answer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cmt-answer-text {
    color: #333;
}

.cmt-answer-value {
    color: #666;
    font-size: 0.9em;
}

.cmt-result-actions {
    margin-top: 25px;
    text-align: center;
}

.cmt-btn-secondary {
    background: var(--cmt-secondary-color, #f1f1f1) !important;
    color: #333 !important;
    border: 1px solid #ccc !important;
}

.cmt-btn-secondary:hover {
    background: #e0e0e0 !important;
    border-color: #999 !important;
}

@media (max-width: 768px) {
    .cmt-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .cmt-answer-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}
