/*Estilos generales
*/
body{
    font-family: 'Poppins', sans-serif;
}


/**Contenedor principal
*/
.container{
    max-width: 1000px;
    margin: 0 auto;
    border: 10px solid #51813A;
    padding: 0;
    border-radius: 5px;
}

/** Cuerpo opciones
*/

#cuerpo-opciones{
    padding: 30px;
}
    


/**
*Barra de navegacion
*/

nav{
    width: 100%;
    margin-bottom: 20px;
}

nav ul{
    width: 100%;
    display: flex;
}

.nav-item{
    
    flex: 1;
    text-align: center;
}

.nav-pills .nav-link.active {
    background-color: green;
    color: white;

    
}

.nav-pills .nav-link {
    background-color: white;
    color: #9BC886;
    border-radius: 0px;
    border: 2px solid #51813A;
}

/* UI6 - Ajuste visual de la pestaña larga "Créditos y fuentes" */
.nav-pills .nav-link[href$="creditos.html"] {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.29rem 0.35rem;
    font-size: 0.875rem;
    line-height: 1.1;
    text-align: center;
}



/***info ONG
*/
#info-ONG{
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-top: 10px;

}

#tlf, #email{
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-top: 10px;
}

#tlf img, #email img{
    width: 25px;
    height: 25px;
    margin: 0px 10px 0 0;
}

#email img{
    margin-left: 10px;
    width: 35px;
}

#tlf p, #email p{
    display: flex;
    align-items: center;
    margin-left: 20px;
    white-space: nowrap;
    font-size: 14px;
}

#tlf p{
    color: #51813A;
}

#email a{
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

#redes-sociales{
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: -4px;
    margin-left: 20px;
}


#redes-sociales a{
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

#redes-sociales .red-social-icono{
    height: 25px;
    width: auto;
    display: block;
    object-fit: contain;
}

#logo-AHC{
    width: 150px;
    height: 40px;
    margin-top: 10px;
}



.info-iconos{
    width: 20px;
    height: 20px;
}

/***Flechas
*/

#flechas{
    display: flex;
    flex-direction: row;
}


#flechas img{
    width: 50px;
    height: 50px;
    margin: 0 10px;
    
    
}

#flechas img.flecha-activa{
    cursor: pointer;
}

#flechas img.flecha-inactiva{
    cursor: default;
    opacity: 0.35;
    filter: grayscale(1);
}

#flechas img{
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: rgba(81, 129, 58, 0.18);
    border-radius: 12px;
    position: relative;
    z-index: 2;
}

#flechas img.flecha-activa:hover,
#flechas img.flecha-activa:focus{
    outline: 3px solid rgba(81, 129, 58, 0.25);
    outline-offset: 3px;
}


/***Logo 
*/

.logo img{
    width: 100px;
    height: auto;
    margin: 20px 0;
}

.logo{
    display: flex;
    justify-content: center;
}

/***Titulo
*/

h1{
    text-align: center;
    color: #9BC886;
    font-size: 40px;
}


/***Opciones
*/

#opciones{
    display: flex;
    flex-direction: row;
}

#opciones img{
    width: 60px;
    height: 60px;
    cursor: pointer;
    margin: 0 20px;
}
#opciones .boton-icono-superior {
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0 20px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
}

#opciones .boton-icono-superior img {
    margin: 0;
    display: block;
}

#opciones .boton-icono-superior:hover,
#opciones .boton-icono-superior:focus {
    outline: 3px solid rgba(81, 129, 58, 0.25);
    outline-offset: 4px;
}


/***Grupo abajo del menu
*/

#grupo-abajo{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

/**
*total de la seccion
*/
#contenedor-total{
    border: 2px solid #51813A;
    display: flex;
    flex-direction: row;
    border-radius: 5px;
    padding: 10px;
}

#contenedor-total div{
    margin: auto;
}

#total-seccion{
    color: #51813A;
}

/* Estilos para el botón calcular */
#calcular {
    display: block;
    margin: 20px auto 30px auto;
    padding: 10px 10px;
    font-size: 1.5em;
    font-weight: bold;
}


#total_parrafo{
    font-size: 1.3em;
    font-weight: bold;
    color: #070707;
}


/* Botones circulares de ayuda / información */
.btn-info-circle {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #51813A !important;
    border-color: #51813A !important;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1;
    text-transform: none;
}

.btn-info-circle:hover,
.btn-info-circle:focus {
    background-color: #436c30 !important;
    border-color: #436c30 !important;
    color: #ffffff !important;
}


/* Popovers no invasivos para ayudas de campo (D10b) */
.popover-ayuda-campo {
    position: fixed;
    z-index: 3000;
    max-width: min(340px, calc(100vw - 24px));
    background: #f7fbf4;
    border: 2px solid #51813A;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    color: #203018;
    padding: 0.85rem 2.25rem 0.85rem 1rem;
    font-size: 0.95rem;
    line-height: 1.45;
    text-align: left;
}

.popover-ayuda-campo::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 14px;
    height: 14px;
    background: #f7fbf4;
    border-left: 2px solid #51813A;
    border-top: 2px solid #51813A;
}

.popover-ayuda-campo--arriba::before {
    top: auto;
    bottom: -8px;
    border-left: 0;
    border-top: 0;
    border-right: 2px solid #51813A;
    border-bottom: 2px solid #51813A;
}

.popover-ayuda-campo__contenido {
    margin: 0;
}

.popover-ayuda-campo__cerrar {
    position: absolute;
    top: 0.35rem;
    right: 0.45rem;
    border: 0;
    background: transparent;
    color: #51813A;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.15rem 0.35rem;
    cursor: pointer;
}

.popover-ayuda-campo__cerrar:hover,
.popover-ayuda-campo__cerrar:focus {
    color: #304f21;
    outline: 2px solid rgba(81, 129, 58, 0.35);
    border-radius: 6px;
}


/* Botón y modal metodológica común "¿Cómo se calcula?" */
.bloque-como-calcula {
    max-width: 760px;
    margin: 0 auto 1.4rem auto;
    text-align: center;
}

.btn-como-calcula {
    border: 2px solid #51813A;
    background: #51813A;
    color: #ffffff;
    border-radius: 999px;
    padding: 0.65rem 1.25rem;
    font-weight: 700;
    cursor: pointer;
}

.btn-como-calcula:hover,
.btn-como-calcula:focus {
    background: #436c30;
    border-color: #436c30;
    color: #ffffff;
    outline: 3px solid rgba(81, 129, 58, 0.25);
}

.modal-explicacion-calculo[hidden] {
    display: none;
}

.modal-explicacion-calculo {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.45);
}

.modal-explicacion-calculo__contenido {
    position: relative;
    width: min(780px, 100%);
    max-height: min(86vh, 760px);
    overflow-y: auto;
    padding: 2rem;
    border: 3px solid #51813A;
    border-radius: 18px;
    background: #ffffff;
    color: #203018;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}

.modal-explicacion-calculo__contenido h2 {
    margin: 0 2.2rem 1rem 0;
    color: #51813A;
}

.modal-explicacion-calculo__contenido h3 {
    margin-top: 1.25rem;
    color: #315722;
    font-size: 1.15rem;
}

.modal-explicacion-calculo__contenido p,
.modal-explicacion-calculo__contenido li {
    line-height: 1.55;
}

.modal-explicacion-calculo__contenido code {
    color: #203018;
    background: #eef5ea;
    padding: 0.1rem 0.3rem;
    border-radius: 5px;
}

.modal-explicacion-calculo__cerrar {
    position: absolute;
    top: 0.8rem;
    right: 0.9rem;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: #51813A;
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.modal-explicacion-calculo__cerrar:hover,
.modal-explicacion-calculo__cerrar:focus {
    background: #436c30;
    outline: 3px solid rgba(81, 129, 58, 0.25);
}

.aviso-datos-generales-global{
    border: 2px solid #51813A;
    border-left-width: 8px;
    border-radius: 10px;
    background: #f4faf1;
    color: #234816;
    padding: 12px 16px;
    margin: 18px 0;
    font-weight: 600;
}

.aviso-datos-generales-global a{
    color: #234816;
    font-weight: 700;
    text-decoration: underline;
}


/* Avisos suaves de módulo: sustituyen confirmaciones invasivas en acciones explícitas o ceros reales. */
.aviso-suave-modulo{
    max-width: 760px;
    margin: 14px auto 10px auto;
    padding: 11px 14px;
    border: 2px solid #51813A;
    border-left-width: 7px;
    border-radius: 12px;
    background: #f4faf1;
    color: #234816;
    font-size: 0.95rem;
    line-height: 1.45;
    font-weight: 600;
}

.aviso-suave-modulo[hidden]{
    display: none;
}


.modal-info-general .modal-explicacion-calculo__contenido {
    max-width: 820px;
}

.modal-info-general strong {
    color: #315722;
}

/* MOB1/UI1 - Ajustes responsive globales para pantallas pequeñas */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .container {
        width: 100%;
        max-width: none;
        border-width: 0 0 6px 0;
        border-radius: 0;
    }

    #cuerpo-opciones {
        padding: 18px 16px;
    }

    #info-ONG {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 12px;
        padding: 0 10px;
        text-align: center;
    }

    #logo-AHC {
        width: 135px;
        height: auto;
        margin: 8px auto 0;
    }

    #tlf,
    #email {
        margin-top: 0;
    }

    #tlf p,
    #email p {
        margin: 0;
        white-space: normal;
        justify-content: center;
        font-size: 0.82rem;
        line-height: 1.35;
    }

    #email img {
        margin-left: 0;
    }

    #redes-sociales {
        width: 100%;
        justify-content: center;
        margin: 0 0 4px;
    }

    nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    nav ul {
        flex-wrap: nowrap;
        min-width: max-content;
    }

    .nav-item {
        flex: 0 0 auto;
    }

    .nav-pills .nav-link {
        padding: 0.55rem 0.72rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .nav-pills .nav-link[href$="creditos.html"] {
        padding: 0.55rem 0.72rem;
        font-size: 0.9rem;
        line-height: 1.5;
        white-space: nowrap;
    }

    #grupo-abajo {
        justify-content: center;
    }

    #flechas {
        justify-content: center;
        width: 100%;
    }

    #flechas img {
        width: 48px;
        height: 48px;
        margin: 0 10px;
        padding: 4px;
        box-sizing: content-box;
    }

    .logo img {
        width: 84px;
        margin: 14px 0;
    }

    h1 {
        font-size: 1.85rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }

    #opciones {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    #opciones img,
    #opciones .boton-icono-superior {
        margin: 0 8px;
    }

    #contenedor-total {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    #calcular {
        width: 100%;
        font-size: 1.15rem;
    }

    .btn-info-circle {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px;
    }

    .modal-explicacion-calculo__contenido {
        padding: 1.35rem;
        max-height: 88vh;
    }

    .modal-explicacion-calculo__contenido h2 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    #cuerpo-opciones {
        padding: 14px 12px;
    }

    h1 {
        font-size: 1.55rem;
    }

    .nav-pills .nav-link {
        padding: 0.5rem 0.62rem;
        font-size: 0.84rem;
    }

    .nav-pills .nav-link[href$="creditos.html"] {
        padding: 0.5rem 0.62rem;
        font-size: 0.84rem;
        line-height: 1.5;
        white-space: nowrap;
    }

    #tlf p,
    #email p {
        font-size: 0.78rem;
    }

    .popover-ayuda-campo {
        font-size: 0.88rem;
        max-width: calc(100vw - 18px);
    }
}

/* Apache/Fortress: fallback propio para la navegación superior.
   Evita depender de los estilos de Bootstrap para pintar las pestañas.
   Así, aunque el CSS externo/local de Bootstrap no se cargue por políticas del servidor,
   las etiquetas de módulos no aparecen como lista con viñetas. */
nav ul,
nav .nav,
nav .nav-pills {
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: stretch;
    margin: 0;
    padding: 0;
    list-style: none;
}

nav li,
nav .nav-item {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: center;
}

nav li::marker,
nav .nav-item::marker {
    content: "";
    font-size: 0;
}

nav a,
nav .nav-link,
nav .nav-pills .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 44px;
    box-sizing: border-box;
    margin: 0;
    padding: 0.42rem 0.45rem;
    border: 2px solid #51813A;
    border-left-width: 0;
    border-radius: 0;
    background-color: #ffffff;
    color: #6f9f5a;
    font-size: 0.95rem;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    white-space: normal;
}

nav li:first-child a,
nav .nav-item:first-child .nav-link {
    border-left-width: 2px;
}

nav a:hover,
nav a:focus,
nav .nav-link:hover,
nav .nav-link:focus {
    color: #51813A;
    text-decoration: none;
    outline: 3px solid rgba(81, 129, 58, 0.18);
    outline-offset: -3px;
}

nav a.active,
nav .nav-link.active,
nav .nav-pills .nav-link.active {
    background-color: green;
    color: #ffffff;
}

nav .nav-link[href$="creditos.html"],
nav .nav-pills .nav-link[href$="creditos.html"] {
    padding: 0.32rem 0.35rem;
    font-size: 0.88rem;
    line-height: 1.1;
}

@media (max-width: 768px) {
    nav ul,
    nav .nav,
    nav .nav-pills {
        min-width: max-content;
        flex-wrap: nowrap;
    }

    nav li,
    nav .nav-item {
        flex: 0 0 auto;
    }

    nav a,
    nav .nav-link,
    nav .nav-pills .nav-link {
        min-height: 42px;
        padding: 0.55rem 0.72rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    nav .nav-link[href$="creditos.html"],
    nav .nav-pills .nav-link[href$="creditos.html"] {
        padding: 0.55rem 0.72rem;
        font-size: 0.9rem;
        line-height: 1.35;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    nav a,
    nav .nav-link,
    nav .nav-pills .nav-link {
        padding: 0.5rem 0.62rem;
        font-size: 0.84rem;
    }

    nav .nav-link[href$="creditos.html"],
    nav .nav-pills .nav-link[href$="creditos.html"] {
        padding: 0.5rem 0.62rem;
        font-size: 0.84rem;
    }
}
