:root {
    --rosewater: #dc8a78;
    --flamingo: #dd7878;
    --pink: #ea76cb;
    --mauve: #8839ef;
    --red: #d20f39;
    --maroon: #e64553;
    --peach: #fe640b;
    --orange: #fe640b;
    --yellow: #df8e1d;
    --orange-ligth: #ffa285;
    --green: #40a02b;
    --greenligth: #92cb85fc;
    --teal: #179299;
    --sky: #04a5e5;
    --sapphire: #209fb5;
    --blue: #1e66f5;
    --lavender: #7287fd;
    --text: #4c4f69;
    --subtext1: #5c5f77;
    --subtext0: #6c6f85;
    --overlay2: #7c7f93;
    --overlay1: #8c8fa1;
    --overlay0: #9ca0b0;
    --surface2: #acb0be;
    --surface1: #bcc0cc;
    --surface0: #ccd0da;
    --base: #eff1f5;
    --mantle: #e6e9ef;
    --crust: #dce0e8;
    --white: #fff;
    --border-radius: 0.3rem;
    --border-radius-badge: 16px;
    --border-radius-circle: 50%;
    --glass-background: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-backdrop: blur(12px);
    --glass-active-bg: rgba(255, 255, 255, 0.25);
    --glass-active-border: rgba(255, 255, 255, 0.4);
    --teal-rgb: 23, 146, 153;
    --maroon-rgb: 230, 69, 83;
    --flamingo-rgb: 221, 120, 120;
    --peach-rgb: 254, 100, 11;
    --red-rgb: 210, 15, 57;
    --green-rgb: 64, 160, 43;
    --elevacion-1: 0 1px 3px rgba(0, 0, 0, 0.12),
        0 1px 2px rgba(0, 0, 0, 0.24);
    --elevacion-2: 0 3px 6px rgba(0, 0, 0, 0.16),
        0 3px 6px rgba(0, 0, 0, 0.23);
    --padding-05: 0.5rem;
    --padding-1: 1rem;
    --padding-2: 2rem;
    --gap-05: 0.5rem;
    --gap-1: 1rem;
    --sky-rgb: 14, 165, 233;
}


body {
    scrollbar-color: var(--maroon) var(--crust);
    scrollbar-width: 10px;
    scrollbar-gutter: 10px;
}


.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}


.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90dvw;
    height: 90vh;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

/* Popup con mapa de brigadas al lado (etapa 2) */
.popup-con-mapa {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 96dvw;
    height: 94vh;
    background: transparent;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
}

.popup-con-mapa .popup-principal {
    flex: 1;
    min-width: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: flex 0.3s ease;
    position: relative;
}

.popup-con-mapa .popup-principal.expandido {
    flex: 1 1 100%;
}

.popup-con-mapa .popup-mapa {
    width: 55%;
    min-width: 600px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.popup-con-mapa .popup-mapa.oculto {
    width: 0;
    min-width: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.popup-mapa-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f5f5f5 0%, #eff1f5 100%);
    border-bottom: 1px solid #dce0e8;
}

.popup-mapa-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4c4f69;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.popup-mapa-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    cursor: pointer;
    color: #6c6f85;
    transition: all 0.2s ease;
}

.popup-mapa-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #4c4f69;
}

.popup-mapa-content {
    flex: 1;
    overflow: hidden;
}

/* Botón flotante para mostrar mapa cuando está oculto */
.btn-mostrar-mapa {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
    transition: all 0.2s ease;
    z-index: 10;
}

.btn-mostrar-mapa:hover {
    transform: translateY(-50%) scale(1.02);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.popup-inbox {
    position: fixed;
    top: 50%;
    left: 29%;
    transform: translate(-50%, -50%);
    width: 58dvw;
    height: 90vh;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contenedor-popup {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100dvh;
    overflow: hidden;
    padding: min(2rem, 4dvw);
    position: relative;
}

.contenedor-popup h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    margin: 0;
    text-align: center
}

.popup-header>h2 {
    flex-grow: 1;
}

.close-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text);
}

.close-button:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
    transform: rotate(90deg);
}

.close-button:active {
    transform: scale(0.9);
}


.cargando {
    height: 100%;
    color: var(--text);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.etapa-ingreso-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100vh;
    overflow: hidden;
}

.formulario {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}


.label-pregunta {
    align-items: center;
    color: var(--text);
    display: flex;
    font-size: 0.9rem;
    font-weight: 500;
    gap: 0.5rem;
}


.label-pregunta.obligatorio::before {
    content: '';
    display: block;
    width: 4px;
    height: 1rem;
    background: var(--red);
    border-radius: var(--border-radius);
}

.contenedor-sugerencia {
    align-items: center;
    color: var(--sky);
    display: flex;
    font-size: 0.8rem;
    gap: 0.2rem;
    padding: 0.3rem;
}


.contenedor-elementos {
    border-top: 0.1rem solid var(--surface0);
    color: var(--subtext1);
    display: flex;
    flex-direction: column;
    padding: min(1.5rem, 15%);
    position: relative;
}


.input,
.textarea {
    font-size: 0.9rem;
    padding: 0.4rem;
    border: 2px solid var(--overlay0);
    border-radius: var(--border-radius);
    color: var(--text);
    background: var(--white);
    transition: all 0.2s ease-in-out;

}


/* .input:focus,
.textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 25%, transparent);
} */

.input-number {
    text-align: center;
    width: 35dvw;
}

.input-text {
    width: 40dvw;
}

.contenedor-botones {
    display: flex;
    gap: 1rem;
    padding: 0.5rem;
    position: sticky;
    bottom: 0;
    flex-wrap: wrap;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

.btn {
    align-items: center;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    display: flex;
    font-weight: 500;
    justify-content: center;
    padding: 0.5rem 1rem;
    transition: background 0.2s ease;
    gap: 0.4rem;
    min-width: min(10rem, 12%);
}

.btn-corregir {
    background: var(--peach);
    color: var(--base);
    margin-left: auto;

}

.btn-secundario {
    background: var(--green);
    color: var(--base);
    margin-left: auto;

}

.btn-guardar {
    background: var(--sapphire);
    color: var(--base);
    margin-left: auto;
}

.btn-cancelar {
    background: var(--maroon);
    color: var(--base);
}

.btn-cancelar:hover {
    background: var(--red);
    color: var(--base);
}

.btn-guardar:hover {
    background: var(--sky);
}

.btn-corregir:hover {
    background: var(--yellow);
}

.date-picker-container {
    padding-top: 0.8rem;
    max-width: 35dvw;
}

.input:focus,
.textarea:focus {
    outline: none;
    border-color: var(--sky);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--sky) 25%, transparent);
}

/* .input-error {
    border: 1px solid var(--red);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--red) 25%, transparent);


.input-correcto {
    border: 1px solid var(--greenligth);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--teal) 25%, transparent);
    padding-right: 1rem;
    background: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='green'%3E%3Cpath d='M9 16.2l-4.2-4.2-1.4 1.4 5.6 5.6 12-12-1.4-1.4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 1rem;
}

.contenedor-correcto {
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--greenligth) 25%, transparent);
    background: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='green'%3E%3Cpath d='M9 16.2l-4.2-4.2-1.4 1.4 5.6 5.6 12-12-1.4-1.4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 top;
    background-size: 1rem;
    border-radius: var(--border-radius);
} */


.contenedor-busqueda {
    position: relative;
    width: 100%;
}

.busqueda-input {
    position: relative;
}

.cargando-input {
    pointer-events: none;
    position: absolute;
    right: 1rem;
    top: 20%;
}

.mensaje-error {
    color: var(--red);
    display: block;
    font-size: 0.75rem;
    margin-left: 4px;
    margin-top: 4px;
    min-height: 1rem;
    transition: opacity 0.2s ease-in-out;
    white-space: normal;
}

.error {
    color: var(--red);
    font-size: 0.8em;
    margin-top: 0.1rem;
}



.contenedor-opciones {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.8rem;
    padding: 0.5rem 2rem 0.5rem;
    width: 100%;
}

.contenedor-input-intermedio {
    grid-column: 1 / -1;
    margin-top: 1rem;
}

.btn-opcion {
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    line-height: 1.3;
    position: relative;
    overflow: hidden;
    user-select: none;
}

.btn-opcion::before {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn-opcion:active::before {
    opacity: 0.1;
}

.btn-opcion-multiple {
    border: 1.5px solid var(--surface1);
    background: var(--white);
    color: var(--text);
}

.btn-opcion-unica {
    border: 1.5px solid var(--surface1);
    background: var(--white);
    color: var(--text);
}

.btn-opcion-unica:hover:not(:disabled):not(.seleccionado) {
    border-color: var(--sapphire);
    background: rgba(32, 159, 181, 0.06);
    color: var(--sapphire);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(32, 159, 181, 0.12);
}

.btn-opcion-multiple:hover:not(:disabled):not(.seleccionado) {
    border-color: var(--maroon);
    background: rgba(230, 69, 83, 0.06);
    color: var(--maroon);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 69, 83, 0.12);
}

.btn-opcion-unica.seleccionado {
    background: linear-gradient(135deg, var(--sapphire) 0%, var(--teal) 100%);
    color: var(--white);
    border: none;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(32, 159, 181, 0.35),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.btn-opcion-unica.seleccionado:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(32, 159, 181, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-opcion-multiple.seleccionado {
    background: linear-gradient(135deg, var(--maroon) 0%, var(--flamingo) 100%);
    color: var(--white);
    border: none;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(230, 69, 83, 0.35),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.btn-opcion-multiple.seleccionado:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(230, 69, 83, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-opcion:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-opcion:disabled::before {
    display: none;
}

.titulo-h2 {
    text-align: center;
}



.contenedor-busqueda {
    position: relative;
    width: 100%;
}

.input-busqueda-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    position: relative;
    width: 100%;
}


.btn-seleccionar {
    background: var(--blue);
    color: var(--base);
}

.btn-seleccionar:hover {
    background: var(--sky);
}


/* .textarea {
    line-height: 1.5;
    resize: none;
    width: 100%;
}


.contenedor-textarea {
    position: relative;
    width: 100%;
} */

.contenedor-erroneo {
    border: 1px solid var(--red);
    border-radius: var(--border-radius);
    padding: 0.5rem 2rem 0.5rem;
    background-color: color-mix(in srgb, var(--red) 5%, transparent);
}

.contenedor-seleccionar {
    align-items: center;
    display: flex;
    font-size: 0.8em;
    gap: 0.2rem;
    justify-content: center;
    padding: 0.5rem;
    color: var(--red);
}



.react-datepicker__day.react-datepicker__day--disabled {
    background: #fff !important;
    color: #ccc !important;
    cursor: not-allowed !important;
}

.react-datepicker__day.react-datepicker__day--disabled:hover {
    background-color: #f0f0f0 !important;
}

.react-datepicker__time-list-item.react-datepicker__time-list-item--disabled {

    cursor: not-allowed !important;
}

.react-datepicker__time-list-item.react-datepicker__time-list-item--disabled:hover {
    background-color: #f0f0f0 !important;
}

@media (max-width: 768px) {
    .input-busqueda-wrapper {
        flex-direction: column;
        max-width: none;

        width: 100%;
    }

    .input.input-text {
        width: 100%;
        max-width: none;
    }

    .input-number {
        width: auto;
    }

    .btn,
    .btn-seleccionar {
        width: 100%;
        max-width: none;
    }


    .contenedor-botones {
        flex-direction: column-reverse;
    }

    .popup {
        width: 98dvw;
        height: 98dvh;
    }


}


.infoAmbiente {
    box-shadow: inset 4px 4px 6px -1px rgba(0, 0, 0, 0.1), inset 2px 2px 4px -1px rgba(0, 0, 0, 0.06);
    color: var(--white);
    padding: 0.4rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.infoDesa {
    background: linear-gradient(135deg, var(--green), #4caf50d9, #4caf50);
}

.infoQa {
    background: linear-gradient(135deg, var(--yellow), #FF9800, #cb7d09);
}

.formSesion {
    flex-direction: row;
}

/* Mediciones con direcciones */
.medicion-con-direccion-card {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: #fff;
}

.medicion-con-direccion-card.needs-address {
    border: 2px solid #dc3545;
}

.medicion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.medicion-title {
    font-weight: bold;
    font-size: 1rem;
}

.medicion-type {
    margin-left: 0.5rem;
    color: #666;
    font-size: 0.875rem;
}

.medicion-details {
    margin-top: 0.5rem;
}

.medicion-subtitle {
    color: #666;
}

.medicion-distancia {
    margin-left: 1rem;
    color: #666;
}

.medicion-direccion-input {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.medicion-direccion-input.has-error {
    border: 1px solid #dc3545;
}

.btn-glass {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    cursor: pointer;
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    min-width: fit-content;
}

.btn-glass:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.btn-glass:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

.btn-glass-validate {
    background: rgba(var(--green-rgb), 0.15);
    border: 1px solid rgba(var(--green-rgb), 0.3);
    color: var(--green);
}

.btn-glass-validate:hover {
    background: rgba(var(--green-rgb), 0.25);
    border: 1px solid rgba(var(--green-rgb), 0.45);
    box-shadow: 0 4px 16px rgba(var(--green-rgb), 0.2);
}

.btn-glass-validate:active {
    background: rgba(var(--green-rgb), 0.35);
    border: 1px solid rgba(var(--green-rgb), 0.6);
}

.btn-glass-reject {
    background: rgba(var(--red-rgb), 0.15);
    border: 1px solid rgba(var(--red-rgb), 0.3);
    color: var(--red);
}

.btn-glass-reject:hover {
    background: rgba(var(--red-rgb), 0.25);
    border: 1px solid rgba(var(--red-rgb), 0.45);
    box-shadow: 0 4px 16px rgba(var(--red-rgb), 0.2);
}

.btn-glass-reject:active {
    background: rgba(var(--red-rgb), 0.35);
    border: 1px solid rgba(var(--red-rgb), 0.6);
}

@keyframes progressBar {
    0% {
        transform: translateX(-100%);
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0.8;
    }
}

@keyframes progressPulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(210, 15, 57, 0.4), 0 0 16px rgba(210, 15, 57, 0.2);
    }
    50% {
        box-shadow: 0 0 12px rgba(210, 15, 57, 0.6), 0 0 24px rgba(210, 15, 57, 0.4);
    }
}