/* ==========================================================================
   Estilos de Diseño - Autodiagnóstico LOPDP
   ========================================================================== */

/* Variables de Diseño */
:root {
    --primary: #054a91;         /* Azul Cobalto Profundo - Corporativo */
    --secondary: #3e7cb1;       /* Azul Medio - Acciones secundarias */
    --accent: #81a4cd;          /* Azul Suave - Bordes y elementos informativos */
    --neutral-light: #dbe4ee;   /* Azul Grisáceo Claro - Contenedores y bordes */
    --cta: #f17300;             /* Naranja Vibrante - Botón de Envío, Llamada a la Acción */
    
    --bg-body: #f5f8fc;
    --bg-card: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --box-shadow-hover: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reseteo y Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Contenedores y Estructura */
.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px;
}

.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Header & Footer */
header {
    background-color: var(--primary);
    color: white;
    padding: 20px 0;
    box-shadow: var(--box-shadow);
}

header .header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

/* Estilos del Logotipo Institucional y Badge */
.header-logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.header-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: var(--transition);
}

.header-logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.06);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.header-logo-link:hover .header-logo-container {
    background-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.logo-isotype {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.logo-divider {
    width: 1px;
    height: 18px;
    background-color: rgba(255, 255, 255, 0.2);
}

.logo-logotype {
    height: 18px;
    width: auto;
    object-fit: contain;
}

.app-header-badge {
    background-color: var(--cta);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(241, 115, 0, 0.2);
}

/* Responsividad para móviles pequeños */
@media (max-width: 480px) {
    .header-logo-container {
        padding: 5px 8px;
        gap: 6px;
    }
    .logo-isotype {
        height: 26px;
    }
    .logo-divider {
        height: 14px;
    }
    .logo-logotype {
        height: 14px;
    }
    .app-header-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
}

footer {
    background-color: #0f172a;
    color: #94a3b8;
    padding: 30px 0;
    font-size: 0.9rem;
    margin-top: auto;
}

footer a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

footer a:hover {
    color: white;
    text-decoration: underline;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    gap: 8px;
}

.btn-primary {
    background-color: var(--cta);
    color: white;
}

.btn-primary:hover {
    background-color: #d16200;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(241, 115, 0, 0.3);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: #2b5d88;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(62, 124, 177, 0.3);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--accent);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--neutral-light);
    color: var(--primary);
}

.btn:disabled {
    background-color: var(--text-muted);
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Tarjetas y Contenedores */
.card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--neutral-light);
    padding: 32px;
    box-shadow: var(--box-shadow);
    width: 100%;
    margin-bottom: 24px;
}

.card:hover {
    box-shadow: var(--box-shadow-hover);
}

.card-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
    border-bottom: 2px solid var(--neutral-light);
    padding-bottom: 10px;
}

/* Alertas */
.alert {
    padding: 16px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border-left: 4px solid transparent;
}

.alert-info {
    background-color: #eff6ff;
    border-color: var(--secondary);
    color: #1e40af;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: var(--warning);
    color: #92400e;
}

.alert-danger {
    background-color: #fef2f2;
    border-color: var(--danger);
    color: #991b1b;
}

/* Formularios */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary);
}

.form-control {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid var(--neutral-light);
    border-radius: var(--border-radius);
    background-color: white;
    color: var(--text-color);
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(62, 124, 177, 0.15);
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 15px;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    margin-top: 5px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Honeypot anti-spam */
.website-field {
    display: none !important;
    visibility: hidden !important;
}

/* Cuestionario (Stepper y Preguntas) */
.category-progress-container {
    margin-bottom: 30px;
}

.category-badge {
    display: inline-block;
    padding: 6px 12px;
    background-color: var(--neutral-light);
    color: var(--primary);
    font-weight: 700;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.progress-bar-outer {
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-inner {
    height: 100%;
    background-color: var(--secondary);
    transition: width 0.4s ease;
}

.question-block {
    margin-bottom: 32px;
    border-bottom: 1px dashed var(--neutral-light);
    padding-bottom: 24px;
}

.question-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.question-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
}

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

.option-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border: 2px solid var(--neutral-light);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    background-color: white;
}

.option-item:hover {
    border-color: var(--secondary);
    background-color: #f8fafc;
}

.option-item.selected {
    border-color: var(--primary);
    background-color: #eff6ff;
    box-shadow: 0 0 0 1px var(--primary);
}

.option-item input[type="radio"] {
    margin-right: 14px;
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.option-text-label {
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
}

.questionnaire-step {
    display: none;
}

.questionnaire-step.active {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

/* Dashboard de Resultados */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

.score-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, var(--primary) 0%, #032b57 100%);
    color: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 8px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--cta);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background-color: rgba(255, 255, 255, 0.05);
}

.score-num {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--cta);
}

.score-max {
    font-size: 0.9rem;
    opacity: 0.7;
}

.badge-risk {
    display: inline-block;
    padding: 6px 16px;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-top: 10px;
}

.badge-risk-crítico { background-color: var(--danger); color: white; }
.badge-risk-alto { background-color: var(--warning); color: black; }
.badge-risk-medio { background-color: #3b82f6; color: white; }
.badge-risk-bajo { background-color: #10b981; color: white; }
.badge-risk-muybajo { background-color: #059669; color: white; }

.badge-maturity {
    display: inline-block;
    padding: 6px 16px;
    font-weight: 700;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-top: 5px;
    background-color: var(--neutral-light);
    color: var(--primary);
}

/* Detalles por categoría en resultados */
.category-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.category-bar-item {
    margin-bottom: 8px;
}

.category-bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.category-bar-outer {
    height: 12px;
    background-color: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.category-bar-inner {
    height: 100%;
    background-color: var(--secondary);
    border-radius: 6px;
    transition: width 1s ease-in-out;
}

.category-bar-inner.risk-crítico { background-color: var(--danger); }
.category-bar-inner.risk-alto { background-color: var(--warning); }
.category-bar-inner.risk-medio { background-color: #3b82f6; }
.category-bar-inner.risk-bajo { background-color: #10b981; }

/* Recomendaciones en resultado */
.recommendation-card {
    border-left: 5px solid var(--primary);
    background-color: #f8fafc;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 16px;
}

.recommendation-card.priority-high {
    border-left-color: var(--danger);
    background-color: #fff5f5;
}

.recommendation-card.priority-medium {
    border-left-color: var(--warning);
    background-color: #fffbeb;
}

.recommendation-header {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 1.05rem;
}

.recommendation-badge-priority {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
}

.priority-high .recommendation-badge-priority {
    background-color: #fee2e2;
    color: var(--danger);
}

.priority-medium .recommendation-badge-priority {
    background-color: #fef3c7;
    color: #d97706;
}

.recommendation-state {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 8px;
    padding-left: 10px;
    border-left: 2px solid var(--neutral-light);
}

.recommendation-action {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
}

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

/* Modales para políticas */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Ajustes de impresión */
@media print {
    body {
        background-color: white;
        color: black;
    }
    
    header, footer, .btn, .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        page-break-inside: avoid;
        padding: 15px !important;
        margin-bottom: 15px !important;
    }
    
    .score-panel {
        background: none !important;
        color: black !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
    
    .score-num {
        color: black !important;
    }
    
    .score-circle {
        border-color: black !important;
    }
    
    .badge-risk, .badge-maturity {
        border: 1px solid black !important;
        color: black !important;
        background-color: transparent !important;
    }
    
    .recommendation-card {
        border-left: 3px solid black !important;
        background-color: white !important;
        page-break-inside: avoid;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}
