/*
 * Encuestas.
 *
 * El `tailwind.css` del tema es un build PURGADO: solo trae las clases que el
 * proyecto usaba cuando se genero. Lo que le falta a este modulo va aqui, no
 * regenerando el bundle, que lo comparten todas las pantallas.
 *
 * Se sirve en las DOS areas: el panel (constructor, resultados) y el area de
 * clientes (la pagina publica de respuesta), por eso estan las dos mitades en
 * el mismo fichero.
 */

/* --------------------------------------------------------------------- */
/* Utilidades que faltan en el build purgado                              */
/* --------------------------------------------------------------------- */

.survey-actions-col {
    width: 8rem;
}

/* --------------------------------------------------------------------- */
/* Listado                                                                */
/* --------------------------------------------------------------------- */

.survey-card {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .875rem 1rem;
    border: 1px solid #e5e5e5;
    border-radius: .5rem;
    background: #fafafa;
    margin-bottom: .75rem;
}

.survey-card-icon {
    font-size: 1.5rem;
    color: #0288d1;
    flex: none;
}

.survey-card-value {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.1;
}

.survey-side {
    padding: 1rem;
    border: 1px solid #e5e5e5;
    border-radius: .5rem;
    background: #fafafa;
}

.survey-stats li {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    padding: .25rem 0;
    border-bottom: 1px dashed #e5e5e5;
}

.survey-stats li:last-child {
    border-bottom: 0;
}

.survey-merge-list li {
    padding: .2rem 0;
    font-size: .8125rem;
}

.survey-inline-select {
    width: auto;
    display: inline-block;
}

/* --------------------------------------------------------------------- */
/* Constructor de preguntas                                               */
/* --------------------------------------------------------------------- */

.survey-builder-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
}

.survey-q {
    border: 1px solid #e0e0e0;
    border-radius: .5rem;
    padding: 1rem;
    margin-bottom: .75rem;
    background: #fff;
}

.survey-q-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: .625rem;
}

.survey-q-index {
    flex: none;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: #0288d1;
    color: #fff;
    font-size: .8125rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.survey-q-head .form-control {
    flex: 1 1 12rem;
    min-width: 0;
}

.survey-q-type {
    flex: none;
    width: 12rem;
}

.survey-q-settings {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .5rem;
}

.survey-q-settings label {
    font-size: .75rem;
    color: #777;
    margin: 0 0 .125rem;
    display: block;
}

.survey-q-settings .form-control {
    width: 8rem;
}

.survey-choice {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .375rem;
}

.survey-choice .form-control {
    flex: 1 1 auto;
}

.survey-q-answers {
    font-size: .75rem;
    color: #e65100;
}

.survey-empty {
    padding: 2rem;
    text-align: center;
    color: #999;
    border: 1px dashed #ddd;
    border-radius: .5rem;
}

/* --------------------------------------------------------------------- */
/* Resultados                                                             */
/* --------------------------------------------------------------------- */

.survey-chart-wrap {
    position: relative;
    height: 180px;
    margin-bottom: 1rem;
}

.survey-progress {
    height: 8px;
    margin: 0;
}

.survey-answers li {
    padding: .5rem .75rem;
    background: #fafafa;
    border-left: 3px solid #0288d1;
    margin-bottom: .375rem;
    font-size: .875rem;
}

.survey-latest li {
    padding: .5rem 0;
    border-bottom: 1px solid #eee;
}

.survey-latest li:last-child {
    border-bottom: 0;
}

/* --------------------------------------------------------------------- */
/* La pagina publica                                                      */
/* --------------------------------------------------------------------- */

.survey-public-card {
    background: #fff;
    border-radius: .5rem;
    padding: 2rem;
    margin: 1.5rem 0 3rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.survey-public-logo {
    text-align: center;
    margin-bottom: 1.25rem;
}

.survey-public-logo img {
    max-height: 60px;
    width: auto;
}

.survey-public-title {
    margin: 0 0 .75rem;
    font-weight: 600;
    text-align: center;
}

.survey-public-intro {
    color: #666;
    text-align: center;
    margin-bottom: 1.5rem;
}

.survey-public-questions {
    list-style: none;
    counter-reset: pregunta;
    padding: 0;
    margin: 0 0 1.5rem;
}

.survey-public-question {
    counter-increment: pregunta;
    padding: 1.25rem 0;
    border-bottom: 1px solid #eee;
}

.survey-public-question:last-child {
    border-bottom: 0;
}

.survey-public-label {
    display: block;
    font-weight: 600;
    margin-bottom: .625rem;
}

.survey-public-label::before {
    content: counter(pregunta) ". ";
    color: #0288d1;
}

.survey-public-choices .checkbox,
.survey-public-choices .radio {
    margin: .25rem 0;
}

.survey-public-captcha {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.survey-public-thanks {
    text-align: center;
    padding: 2rem 0;
}

.survey-public-thanks i {
    font-size: 3rem;
    color: #2e7d32;
    margin-bottom: 1rem;
    display: block;
}

.survey-closed-icon {
    font-size: 3rem;
    color: #bbb;
    display: block;
    margin: 1rem 0;
}

.survey-closed-reason {
    font-size: 1.0625rem;
    margin-bottom: 1rem;
}

/* Escala 1..N */
.survey-scale {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.survey-scale-ends {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: .375rem;
}

.survey-scale-label {
    font-size: .8125rem;
    color: #777;
}

.survey-scale-item {
    margin: 0;
    cursor: pointer;
    font-weight: 400;
}

.survey-scale-item input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.survey-scale-item span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid #ccc;
    border-radius: .375rem;
    transition: background .15s, border-color .15s;
}

.survey-scale-item input:checked + span {
    background: #0288d1;
    border-color: #0288d1;
    color: #fff;
}

.survey-scale-item input:focus + span {
    outline: 2px solid #0288d1;
    outline-offset: 2px;
}

/* Valoracion con estrellas */
.survey-rating {
    display: flex;
    gap: .25rem;
    font-size: 1.75rem;
    color: #ccc;
}

.survey-rating-item {
    margin: 0;
    cursor: pointer;
    line-height: 1;
}

.survey-rating-item input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.survey-rating-item.is-on i,
.survey-rating-item input:checked ~ i {
    color: #f9a825;
}

.survey-rating-item input:focus + i {
    outline: 2px solid #0288d1;
    outline-offset: 2px;
}
