/* ============================================
   PRECOM - ENCUESTA DE SATISFACCIÓN
   DISEÑO 100% RESPONSIVE (Móvil, Tablet, PC)
   Colores: Azul & Blanco
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Poppins', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #e8f0fe 0%, #d4e4fc 100%);
    min-height: 100vh;
    padding: 15px;
}

/* CONTENEDOR PRINCIPAL */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== HEADER SGC ========== */
.header-sgc {
    background: linear-gradient(135deg, #0a2540 0%, #1a4a7a 100%);
    padding: 20px 25px;
    color: white;
    border-bottom: 4px solid #00a8e8;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.logo {
    width: 65px;
    height: 65px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.titulo-empresa h1 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.titulo-empresa p {
    font-size: 12px;
    opacity: 0.85;
}

.info-codigos {
    display: flex;
    gap: 15px;
    font-size: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.2);
    flex-wrap: wrap;
}

.info-codigos span {
    background: rgba(255,255,255,0.1);
    padding: 4px 10px;
    border-radius: 20px;
}

/* ========== FORMULARIO INICIAL ========== */
.form-encuesta {
    padding: 25px;
    background: white;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #0a2540;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f8fafc;
    -webkit-appearance: none;
}

.form-group input:focus {
    border-color: #1a4a7a;
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(26, 74, 122, 0.1);
}

/* INSTRUCCIONES */
.instrucciones {
    background: #f0f7ff;
    padding: 18px;
    border-radius: 14px;
    margin-bottom: 25px;
    border-left: 4px solid #1a4a7a;
}

.instrucciones h3 {
    color: #0a2540;
    margin-bottom: 8px;
    font-size: 16px;
}

.instrucciones p {
    color: #334155;
    line-height: 1.5;
    font-size: 13px;
}

.escala {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.escala-item {
    background: white;
    padding: 4px 10px;
    border-radius: 25px;
    font-size: 11px;
    font-weight: 500;
    color: #1a4a7a;
    border: 1px solid #cbd5e1;
}

/* BOTONES */
.btn-iniciar, .btn-primary, .btn-enviar {
    background: linear-gradient(135deg, #0a2540 0%, #1a4a7a 100%);
    color: white;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-iniciar:hover, .btn-primary:hover, .btn-enviar:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(10, 37, 64, 0.3);
}

/* ========== PREGUNTAS - CARITAS (RESPONSIVE) ========== */
.progress-bar {
    background: #0a2540;
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
}

.progress-fill {
    height: 3px;
    background: #00a8e8;
    border-radius: 2px;
    margin-top: 8px;
    transition: width 0.4s ease;
}

.question-container {
    padding: 25px 20px;
    text-align: center;
    background: white;
}

.question-container h2 {
    color: #0a2540;
    margin-bottom: 30px;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
}

/* GRID DE CARITAS - RESPONSIVE */
.emojis-grid {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.emoji-card {
    text-align: center;
    cursor: pointer;
    padding: 12px 10px;
    background: white;
    border-radius: 18px;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    border: 2px solid #e2e8f0;
    min-width: 85px;
    flex: 1;
    max-width: 100px;
}

.emoji-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(10, 37, 64, 0.12);
    border-color: #1a4a7a;
}

.emoji-card img {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    margin-bottom: 8px;
    object-fit: cover;
    background: #f1f5f9;
    padding: 5px;
}

.emoji-card .valor {
    font-size: 16px;
    font-weight: 700;
    color: #0a2540;
}

.emoji-card .texto {
    font-size: 10px;
    color: #64748b;
    margin-top: 4px;
}

.loading {
    display: none;
    text-align: center;
    margin-top: 25px;
    color: #1a4a7a;
    font-weight: 600;
    padding: 10px;
    background: #f0f7ff;
    border-radius: 30px;
    font-size: 13px;
}

/* ========== COMENTARIOS ========== */
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    background: #f8fafc;
    -webkit-appearance: none;
}

textarea:focus {
    border-color: #1a4a7a;
    outline: none;
    background: white;
}

/* ========== PÁGINA DE GRACIAS ========== */
.gracias-container {
    background: white;
    padding: 40px 25px;
    border-radius: 24px;
    text-align: center;
    max-width: 500px;
    margin: 40px auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
}

.gracias-container .logo-final {
    width: 80px;
    margin-bottom: 20px;
}

.gracias-container h1 {
    color: #0a2540;
    margin-bottom: 15px;
    font-size: 24px;
}

.gracias-container p {
    color: #475569;
    line-height: 1.6;
    font-size: 14px;
}

/* ========== LOGIN ADMIN ========== */
.login-container {
    max-width: 400px;
    margin: 40px auto;
    background: white;
    padding: 30px 25px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.1);
}

.login-container .logo-login {
    width: 80px;
    margin-bottom: 20px;
}

.login-container h2 {
    color: #0a2540;
    margin-bottom: 25px;
    font-size: 22px;
}

.login-container input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    -webkit-appearance: none;
}

.login-container button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #0a2540 0%, #1a4a7a 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

/* ========== DASHBOARD ADMIN ========== */
.navbar {
    background: linear-gradient(135deg, #0a2540 0%, #1a4a7a 100%);
    padding: 15px 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.navbar .logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
}

.navbar .logo-area img {
    width: 35px;
}

.navbar span {
    font-size: 13px;
}

.btn-cerrar {
    background: #dc2626;
    color: white;
    padding: 6px 15px;
    text-decoration: none;
    border-radius: 30px;
    font-size: 12px;
}

.dashboard-container {
    max-width: 1300px;
    margin: 25px auto;
    padding: 0 15px;
}

.botones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.card-boton {
    background: white;
    border-radius: 18px;
    padding: 30px 20px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.card-boton h3 {
    color: #0a2540;
    margin-bottom: 8px;
    font-size: 18px;
}

.card-boton p {
    color: #64748b;
    font-size: 12px;
}

.icono {
    font-size: 40px;
    margin-bottom: 15px;
}

/* ========== TABLA DE ENCUESTAS ========== */
.filtros {
    background: white;
    padding: 15px;
    border-radius: 14px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filtros input, .filtros button {
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    flex: 1;
    min-width: 120px;
}

.filtros button {
    background: #1a4a7a;
    color: white;
    cursor: pointer;
    border: none;
    flex: 0;
}

table {
    width: 100%;
    background: white;
    border-radius: 14px;
    overflow-x: auto;
    display: block;
    font-size: 12px;
}

th {
    background: #0a2540;
    color: white;
    padding: 10px 8px;
    font-size: 11px;
}

td {
    padding: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.valor-bajo { background: #fee2e2; color: #991b1b; }
.valor-medio { background: #fff7ed; color: #c2410c; }
.valor-alto { background: #dcfce7; color: #166534; }

.btn-imprimir {
    background: #1a4a7a;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 11px;
    display: inline-block;
}

/* ========== ESTADÍSTICAS ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
}

.stat-card .numero {
    font-size: 32px;
    font-weight: 800;
    color: #0a2540;
}

.grafica-container {
    background: white;
    padding: 20px;
    border-radius: 16px;
    margin-top: 20px;
}

/* ========== MEDIA QUERIES - RESPONSIVE ========== */

/* Tablet (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    body {
        padding: 20px;
    }
    
    .emojis-grid {
        gap: 18px;
    }
    
    .emoji-card {
        min-width: 100px;
        max-width: 110px;
        padding: 15px 12px;
    }
    
    .emoji-card img {
        width: 65px;
        height: 65px;
    }
    
    .question-container h2 {
        font-size: 22px;
    }
    
    .form-encuesta {
        padding: 35px;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    body {
        padding: 30px;
    }
    
    .header-sgc {
        padding: 30px 40px;
    }
    
    .titulo-empresa h1 {
        font-size: 24px;
    }
    
    .form-encuesta {
        padding: 45px;
    }
    
    .question-container {
        padding: 50px 45px;
    }
    
    .question-container h2 {
        font-size: 28px;
    }
    
    .emoji-card {
        min-width: 130px;
        max-width: 140px;
        padding: 22px 18px;
    }
    
    .emoji-card img {
        width: 85px;
        height: 85px;
    }
    
    .emoji-card .valor {
        font-size: 20px;
    }
    
    .emoji-card .texto {
        font-size: 12px;
    }
}

/* Móvil pequeño (hasta 480px) */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .header-sgc {
        padding: 15px;
    }
    
    .logo-area {
        gap: 12px;
    }
    
    .logo {
        width: 50px;
        height: 50px;
    }
    
    .titulo-empresa h1 {
        font-size: 14px;
    }
    
    .titulo-empresa p {
        font-size: 10px;
    }
    
    .info-codigos {
        gap: 8px;
    }
    
    .info-codigos span {
        font-size: 8px;
        padding: 3px 8px;
    }
    
    .form-encuesta {
        padding: 18px;
    }
    
    .instrucciones {
        padding: 12px;
    }
    
    .instrucciones h3 {
        font-size: 14px;
    }
    
    .instrucciones p {
        font-size: 11px;
    }
    
    .question-container {
        padding: 18px 15px;
    }
    
    .question-container h2 {
        font-size: 16px;
        margin-bottom: 20px;
    }
    
    .emojis-grid {
        gap: 8px;
    }
    
    .emoji-card {
        min-width: 65px;
        max-width: 75px;
        padding: 8px 5px;
    }
    
    .emoji-card img {
        width: 40px;
        height: 40px;
    }
    
    .emoji-card .valor {
        font-size: 12px;
    }
    
    .emoji-card .texto {
        font-size: 8px;
    }
    
    .progress-bar {
        font-size: 11px;
        padding: 10px 15px;
    }
    
    .gracias-container {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .gracias-container h1 {
        font-size: 20px;
    }
    
    .login-container {
        margin: 20px;
        padding: 25px 20px;
    }
    
    .botones-grid {
        grid-template-columns: 1fr;
    }
    
    .filtros input, .filtros button {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    th, td {
        font-size: 10px;
        padding: 6px;
    }
}

/* Móvil mediano (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
    .emoji-card {
        min-width: 80px;
        max-width: 90px;
        padding: 10px 8px;
    }
    
    .emoji-card img {
        width: 48px;
        height: 48px;
    }
    
    .question-container h2 {
        font-size: 18px;
    }
    
    .form-encuesta {
        padding: 22px;
    }
}

/* Orientación horizontal en móvil */
@media (max-height: 500px) and (orientation: landscape) {
    .question-container {
        padding: 15px;
    }
    
    .emojis-grid {
        gap: 10px;
    }
    
    .emoji-card {
        padding: 8px 6px;
    }
    
    .emoji-card img {
        width: 45px;
        height: 45px;
    }
}

/* Ajustes para táctil (móviles) */
@media (hover: none) and (pointer: coarse) {
    .emoji-card:active {
        transform: scale(0.95);
        background: #f0f7ff;
    }
    
    button, .btn-iniciar, .emoji-card {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #1a4a7a;
    border-radius: 10px;
}