/* ============================================
   ENCUESTA VDI - Centro Universitario
   Diseño fresco, amigable y 100% responsivo
   ============================================ */

:root {
    --primary: #0f4c75;
    --primary-light: #3282b8;
    --secondary: #00b894;
    --accent: #ff7675;
    --bg: #f0f4f8;
    --card-bg: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    --border: #dfe6e9;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all 0.25s ease;
    --max-width: 720px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #e0f7fa 0%, #f0f4f8 50%, #e8f5e9 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 100px;
}

/* Barra de progreso sticky */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 12px 16px;
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--primary-light));
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 3px;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: center;
    font-weight: 600;
}

/* Header */
.header {
    text-align: center;
    padding: 100px 20px 40px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.header h1 {
    font-size: 1.6rem;
    color: var(--primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.header .subtitle {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 4px;
}

.header .badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--secondary), var(--primary-light));
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 12px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 100px 20px 40px;
    max-width: var(--max-width);
    margin: 0 auto;
}

/* Contenedor principal */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
}

/* Secciones */
.section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: none;
    animation: fadeIn 0.5s ease;
}

.section.active {
    display: block;
}

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

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

.section-title {
    font-size: 1.15rem;
    color: var(--primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title .icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.section-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 20px;
    padding-left: 42px;
}

/* Preguntas */
.question {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border);
}

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

.question-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
    line-height: 1.4;
}

.question-text .qnum {
    display: inline-block;
    background: var(--primary);
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    text-align: center;
    line-height: 26px;
    font-size: 0.8rem;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Opciones tipo radio / checkbox */
.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option {
    position: relative;
}

.option input[type="radio"],
.option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option label {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
    gap: 12px;
}

.option label:hover {
    border-color: var(--primary-light);
    background: #e3f2fd;
    transform: translateX(4px);
}

.option input:checked + label {
    border-color: var(--primary);
    background: linear-gradient(135deg, #e3f2fd, #e8f5e9);
    box-shadow: 0 2px 8px rgba(15, 76, 117, 0.15);
}

.option input:checked + label .check-circle {
    background: var(--primary);
    border-color: var(--primary);
}

.option input:checked + label .check-circle::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    margin: auto;
}

.check-circle {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

/* Opciones Likert en fila (desktop) */
.likert-options {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.likert-options .option label {
    flex-direction: column;
    text-align: center;
    padding: 12px 4px;
    font-size: 0.85rem;
    gap: 6px;
}

.likert-options .option label .num {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-light);
}

.likert-options .option input:checked + label .num {
    color: var(--primary);
}

/* Opciones comparativas */
.comparative-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.comparative-options .option label {
    padding: 12px 14px;
}

/* Textarea */
textarea {
    width: 100%;
    min-height: 100px;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: var(--transition);
    background: var(--bg);
}

textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    background: white;
    box-shadow: 0 0 0 4px rgba(50, 130, 184, 0.1);
}

/* Input texto */
input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg);
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-light);
    background: white;
    box-shadow: 0 0 0 4px rgba(50, 130, 184, 0.1);
}

/* Consentimiento */
.consent-box {
    background: linear-gradient(135deg, #fff3e0, #fce4ec);
    border: 2px solid #ffcc80;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 20px;
}

.consent-box label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9rem;
    cursor: pointer;
}

.consent-box input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}

/* Navegación */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    max-width: var(--max-width);
    margin: 24px auto 40px;
    padding: 0 16px;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

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

.btn-prev {
    background: var(--bg);
    color: var(--text-light);
    border: 2px solid var(--border);
}

.btn-prev:hover:not(:disabled) {
    background: var(--border);
    color: var(--text);
}

.btn-next, .btn-submit {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 15px rgba(15, 76, 117, 0.3);
}

.btn-next:hover:not(:disabled), .btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 76, 117, 0.4);
}

.btn-submit {
    background: linear-gradient(135deg, var(--secondary), #00cec9);
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
}

/* Mensajes */
.message {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    box-shadow: var(--shadow-hover);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    max-width: 90%;
    text-align: center;
}

.message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.message.error {
    background: #ffebee;
    color: #c62828;
    border: 2px solid #ef9a9a;
}

.message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 2px solid #a5d6a7;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    z-index: 3000;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Desktop */
@media (min-width: 768px) {
    :root {
        --max-width: 800px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .section {
        padding: 32px;
    }

    .likert-options {
        gap: 12px;
    }

    .likert-options .option label {
        padding: 16px 8px;
    }

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

    .nav-buttons {
        padding: 0;
    }

    .btn {
        flex: 0 1 auto;
        min-width: 160px;
    }
}

/* Mejoras táctiles */
@media (hover: none) {
    .option label:hover {
        transform: none;
    }

    .btn:hover:not(:disabled) {
        transform: none;
    }
}

/* Reducir movimiento */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
