/* NIS2 Assessment Plugin Styles
 * Version: 1.2.0
 * Author: Tu Equipo
 */

/* ===========================
   Formulario Principal
   =========================== */
.nis2-form {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.nis2-form fieldset {
    border: 1px solid #e5e7eb;
    padding: 20px;
    margin: 20px 0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.nis2-form fieldset:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.nis2-form legend {
    font-weight: 700;
    padding: 0 10px;
    color: #1f2937;
    font-size: 1.2em;
    background: white;
}

.nis2-form label {
    display: block;
    margin: 12px 0;
    color: #374151;
    font-weight: 500;
}

.nis2-form input[type="text"],
.nis2-form input[type="email"],
.nis2-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #ffffff;
}

.nis2-form input[type="text"]:focus,
.nis2-form input[type="email"]:focus,
.nis2-form textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #fafbff;
}

.nis2-form textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.nis2-form .hint {
    color: #6b7280;
    font-size: 0.9em;
    margin-bottom: 15px;
    font-style: italic;
    display: block;
}

/* ===========================
   Preguntas y Escala
   =========================== */
.nis2-form .question {
    margin: 25px 0;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.nis2-form .question label:first-child {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 15px;
}

.nis2-form .scale {
    display: flex;
    gap: 12px;
    margin: 12px 0;
    flex-wrap: wrap;
    justify-content: space-between;
}

.nis2-form .scale label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 45px;
    max-width: 60px;
}

.nis2-form .scale label:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.2);
}

.nis2-form .scale input[type="radio"] {
    accent-color: #667eea;
    width: 18px;
    height: 18px;
}

.nis2-form .scale input[type="radio"]:checked + span {
    font-weight: bold;
    color: #667eea;
}

.nis2-form .scale label:has(input:checked) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.nis2-form .scale label:has(input:checked) span {
    color: white;
}

.nis2-form small {
    display: block;
    margin-top: 8px;
    color: #9ca3af;
    font-size: 0.85em;
    text-align: center;
}

/* ===========================
   Botón de Envío
   =========================== */
.nis2-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 32px;
    border-radius: 10px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 30px auto;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nis2-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.nis2-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.nis2-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===========================
   Pantalla de Resultados
   =========================== */
.nis2-summary {
    border: 2px solid #e5e7eb;
    padding: 40px;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.nis2-summary h2 {
    color: #1f2937;
    margin-bottom: 20px;
    font-size: 2.2em;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nis2-summary > p {
    text-align: center;
    font-size: 1.2em;
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.nis2-summary h3 {
    color: #374151;
    margin: 35px 0 20px 0;
    font-size: 1.5em;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
}

.nis2-summary .areas {
    list-style: none;
    padding: 0;
    margin: 25px 0;
    display: grid;
    gap: 15px;
}

.nis2-summary .areas li {
    padding: 20px;
    background: white;
    border-left: 4px solid #667eea;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.nis2-summary .areas li:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.nis2-summary .areas strong {
    color: #1f2937;
    display: block;
    margin-bottom: 8px;
    font-size: 1.1em;
}

/* ===========================
   Botón de Descarga
   =========================== */
.nis2-download {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 16px 36px;
    border-radius: 10px;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 25px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 15px;
}

.nis2-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    color: white;
    text-decoration: none;
}

.nis2-download:active {
    transform: translateY(0);
}

.nis2-download:before {
    content: "⬇ ";
    font-size: 18px;
    margin-right: 8px;
}

/* ===========================
   Estados de Carga
   =========================== */
.nis2-form.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.nis2-form.loading::after {
    content: "Generando informe...";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 50px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3); }
    50% { box-shadow: 0 10px 50px rgba(102, 126, 234, 0.5); }
    100% { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3); }
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
    .nis2-form fieldset {
        padding: 15px;
        margin: 15px 0;
    }
    
    .nis2-form .scale {
        flex-direction: column;
        gap: 8px;
    }
    
    .nis2-form .scale label {
        max-width: 100%;
        justify-content: flex-start;
    }
    
    .nis2-summary {
        padding: 25px;
    }
    
    .nis2-summary h2 {
        font-size: 1.8em;
    }
    
    .nis2-submit,
    .nis2-download {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .nis2-form {
        padding: 0 10px;
    }
    
    .nis2-form legend {
        font-size: 1.1em;
    }
    
    .nis2-summary {
        padding: 20px;
    }
    
    .nis2-summary .areas li {
        padding: 15px;
    }
}

/* ===========================
   Animaciones y Transiciones
   =========================== */
.nis2-form fieldset,
.nis2-form .question,
.nis2-summary .areas li {
    animation: fadeInUp 0.5s ease-out;
}

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

/* ===========================
   Print Styles
   =========================== */
@media print {
    .nis2-submit,
    .nis2-download {
        display: none;
    }
    
    .nis2-form fieldset,
    .nis2-summary {
        box-shadow: none;
        border: 1px solid #000;
    }
}