/* =========================================
   1. VARIABLES Y FUENTES
   ========================================= */
:root {
    --fema-principal: #ffffffbb;
    --fema-principal-transparente: #ffffff80;
    ;
    --fema-blanco: #ffffff;
    --fema-gris-claro: #b4b4b4;
    --fema-negro: #000000;
    --fema-gris: #83807f;
    --fema-rojo: #ad0f0f;
    --fema-guindo: #28070b;
    --fema-focus: 0 0 0 .25rem rgba(173, 15, 15, 0.25);
    --transition-fast: 0.3s ease;
}

@font-face {
    font-family: 'Calibri';
    src: url('../fonts/Calibri.woff2') format('woff2'), url('../fonts/Calibri.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OpenSans-Regular';
    src: url('../fonts/OpenSans-Regular.woff2') format('woff2'), url('../fonts/OpenSans-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Oswald-Bold';
    src: url('../fonts/Oswald-Bold.woff2') format('woff2'), url('../fonts/Oswald-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TitilliumWeb-Regular';
    src: url('../fonts/TitilliumWeb-Regular.woff2') format('woff2'), url('../fonts/TitilliumWeb-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TitilliumWeb-SemiBold';
    src: url('../fonts/TitilliumWeb-SemiBold.woff2') format('woff2'), url('../fonts/TitilliumWeb-SemiBold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TitilliumWeb-Bold';
    src: url('../fonts/TitilliumWeb-Bold.woff2') format('woff2'), url('../fonts/TitilliumWeb-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* =========================================
   2. ESTILOS BASE
   ========================================= */

html {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: url('../resources/fondo_fema.webp') center/cover no-repeat fixed;
    color: var(--fema-blanco);
    font-family: Calibri, "Segoe UI", Candara, Arial, sans-serif;
    overflow-x: hidden;
}

/* =========================================
   3. COMPONENTES GLOBALES
   ========================================= */
.btn-fema {
    color: #fff;
    background-color: var(--fema-rojo);
    border: 2px solid transparent;
    border-radius: 0;
    transition: var(--transition-fast);
    cursor: pointer;
}

    .btn-fema:hover {
        background-color: var(--fema-rojo);
        border-color: var(--fema-gris);
    }

    .btn:hover, .btn-idioma:hover {
        color: #fff;
        background-color: var(--fema-rojo);
        border-color: var(--fema-gris);
        transform: scale(1.04);
    }

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-thumb {
    background-color: gray;
    border-radius: 4px;
}

::-webkit-scrollbar-button, ::-webkit-scrollbar-corner, ::-webkit-scrollbar-resizer {
    display: none;
}

/* =========================================
   4. LAYOUT (HEADER, MAIN, FOOTER)
   ========================================= */
header, footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    width: 100%;
    /*background: linear-gradient(90deg, var(--fema-principal-transparente), #ffffff55);*/
    background: var(--fema-principal-transparente);
    color: var(--fema-negro);
}

header {
    height: 80px;
    font-size: 1rem;
    z-index: 3;
}

    header .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 0 15px;
    }

    header .izq {
        width: 40%;
    }

        header .izq img {
            max-height: 60px;
        }

    header .der {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        width: 60%;
        gap: 10px;
    }

    header .portal {
        display: flex;
        align-items: center;
        gap: 6px;
    }

        header .portal a {
            padding: 5px 10px;
            text-decoration: none;
            color: var(--fema-negro);
            border: 2px solid transparent;
            border-radius: 50px;
            transition: var(--transition-fast);
        }

            header .portal a:hover {
                color: var(--fema-blanco);
                background-color: var(--fema-rojo);
                border-color: var(--fema-gris);
            }

    header .der button {
        border-radius: 50px;
        padding: 5px 15px;
        font-family: 'TitilliumWeb-SemiBold', sans-serif;
        background-color: var(--fema-rojo);
        color: var(--fema-blanco);
        border: 2px solid transparent;
    }

        header .der button:focus {
            box-shadow: 0 0 0 2px var(--fema-principal);
        }

        header .der button:hover {
            transform: scale(1.04);
        }

    .fi {
        display: none;
    }

/* Sección Principal */
main.principal {
    display: flex;
    align-items: center;
    width: 100%;
    flex: 1 0 auto;
    font-size: 12px;
}

    main.principal .container > div {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-around;
        gap: 1rem;
        width: 100%;
    }

.bienvenida {
    max-width: 800px;
    flex: 1 1 400px;
    padding: 1rem;
}

    .bienvenida h1 {
        font-family: 'TitilliumWeb-SemiBold', Arial, sans-serif;
        font-size: clamp(2rem, 4vw, 3.8rem);
        line-height: 1.1;
        margin-bottom: 1rem;
    }

        .bienvenida h1 span {
            font-family: 'TitilliumWeb-Bold', Arial, sans-serif;
        }

    .bienvenida p {
        font-family: 'TitilliumWeb-Regular', Arial, sans-serif;
        font-size: clamp(1.1rem, 1.5vw, 1.5rem);
    }

/* Formulario */
.formulario {
    max-width: 400px;
    width: 100%;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.10);
    outline-color: unset;
}

.formulario p {
    margin: 0;
}

.formulario p:first-child {
    text-align: center;
}

/* Footer */
footer {
    height: 90px;
    font-family: 'OpenSans-Regular', Arial, sans-serif;
    font-size: 10px;
}

    footer .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 0 15px;
    }

    footer .politicas a {
        text-decoration: none;
        color: var(--fema-negro);
        transition: all 0.5s ease;
    }

        footer .politicas a:hover {
            color: var(--fema-rojo);
            transform: translateZ(0);
        }

    footer .certificaciones {
        display: flex;
        gap: 15px;
        align-items: center;
    }

        footer .certificaciones img:hover {
            transform: scale(1.1);
        }

/* Alerts */
.div-alert {
    display: flex;
    justify-content: center;
    top: 80px;
    position: absolute;
    width: 100%;
    z-index: 10;
}

/* =========================================
   5. FORM FLOATING CUSTOMS
   ========================================= */
.form-floating > label {
    padding: .8rem .4rem;
}

.form-floating > .form-control,
.form-floating > .form-select {
    color: #fff;
    background-color: #181818aa;
    border-radius: 0;
    height: calc(2.6rem + 2px);
    border: 1px solid var(--fema-gris);
}

.form-floating > .form-select {
    height: calc(2.8rem + 2px);
}

.form-floating > textarea.form-control {
    height: 90px;
    resize: none;
}

.form-floating > .form-select {
    padding-top: 1rem;
    padding-bottom: .625rem;
}

.form-floating > .form-control:focus,
.form-floating > .form-control:not(:placeholder-shown) {
    padding-top: 1.2rem;
    padding-bottom: .625rem;
}

.form-floating > .form-control:focus,
.form-floating > .form-select:focus {
    border-color: var(--fema-rojo);
    box-shadow: var(--fema-focus);
    background-color: #181818;
}

/* =========================================
   6. MEDIA QUERIES (RESPONSIVE)
   ========================================= */

@media screen and (min-height: 762px){
    .formulario {
        gap: 10px;
    }
}

/* Desktop Small / Tablets Large */
@media screen and (max-width: 1199px) {
    .bienvenida h1 {
        font-size: 45px;
    }

    .bienvenida p {
        font-size: 15px;
    }
}

/* Tablets */
@media screen and (max-width: 1024px) {
    .bienvenida h1 {
        font-size: 32px;
    }

    .bienvenida p {
        font-size: 20px;
    }

    footer .container .izq {
        display: flex;
        flex-direction: column;
    }
}

@media screen and (max-width: 991px){
    header {
        font-size: .75rem;
    }

    header form .btn-idioma {
        font-size: .75rem;
    }

    footer .container .izq {
        width: 40%;
    }
}

/* Mobile Large */
@media screen and (max-width: 768px) {
    header .izq img {
        height: 40px;
    }

    header .der {
        gap: 5px;
    }

    header .portal span {
        font-size: 8px;
    }

    header .portal a {
        font-size: 12px;
        padding: 4px 8px;
    }

    main.principal .container > div {
        flex-direction: column;
        margin: 1rem;
        gap: .5rem;
    }

    .bienvenida {
        flex: auto;
        max-width: 400px;
        padding: .5rem;
    }

    .bienvenida h1 {
        margin: 0;
        padding-bottom: .2rem;
        font-size: 22px;
    }

    .bienvenida p {
        margin: 0;
        font-size: 12px;
    }

    .formulario {
        width: 95%;
    }

    footer .container {
        gap: 10px;
    }
}

/* Mobile Small */
@media screen and (max-width: 555px) {

    footer {
        height: auto;
        
    }

    footer .container {
        display: flex;
        flex-direction: column-reverse;
        align-items: center;
        margin: 10px;
    }

    footer .container .izq {
        display: block;
        width: 100%;
        text-align: center;
    }

    footer .container .certificaciones {
        flex-direction: column;
        gap: 10px;
    }

    footer .container .certificaciones img{
        width: 200px;
        height: auto;
        max-height: 100px;
        object-fit: contain;
        margin: 20px;
    }
}

@media screen and (max-width: 510px) {

    header {
        height: 50px;
    }

    header .portal span {
        display: none;
    }

}

@media screen and (max-width: 425px) {
    header .izq img {
        width: 90px;
    }

    header .der {
        flex-direction: row;
        align-items: flex-end;
        font-size: 10px;
    }


    header form button {
        background-color: transparent;
    }

    header form button:hover {
        background-color: var(--fema-rojo);
    }

    header form button .spnIdioma {
        display: none;
    }

    main.principal .container div {
        margin: 0;
    }

    .fi {
        display: block;
        line-height: unset;
    }
}
