/**
 * Estilos para Calculadora de Riesgo
 * Diseño progresivo y móvil-first
 */

.calc-riesgo-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.calc-riesgo-header {
    text-align: center;
    margin-bottom: 30px;
}

.calc-riesgo-header h2 {
    font-size: 28px;
    color: #1f2937;
    margin-bottom: 10px;
    font-weight: 700;
}

.calc-riesgo-header p {
    font-size: 16px;
    color: #6b7280;
    line-height: 1.6;
}

/* Progreso */
.calc-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    gap: 8px;
}

.calc-progress-step {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.calc-progress-step.active {
    background: #3b82f6;
}

.calc-progress-step.completed {
    background: #10b981;
}

/* Preguntas */
.calc-question {
    display: none;
    animation: fadeIn 0.3s ease;
}

.calc-question.active {
    display: block;
}

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

.calc-question-number {
    display: inline-block;
    background: #eff6ff;
    color: #3b82f6;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.calc-question h3 {
    font-size: 22px;
    color: #1f2937;
    margin-bottom: 20px;
    font-weight: 600;
    line-height: 1.4;
}

.calc-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.calc-option {
    position: relative;
}

.calc-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.calc-option label {
    display: block;
    padding: 18px 20px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    color: #374151;
    font-weight: 500;
}

.calc-option label:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.calc-option input[type="radio"]:checked + label {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

/* Navegación */
.calc-navigation {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.calc-btn {
    flex: 1;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calc-btn-primary {
    background: #3b82f6;
    color: white;
}

.calc-btn-primary:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.calc-btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
}

.calc-btn-secondary:hover {
    background: #e5e7eb;
}

.calc-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Pantalla de resultados */
.calc-results {
    display: none;
    text-align: center;
}

.calc-results.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.calc-risk-indicator {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 8px solid;
    position: relative;
}

.calc-risk-score {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
}

.calc-risk-max {
    font-size: 18px;
    color: #6b7280;
    margin-top: 5px;
}

.calc-risk-level {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
}

.calc-risk-message {
    font-size: 16px;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 30px;
}

.calc-recommendations {
    background: #f9fafb;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: left;
}

.calc-recommendations h4 {
    font-size: 18px;
    color: #1f2937;
    margin-bottom: 15px;
    font-weight: 600;
}

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

.calc-recommendations li {
    padding: 10px 0 10px 30px;
    position: relative;
    color: #4b5563;
    line-height: 1.5;
}

.calc-recommendations li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: 700;
    font-size: 18px;
}

/* Formulario de captura */
.calc-lead-form {
    background: #f9fafb;
    padding: 25px;
    border-radius: 12px;
    margin-top: 30px;
}

.calc-lead-form h4 {
    font-size: 20px;
    color: #1f2937;
    margin-bottom: 15px;
    font-weight: 600;
}

.calc-lead-form p {
    color: #6b7280;
    margin-bottom: 20px;
    font-size: 14px;
}

.calc-form-group {
    margin-bottom: 15px;
}

.calc-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.calc-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.calc-form-group input:focus {
    outline: none;
    border-color: #3b82f6;
}

.calc-submit-btn {
    width: 100%;
    padding: 16px;
    background: #10b981;
    color: white;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.calc-submit-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.calc-success-message {
    display: none;
    text-align: center;
    padding: 30px;
}

.calc-success-message.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.calc-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: #d1fae5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

/* Loading spinner */
.calc-loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.calc-loading.active {
    display: block;
}

.calc-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 640px) {
    .calc-riesgo-container {
        padding: 20px;
        margin: 20px;
    }
    
    .calc-riesgo-header h2 {
        font-size: 24px;
    }
    
    .calc-question h3 {
        font-size: 20px;
    }
    
    .calc-option label {
        padding: 16px;
        font-size: 15px;
    }
    
    .calc-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* Botón WhatsApp */
.calc-whatsapp-btn {
    width: 100%;
    padding: 16px;
    background: #25D366;
    color: white;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calc-whatsapp-btn:hover {
    background: #20BA5A;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

@media (max-width: 640px) {
    .calc-lead-form div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* Modal overlay */
.calc-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.calc-modal-overlay.active {
    display: flex;
}

/* Modal card */
.calc-modal {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

/* Botón cerrar */
.calc-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.calc-modal-close:hover {
    background: #e5e7eb;
    color: #1f2937;
    transform: rotate(90deg);
}

/* Contenido del modal */
.calc-modal-content {
    padding: 40px 30px 30px;
}

.calc-modal-content h3 {
    font-size: 24px;
    color: #1f2937;
    margin-bottom: 10px;
    font-weight: 700;
}

.calc-modal-content > p {
    color: #6b7280;
    margin-bottom: 25px;
    font-size: 15px;
    line-height: 1.5;
}

/* Botón de submit del modal */
.calc-submit-btn-modal {
    width: 100%;
    padding: 16px;
    background: #10b981;
    color: white;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.calc-submit-btn-modal:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.calc-submit-btn-modal:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Botón para abrir modal */
.calc-open-modal-btn {
    background: #10b981;
}

.calc-open-modal-btn:hover {
    background: #059669;
}

/* Responsive para modal */
@media (max-width: 640px) {
    .calc-modal {
        max-width: 100%;
        margin: 0;
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
    }
    
    .calc-modal-content {
        padding: 35px 20px 20px;
    }
    
    .calc-modal-content h3 {
        font-size: 20px;
    }
    
    .calc-results div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* Prevenir scroll del body cuando modal está abierto */
body.calc-modal-open {
    overflow: hidden;
}
