/* Ningún bloque de la encuesta debe salirse del ancho de la pantalla
   (las tablets de terreno son de 800 x 1340). */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.formbold-main-wrapper {
  display: flex;
  justify-content: center;
  padding: 40px;
  font-family: Arial, sans-serif;
}

.formbold-form-wrapper {
  width: 100%;
  max-width: 900px;
  background: #ffffff;
  padding: 30px;
}

.tabla-encuesta {
  width: 100%;
  border-collapse: collapse;
}

.tabla-encuesta th,
.tabla-encuesta td {
  border: 1px solid #dde3ec;
  padding: 12px;
  vertical-align: middle;
}

.tabla-encuesta th {
  background: #f1f4ff;
  color: #07074d;
  text-align: center;
}

.tabla-encuesta td:first-child {
  width: 70%;
  font-weight: 500;
}

.tabla-encuesta td:nth-child(2),
.tabla-encuesta td:nth-child(3) {
  width: 15%;
  text-align: center;
}

.tabla-encuesta input[type="radio"] {
  transform: scale(1.2);
  cursor: pointer;
}

.ms-opcion {
  margin-left: 25px;
}

.formbold-form-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #dde3ec;
  border-radius: 5px;
}

.formbold-btn {
  width: 100%;
  margin-top: 25px;
  padding: 14px;
  border: none;
  border-radius: 5px;
  background: #6a64f1;
  color: white;
  font-size: 16px;
  cursor: pointer;
}

.formbold-btn:hover {
  opacity: 0.9;
}

.spa-select {
    position: relative;
    width: 100%;
}

.spa-native-select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.spa-select__button {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 2.85rem;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .72rem 2.35rem .72rem .85rem;
    border: 1px solid #d7e2f1;
    border-radius: 14px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    line-height: 1.25;
    text-align: left;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.spa-select__button::after {
    content: "";
    position: absolute;
    top: 50%;
    right: .9rem;
    width: .55rem;
    height: .55rem;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: translateY(-64%) rotate(45deg);
    pointer-events: none;
}

.spa-select__button:focus,
.spa-select__button.is-open {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .12);
}

.spa-select__button.is-placeholder {
    color: #475569;
}

.spa-select__button.is-invalid {
    border-color: #dc3545;
}

.spa-select__button:disabled {
    cursor: not-allowed;
    background: #e9ecef;
    color: #64748b;
    opacity: 1;
}

.spa-select__label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spa-select__menu {
    position: fixed;
    z-index: 2055;
    max-height: calc(2.75rem * 3);
    overflow-y: auto;
    border: 1px solid #94a3b8;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .18);
    overscroll-behavior: contain;
}

.spa-select__option {
    display: flex;
    width: 100%;
    min-height: 2.75rem;
    align-items: center;
    padding: .62rem .85rem;
    border: 0;
    background: #fff;
    color: #0f172a;
    font: inherit;
    line-height: 1.2;
    text-align: left;
}

.spa-select__option:hover,
.spa-select__option:focus {
    background: #e7f1ff;
    outline: 0;
}

.spa-select__option.is-selected {
    background: #0d6efd;
    color: #fff;
}

.spa-select__option:disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

@media (min-width: 768px) {
    .modal-dialog.comunero-modal-dialog,
    .modal-dialog.encuestador-modal-dialog {
        width: min(94vw, 1220px);
        max-width: min(94vw, 1220px);
        height: auto;
        min-height: 0;
        margin-right: auto;
        margin-left: auto;
    }

    .modal-dialog-scrollable .comunero-modal-content,
    .modal-dialog-scrollable .encuestador-modal-content {
        max-height: min(82vh, 720px);
    }

    .comunero-modal-body .row > .col-md-4,
    .encuestador-modal-body .row > .col-md-4 {
        flex: 0 0 auto;
        width: 25%;
    }

    .comunero-modal-body .row > .col-md-8,
    .encuestador-modal-body .row > .col-md-8 {
        flex: 0 0 auto;
        width: 50%;
    }
}

@media (max-width: 767.98px) {
    .modal-dialog.comunero-modal-dialog,
    .modal-dialog.encuestador-modal-dialog {
        height: auto;
        min-height: 0;
        margin: .5rem;
    }

    .modal-dialog-scrollable .comunero-modal-content,
    .modal-dialog-scrollable .encuestador-modal-content {
        max-height: calc(100vh - 1rem);
    }
}
.survey-hero-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .75rem;
}

.survey-folio-badge {
    min-width: 190px;
    padding: 1rem 1.15rem;
    border-radius: 22px;
    border: 1px solid #cfe0f5;
    background: #fff;
    color: #0f172a;
    text-align: right;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .12);
}

.survey-folio-label {
    display: block;
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #64748b;
}

.survey-folio-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1.2;
    color: #0d6efd;
}

.survey-folio-float {
    position: fixed;
    top: 1.6rem;
    right: 1.25rem;
    left: auto;
    z-index: 1040;
    pointer-events: none;
}

.survey-folio-float .survey-folio-badge {
    pointer-events: auto;
}

@media (min-width: 1760px) {
    .survey-folio-float {
        top: 1.1rem;
        right: auto;
        left: calc(50% + 672px);
        display: block;
        margin: 0;
    }
}

/* Tablets (800 x 1340) y pantallas intermedias: el folio se mantiene siempre
   arriba a la derecha y el botón "Volver al menú" siempre abajo del texto,
   alineado a la izquierda. */
@media (max-width: 1180px) {
    .survey-folio-float {
        top: .9rem;
        right: .9rem;
        bottom: auto;
        left: auto;
    }

    .survey-folio-badge {
        min-width: 0;
        padding: .6rem .85rem;
        border-radius: 16px;
    }

    .survey-shell {
        padding-top: 4.75rem !important;
    }

    .survey-hero-actions {
        width: 100%;
        align-items: flex-start;
    }

    .survey-hero-actions .btn {
        width: auto;
    }
}

.survey-shell {
    position: relative;
}

.survey-hero-wrap {
    position: relative;
}

.survey-timeline-card {
    margin: -0.25rem 0 1.35rem;
    padding: 1rem 1.1rem;
    border: 1px solid #d7e2f1;
    border-radius: 22px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 14px 40px rgba(15, 23, 42, .07);
}

.survey-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: .85rem;
}

.survey-timeline-title {
    margin: 0;
    color: #0f172a;
    font-size: .95rem;
    font-weight: 900;
}

.survey-timeline-progress {
    color: #64748b;
    font-size: .82rem;
    font-weight: 800;
}

.survey-timeline {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .55rem;
    position: relative;
}

.survey-timeline::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 5%;
    right: 5%;
    height: 2px;
    background: #dbe7f5;
    z-index: 0;
}

.survey-step-link {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: .4rem;
    color: #64748b;
    text-decoration: none;
}

.survey-step-dot {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #d7e2f1;
    border-radius: 50%;
    background: #f8fbff;
    color: #0d6efd;
    font-size: .88rem;
    font-weight: 900;
    transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
}

.survey-step-label {
    max-width: 120px;
    min-height: 2.2em;
    color: #475569;
    font-size: .76rem;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
}

.survey-step-link.is-completed .survey-step-dot {
    border-color: #0f8b5f;
    background: #d8f5e7;
    color: #087f5b;
}

.survey-step-link.is-active .survey-step-dot {
    border-color: #0d6efd;
    background: #0d6efd;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(13, 110, 253, .22);
}

.survey-step-link.is-completed .survey-step-label {
    color: #087f5b;
}

.survey-step-link.is-active .survey-step-label {
    color: #0d6efd;
}

.survey-step-link.is-locked {
    cursor: default;
}

.survey-step-link.is-locked:not(.is-active) {
    opacity: .78;
}

.survey-step-link.is-locked:not(.is-completed):not(.is-active) .survey-step-dot {
    border-color: #d7e2f1;
    background: #f8fbff;
    color: #94a3b8;
}

.survey-step-link.is-locked:not(.is-completed):not(.is-active) .survey-step-label {
    color: #64748b;
}

.survey-step-link.is-completed.is-locked .survey-step-dot {
    box-shadow: inset 0 0 0 2px rgba(15, 139, 95, .08);
}

@media (max-width: 760px) {
    .survey-hero-actions {
        align-items: flex-start;
        width: 100%;
    }

    .survey-folio-badge {
        text-align: left;
    }

    .survey-folio-float {
        position: static;
        margin-bottom: 1rem;
    }

    .survey-shell {
        padding-top: 1.5rem !important;
    }

    .survey-timeline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .survey-timeline::before {
        display: none;
    }

    .survey-step-link {
        grid-template-columns: 38px 1fr;
        justify-items: start;
        text-align: left;
        padding: .45rem;
        border-radius: 14px;
        background: #f8fbff;
    }

    .survey-step-label {
        max-width: none;
        min-height: 0;
        text-align: left;
        align-self: center;
    }
}
