/* =========================================================
   INCIDENCIAS
   ESTILOS COMPLETOS
========================================================= */


/* =========================================================
   BOTÓN NOTIFICAR INCIDENCIA
========================================================= */

.enlace-notificar-incidencia {
    position: fixed;

    left: 150px;
    bottom: 0px;

    z-index: 1500;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    min-height: 40px;

    padding: 0 10px;

    box-sizing: border-box;

    background: transparent;

    color: #5f6368;

    border: 0;
    border-radius: 8px;

    box-shadow: none;

    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;

    text-decoration: none;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;


    background: rgba(255, 255, 255, 0.82);

    transition:
        background-color .15s ease,
        color .15s ease;
}


.enlace-notificar-incidencia:hover {
    background: rgba(255, 255, 255, 0.82);

    color: #202124;

    text-decoration: none;

    box-shadow: none;
}


.enlace-notificar-incidencia:active {
    background: rgba(241, 243, 244, 0.9);

    color: #202124;
}


.enlace-notificar-incidencia:visited {
    color: #5f6368;

    text-decoration: none;
}


.enlace-notificar-incidencia .material-symbols-rounded {
    font-size: 19px;

    line-height: 1;

    color: #5f6368;
}


.enlace-notificar-incidencia:hover .material-symbols-rounded {
    color: #3c4043;
}


.enlace-notificar-incidencia:focus-visible {
    outline: 2px solid rgba(26, 115, 232, .35);

    outline-offset: 2px;

    border-radius: 6px;
}


/* =========================================================
   AVISO PARA SELECCIONAR EL PUNTO
========================================================= */

.aviso-seleccionar-punto {
    position: fixed;

    top: 150px;
    left: 150px;

    transform: none;

    z-index: 2000;

    display: none;

    width: min(90vw, 430px);

    box-sizing: border-box;

    padding: 12px 14px;

    background: rgba(255, 255, 255, 0.96);

    color: #202124;

    border: 1px solid #dadce0;
    border-radius: 10px;

    box-shadow:
        0 2px 6px rgba(60, 64, 67, 0.15),
        0 6px 16px rgba(60, 64, 67, 0.15);

    font-family: inherit;

    font-size: 14px;
    line-height: 1.4;

    text-align: left;

    pointer-events: auto;
}


.aviso-seleccionar-punto.visible {
    display: block;
}


.aviso-seleccionar-contenido {
    display: flex;

    align-items: flex-start;

    gap: 10px;

    position: relative;
}


.aviso-seleccionar-icono {
    flex: 0 0 auto;

    font-size: 21px;
    line-height: 1.2;
}


.aviso-seleccionar-contenido > div:nth-child(2) {
    flex: 1;

    min-width: 0;

    padding-right: 24px;
}


.aviso-seleccionar-contenido strong {
    display: block;

    margin: 0 0 3px;

    font-size: 14px;
    font-weight: 600;

    color: #202124;
}


.aviso-seleccionar-contenido p {
    margin: 0;

    color: #5f6368;

    font-size: 13px;
    line-height: 1.4;
}


/* =========================================================
   BOTÓN CERRAR AVISO
========================================================= */

.aviso-seleccionar-punto .btn-cerrar-aviso {
    position: absolute;

    top: -5px;
    right: -5px;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    margin: 0;
    padding: 0;

    border: 0;

    background: transparent;

    color: #5f6368;

    font-family: inherit;

    font-size: 24px;
    font-weight: 400;
    line-height: 1;

    cursor: pointer;

    border-radius: 50%;
}


.aviso-seleccionar-punto .btn-cerrar-aviso:hover {
    background: #f1f3f4;

    color: #202124;
}


.aviso-seleccionar-punto .btn-cerrar-aviso:focus-visible {
    outline: 2px solid #1a73e8;

    outline-offset: 1px;
}


/* =========================================================
   MODAL INCIDENCIA
========================================================= */

.modal-incidencia {
    position: fixed;

    inset: 0;

    z-index: 3000;

    display: none;

    box-sizing: border-box;

    padding: 20px;

    background: rgba(0, 0, 0, 0.28);

    overscroll-behavior: contain;
}


.modal-incidencia.visible {
    display: flex;

    align-items: center;
    justify-content: center;
}


/* =========================================================
   OVERLAY
========================================================= */

.modal-incidencia-overlay {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    background: transparent;
}


/* =========================================================
   VENTANA DEL MODAL
   IMPORTANTE:
   El diálogo NO hace scroll.
   El scroll lo hace #form-incidencia.
========================================================= */

.modal-incidencia-dialog {
    position: relative;

    z-index: 1;

    display: flex;
    flex-direction: column;

    width: min(92vw, 680px);

    max-height: calc(100dvh - 40px);

    box-sizing: border-box;

    overflow: hidden;

    background: #ffffff;

    border: 1px solid #dadce0;

    border-radius: 14px;

    box-shadow:
        0 4px 10px rgba(0, 0, 0, .18),
        0 12px 32px rgba(0, 0, 0, .20);

    overscroll-behavior: contain;
}


/* =========================================================
   CABECERA DEL MODAL
   SIEMPRE VISIBLE
========================================================= */

.modal-incidencia-header {
    position: relative;

    flex: 0 0 auto;

    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    padding: 20px 52px 16px 22px;

    box-sizing: border-box;

    background: #005A9C;

    border-bottom: 1px solid #eceff1;
}


.modal-incidencia-header h2 {
    margin: 0;

    color: #ffffff;

    font-size: 21px;
    font-weight: 600;
    line-height: 1.3;
}


.modal-incidencia-header p {
    margin: 5px 0 0;

    color: rgba(255, 255, 255, .85);

    font-size: 14px;
    line-height: 1.4;
}


/* =========================================================
   BOTÓN X
========================================================= */

.modal-incidencia .modal-cerrar {
    position: absolute;

    top: 12px;
    right: 12px;

    z-index: 2;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;

    margin: 0;
    padding: 0;

    border: 0;

    background: transparent;

    color: #ffffff;

    font-family: Arial, sans-serif;

    font-size: 29px;
    font-weight: 300;
    line-height: 1;

    cursor: pointer;

    border-radius: 50%;
}


.modal-incidencia .modal-cerrar:hover {
    background: rgba(255, 255, 255, .15);

    color: #ffffff;
}


.modal-incidencia .modal-cerrar:focus-visible {
    outline: 2px solid #ffffff;

    outline-offset: 1px;
}


/* =========================================================
   FORMULARIO / CUERPO DEL MODAL
   ESTA ES LA ZONA QUE HACE SCROLL
========================================================= */

#form-incidencia {
    display: block;

    flex: 1 1 auto;

    min-height: 0;

    box-sizing: border-box;

    padding: 20px 22px 22px;

    overflow-y: auto;

    overscroll-behavior: contain;

    -webkit-overflow-scrolling: touch;
}


#form-incidencia,
#form-incidencia * {
    box-sizing: border-box;
}


/* =========================================================
   FIELDSET
========================================================= */

.incidencia-fieldset {
    margin: 0 0 22px;

    padding: 0;

    border: 0;
}


.incidencia-fieldset legend {
    margin: 0 0 4px;

    padding: 0;

    color: #202124;

    font-size: 16px;
    font-weight: 600;
}


.campo-ayuda {
    margin: 0 0 13px;

    color: #5f6368;

    font-size: 13px;
    line-height: 1.45;
}


/* =========================================================
   CHECKBOXES
========================================================= */

.incidencia-checkbox {
    display: flex;

    align-items: flex-start;

    gap: 11px;

    width: 100%;

    min-height: 42px;

    margin: 0;

    padding: 9px 8px;

    color: #3c4043;

    cursor: pointer;

    border-radius: 8px;

    transition:
        background-color .15s ease;
}


.incidencia-checkbox:hover {
    background: #f8f9fa;
}


.incidencia-checkbox input {
    position: absolute;

    width: 1px;
    height: 1px;

    margin: -1px;
    padding: 0;

    overflow: hidden;

    clip: rect(0, 0, 0, 0);

    white-space: nowrap;

    border: 0;
}


.checkbox-custom {
    position: relative;

    flex: 0 0 auto;

    width: 20px;
    height: 20px;

    margin-top: 1px;

    border: 2px solid #9aa0a6;

    border-radius: 4px;

    background: #ffffff;

    transition:
        background-color .15s ease,
        border-color .15s ease;
}


.incidencia-checkbox input:checked + .checkbox-custom {
    background: #1a73e8;

    border-color: #1a73e8;
}


.incidencia-checkbox input:checked + .checkbox-custom::after {
    content: "";

    position: absolute;

    left: 5px;
    top: 2px;

    width: 5px;
    height: 10px;

    border: solid #ffffff;

    border-width: 0 2px 2px 0;

    transform: rotate(45deg);
}


.incidencia-checkbox input:focus-visible + .checkbox-custom {
    outline: 2px solid rgba(26, 115, 232, .35);

    outline-offset: 2px;
}


.checkbox-text {
    flex: 1;

    min-width: 0;

    color: #3c4043;

    font-size: 14px;

    line-height: 1.45;
}


/* =========================================================
   CAMPOS DE FORMULARIO
========================================================= */

.campo-formulario {
    margin: 0 0 22px;
}


.campo-formulario > label {
    display: block;

    margin: 0 0 7px;

    color: #202124;

    font-size: 14px;
    font-weight: 600;
}


.opcional {
    color: #80868b;

    font-size: 12px;
    font-weight: 400;
}


#incidencia-descripcion {
    display: block;

    width: 100%;

    min-height: 105px;

    margin: 0;

    padding: 11px 12px;

    resize: vertical;

    border: 1px solid #dadce0;

    border-radius: 8px;

    background: #ffffff;

    color: #202124;

    font-family: inherit;

    font-size: 14px;

    line-height: 1.45;

    outline: none;

    appearance: none;
    -webkit-appearance: none;

    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}


#incidencia-descripcion::placeholder {
    color: #9aa0a6;
}


#incidencia-descripcion:hover {
    border-color: #bdc1c6;
}


#incidencia-descripcion:focus {
    border-color: #1a73e8;

    box-shadow:
        0 0 0 2px rgba(26, 115, 232, .12);
}


/* =========================================================
   FOTOGRAFÍA
========================================================= */

.campo-fotografia {
    margin: 0 0 20px;
}


.titulo-fotografia {
    display: block;

    margin: 0 0 5px;

    color: #202124;

    font-size: 14px;
    font-weight: 600;
}


.campo-fotografia .campo-ayuda {
    margin-bottom: 12px;
}


/* Ocultamos input nativo */

#incidencia-foto {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;

    pointer-events: none;
}


/* Botón fotografía */

.btn-fotografia {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    min-height: 40px;

    padding: 0 14px;

    border: 1px solid #dadce0;

    border-radius: 8px;

    background: #ffffff;

    color: #3c4043;

    font-family: inherit;

    font-size: 14px;
    font-weight: 500;

    cursor: pointer;

    transition:
        background-color .15s ease,
        border-color .15s ease;
}


.btn-fotografia:hover {
    background: #f8f9fa;

    border-color: #c4c7c5;
}


.btn-fotografia:active {
    background: #f1f3f4;
}


.btn-fotografia-icono {
    font-size: 18px;

    line-height: 1;
}


/* =========================================================
   PREVISUALIZACIÓN
========================================================= */

.previsualizacion-foto {
    margin-top: 14px;

    padding: 10px;

    border: 1px solid #dadce0;

    border-radius: 10px;

    background: #f8f9fa;
}


.previsualizacion-foto[hidden] {
    display: none;
}


.previsualizacion-foto img {
    display: block;

    width: 100%;

    max-height: 260px;

    object-fit: contain;

    border-radius: 7px;

    background: #ffffff;
}


.btn-eliminar-foto {
    display: block;

    margin-top: 9px;

    padding: 7px 10px;

    border: 0;

    background: transparent;

    color: #d93025;

    font-family: inherit;

    font-size: 13px;
    font-weight: 500;

    cursor: pointer;

    border-radius: 6px;
}


.btn-eliminar-foto:hover {
    background: #fce8e6;
}


/* =========================================================
   LOCALIZACIÓN
========================================================= */

.localizacion-seleccionada {
    display: block;

    width: 100%;

    margin: 0 0 16px;

    padding: 10px 12px;

    box-sizing: border-box;

    border-radius: 8px;

    background: #f1f3f4;

    color: #5f6368;

    font-size: 13px;

    line-height: 1.4;
}


/* =========================================================
   ERROR
========================================================= */

.error-incidencia {
    width: 100%;

    margin: 0 0 16px;

    padding: 11px 12px;

    box-sizing: border-box;

    border: 1px solid #f5c2c0;

    border-radius: 8px;

    background: #fce8e6;

    color: #b3261e;

    font-size: 13px;

    line-height: 1.4;
}


.error-incidencia[hidden] {
    display: none;
}


/* =========================================================
   BOTONES DEL FORMULARIO
========================================================= */

.acciones-formulario {
    display: flex;

    align-items: center;
    justify-content: flex-end;

    gap: 10px;

    margin-top: 4px;

    padding-top: 16px;

    border-top: 1px solid #eceff1;
}


.acciones-formulario button {
    min-height: 42px;

    padding: 0 17px;

    border-radius: 8px;

    font-family: inherit;

    font-size: 14px;
    font-weight: 500;

    cursor: pointer;

    transition:
        background-color .15s ease,
        box-shadow .15s ease,
        opacity .15s ease;
}


.btn-secundario {
    border: 1px solid #dadce0;

    background: #ffffff;

    color: #3c4043;
}


.btn-secundario:hover {
    background: #f8f9fa;
}


.btn-enviar {
    border: 1px solid #1a73e8;

    background: #1a73e8;

    color: #ffffff;
}


.btn-enviar:hover {
    background: #1769d1;

    box-shadow:
        0 1px 3px rgba(26, 115, 232, .25);
}


.btn-enviar:disabled {
    opacity: .6;

    cursor: wait;

    box-shadow: none;
}


/* =========================================================
   MENSAJE DE ÉXITO
========================================================= */

.mensaje-incidencia-ok {
    position: fixed;

    top: 90px;
    right: 20px;

    z-index: 4000;

    display: flex;

    flex-direction: column;

    gap: 3px;

    width: min(90vw, 340px);

    padding: 13px 16px;

    box-sizing: border-box;

    border: 1px solid #c8e6c9;

    border-radius: 9px;

    background: #ffffff;

    color: #202124;

    box-shadow:
        0 2px 6px rgba(60, 64, 67, .15),
        0 6px 16px rgba(60, 64, 67, .15);

    font-size: 13px;

    line-height: 1.4;
}


.mensaje-incidencia-ok[hidden] {
    display: none;
}


.mensaje-incidencia-ok strong {
    color: #188038;

    font-size: 14px;
}


.mensaje-incidencia-ok span {
    color: #5f6368;
}


/* =========================================================
   CUANDO EL MODAL ESTÁ ABIERTO
========================================================= */

body.incidencia-modal-abierto {
    overflow: hidden;
}


/* =========================================================
   MÓVIL
========================================================= */

@media (max-width: 600px) {

    /* -----------------------------------------------------
       Botón notificar
    ----------------------------------------------------- */

    .enlace-notificar-incidencia {
        left: 150px;

        bottom: 12px;

        min-height: 40px;

        padding: 0 8px;

        font-size: 12px;

        gap: 5px;
    }


    .enlace-notificar-incidencia .material-symbols-rounded {
        font-size: 18px;
    }


    /* -----------------------------------------------------
       Aviso selección
    ----------------------------------------------------- */

    .aviso-seleccionar-punto {
        top: 75px;

        left: 12px;

        width: calc(100vw - 24px);

        max-width: none;

        padding: 12px;
    }


    /* -----------------------------------------------------
       MODAL A PANTALLA COMPLETA
    ----------------------------------------------------- */

    .modal-incidencia {
        padding: 0;

        align-items: stretch;

        justify-content: stretch;
    }


    .modal-incidencia.visible {
        align-items: stretch;

        justify-content: stretch;
    }


    /* -----------------------------------------------------
       Ventana
       El diálogo NO hace scroll
    ----------------------------------------------------- */

    .modal-incidencia-dialog {
        display: flex;

        flex-direction: column;

        width: 100vw;

        height: 100dvh;

        max-width: none;

        max-height: 100dvh;

        border: 0;

        border-radius: 0;

        box-shadow: none;

        overflow: hidden;
    }


    /* -----------------------------------------------------
       Cabecera fija
    ----------------------------------------------------- */

    .modal-incidencia-header {
        position: relative;

        flex: 0 0 auto;

        min-height: 68px;

        padding: 16px 54px 16px 18px;

        background: #005A9C;
    }


    .modal-incidencia-header h2 {
        color: #ffffff;

        font-size: 19px;
    }


    .modal-incidencia-header p {
        color: rgba(255, 255, 255, .85);

        font-size: 13px;
    }


    /* -----------------------------------------------------
       Botón cerrar
    ----------------------------------------------------- */

    .modal-incidencia .modal-cerrar {
        top: 9px;

        right: 9px;

        width: 42px;

        height: 42px;

        font-size: 30px;
    }


    /* -----------------------------------------------------
       Cuerpo desplazable
    ----------------------------------------------------- */

    #form-incidencia {
        flex: 1 1 auto;

        min-height: 0;

        overflow-y: auto;

        padding:
            18px
            16px
            calc(24px + env(safe-area-inset-bottom));
    }


    /* -----------------------------------------------------
       Fieldset
    ----------------------------------------------------- */

    .incidencia-fieldset {
        margin-bottom: 20px;
    }


    /* -----------------------------------------------------
       Checkboxes
    ----------------------------------------------------- */

    .incidencia-checkbox {
        min-height: 44px;

        padding:
            9px
            4px;
    }


    .checkbox-text {
        font-size: 14px;
    }


    /* -----------------------------------------------------
       Descripción
    ----------------------------------------------------- */

    #incidencia-descripcion {
        min-height: 120px;

        font-size: 16px;
    }


    /* -----------------------------------------------------
       Fotografía
    ----------------------------------------------------- */

    .btn-fotografia {
        width: 100%;

        min-height: 44px;
    }


    /* -----------------------------------------------------
       Botones
       Se mantienen visibles al final del contenido
    ----------------------------------------------------- */

    .acciones-formulario {
        position: sticky;

        bottom: 0;

        z-index: 4;

        margin-left: -16px;

        margin-right: -16px;

        padding:
            12px
            16px
            calc(12px + env(safe-area-inset-bottom));

        background: rgba(255, 255, 255, .96);

        backdrop-filter: blur(6px);

        -webkit-backdrop-filter: blur(6px);
    }


    .acciones-formulario button {
        flex: 1;

        min-height: 46px;
    }


    /* -----------------------------------------------------
       Mensaje de éxito
    ----------------------------------------------------- */

    .mensaje-incidencia-ok {
        top: 70px;

        right: 12px;

        width: calc(100vw - 24px);

        max-width: none;
    }
}


/* =========================================================
   MÓVILES MUY PEQUEÑOS
========================================================= */

@media (max-width: 380px) {

    .enlace-notificar-incidencia {
        left: 200px;

        max-width: calc(100vw - 208px);

        overflow: hidden;

        white-space: nowrap;

        text-overflow: ellipsis;
    }


    .enlace-notificar-incidencia > span:last-child {
        overflow: hidden;

        text-overflow: ellipsis;

        white-space: nowrap;
    }


    /* -----------------------------------------------------
       Cabecera
    ----------------------------------------------------- */

    .modal-incidencia-header {
        padding:
            16px
            54px
            14px
            18px;
    }


    .modal-incidencia-header h2 {
        font-size: 18px;
    }


    .checkbox-text {
        font-size: 13px;
    }
}










.aviso-seleccionar-icono {
    width: 42px;
    height: 42px;
    min-width: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;
    background: #eff6ff;
    color: #2563eb;
}

.aviso-seleccionar-icono svg {
    display: block;
    width: 24px;
    height: 24px;
    stroke: currentColor;
}