body {
    background: linear-gradient(-45deg, #008CBA, #16b5eb, #006f94, #003d50);
    background-size: 400% 400%;
    animation: gradientBG 12s ease infinite;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    padding: 20px 0;
    box-sizing: border-box;
}

.password-forgot a {
    color: #006f94;
    text-decoration: none;
}

.password-forgot a:hover {
    text-decoration: underline;
}

@keyframes gradientBG {
    0% {background-position: 0% 50%;}
    50% {background-position: 100% 50%;}
    100% {background-position: 0% 50%;}
}

@media (max-width: 768px) {
    .password-forgot {
        margin-left: 43%;
        margin-bottom: 30px;
        margin-top: -25px;
        text-align: center;
        font-size: 16px;
        color: black;
    }

}

@media (max-height: 550px) and (orientation: landscape) {
    body {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
    }

    .logotype {
        margin-right: 10px;
        flex: 1;
    }

    .formulario {
        flex: 1;
        margin-right: 20px;
    }

    .PadelEnebrales {
        width: 30%;
    }
}

@media (min-width: 1024px) {
    body {
        background-image: url("../imagenes/padel_background.jpg");
        background-size: cover;
        background-position: center;
        background-attachment: fixed;
        animation: none;
        flex-direction: row;
        justify-content: space-evenly;
        align-items: center;
        padding: 0 50px;
        overflow: hidden;
    }

    .logotype {
        margin-bottom: 0;
        text-align: left;
        align-items: flex-start;
        max-width: 450px;
        background: rgba(0, 0, 0, 0.4);
        padding: 30px;
        border-radius: 15px;
        backdrop-filter: blur(5px);
    }

    .PadelEnebrales {
        max-width: 250px;
        margin-bottom: 15px;
    }

    .eslogan {
        font-size: 1.3rem;
        color: white;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    }

    .formulario {
        width: 380px;
        background: rgba(250, 250, 250, 0.95);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
        border: none;
    }

    .password-forgot {
        margin-left: 50%;
        margin-bottom: 30px;
        margin-top: -25px;
        text-align: center;
        font-size: 16px;
        color: black;
    }
}

.logotype {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.PadelEnebrales {
    width: 50%;
    max-width: 200px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.eslogan {
    color: white;
    font-size: 1.1rem;
    font-weight: 300;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.3);
    font-style: italic;
    margin-top: 4px;
    margin-bottom: 10px;
    line-height: 1.4;
    max-width: 250px;
}

.formulario {
    position: relative;
    width: 90%;
    max-width: 400px;
    background: rgba(250, 250, 250, 0.98);
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.formulario h1 {
    text-align: center;
    padding: 0 0 20px 0;
    border-bottom: 1px solid silver;
}

.google-logging {
    margin-bottom: 20px;
}

.divisor {
    position: relative;
    margin: 20px 0;
    text-align: center;
}

.divisor hr {
    border: 0;
    border-top: 1px solid #adadad;
    margin: 0;
}

.divisor span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fafafa;
    padding: 0 10px;
    color: #000000;
    font-size: 14px;
    font-weight: bold;
    text-transform: lowercase;
}

.formulario form {
    padding: 0 40px;
    box-sizing: border-box;
}

form .logging {
    position: relative;
    border-bottom: 2px solid #adadad;
    margin: 30px 0;
}

.logging input {
    width: 100%;
    padding: 0 5px;
    height: 40px;
    font-size: 16px;
    border: none;
    background: none;
    outline: none;
}

.logging label {
    position: absolute;
    top: 50%;
    left: 5px;
    color: #adadad;
    transform: translateY(-50%);
    font-size: 16px;
    pointer-events: none;
    transition: .5s;
}

.logging span::before {
    content: '';
    position: absolute;
    top: 40px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #008CBA;
    transition: .5s;
}

.logging input:focus ~ label,
.logging input:not(:placeholder-shown) + label {
    top: -5px;
    color: #008CBA;
    font-weight: bold;
}

.logging input:focus ~ span::before,
.logging input:focus ~ span::before{
    width: 100%;
}

input[type="submit"]{
    width: 100%;
    height: 50px;
    border: none;
    transition: background 0.3s ease;
    background: #008CBA;
    border-radius: 25px;
    font-size: 18px;
    color: white;
    cursor: pointer;
    outline: none;
    margin-bottom: 20px;
}

input[type="submit"]:hover {
    background: #005f6b;
    transition: .5s;
}

.sign-up {
    margin-bottom: 25px;
    text-align: center;
    font-size: 16px;
    color: black;
}

.sign-up a {
    text-decoration: none;
    color: #008CBA;
}

.sign-up a:hover {
    color: #005f6b;
    text-decoration: underline;
    transition: .5s;
}

/* ==========================================================================
   Estilos para el Selector de Casas (#casa)
   ========================================================================== */

/* 1. Homogeneizar el select con los inputs del formulario */
#casa {
    width: 100%;
    height: 40px;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    border: none;
    background: transparent;
    outline: none;
    color: #333;
    cursor: pointer;
    padding: 0 5px;

    /* Oculta la flecha por defecto del navegador (crucial para el diseño) */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* 2. Crear una flecha personalizada utilizando el contenedor #casas */
#casas {
    position: relative;
}

#casa:hover {
    transform: translateY(-5%);
    transition: 0.3s;
}

#casas::after {
    content: '▼';
    font-size: 11px;
    color: #008CBA; /* Usamos el color corporativo de tu botón */
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none; /* Permite que el click pase a través de la flecha y abra el menú */
    transition: color 0.3s ease;
}

/* Cambia el color de la flecha al enfocar el elemento */
#casa:focus + #casas::after {
    color: #005f6b;
}

/* 3. Estilizar los grupos (optgroup) y las opciones desplegables */
#casa optgroup {
    font-weight: bold;
    color: #008CBA;
    background-color: #fafafa; /* Fondo que hace juego con tu contenedor */
    padding: 8px 5px;
}

#casa option {
    color: #333;
    background-color: #ffffff;
    padding: 10px;
    font-weight: normal;
}

/* Estilo para cuando la opción por defecto está seleccionada (color más tenue) */
#casa:invalid,
#casa option[value="default"] {
    color: #adadad;
}



.desplegables {
    min-width: 15em;
    position: relative;
    margin: 10px auto;
    width: 90%;
}

.desplegables * {
    box-sizing: border-box;
}

.select {
    background: #008CBA;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px #005f6b solid;
    border-radius: 0.5em;
    padding: 1em;
    cursor: pointer;
    transition: background 0.3s;
}

.select-clicked {
    border: 2px #26489a solid;
    box-shadow: 0 0 0.8em #26489a;
}

.select:hover {
    background: #005f6b;
}

.caret {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #fff;
    transition: 0.3s;
}

.caret-rotate {
    transform: rotate(180deg);
}

.menu {
    list-style: none;
    padding: 0.2em 0.5em;
    background: #4c4f55;
    border: 1px #363a43 solid;
    box-shadow: 0 0.5em 1em rgba(0, 0, 0, 0.2);
    border-radius: 0.5em;
    color: #9fa5b5;
    position: absolute;
    top: 3em;
    left: 50%;
    width: 100%;
    transform: translateX(-50%);
    opacity: 0;
    display: none;
    transition: 0.2s;
    z-index: 1;
    max-height: 240px;
    overflow-y: auto;
}

/* Personalización del scrollbar para el menú de casas */
.menu::-webkit-scrollbar {
    width: 8px;
}

.menu::-webkit-scrollbar-track {
    background: #363a43;
    border-radius: 0 0.5em 0.5em 0;
}

.menu::-webkit-scrollbar-thumb {
    background: #008CBA; /* El color verde de tu tema */
    border-radius: 4px;
}

.menu::-webkit-scrollbar-thumb:hover {
    background: #005f6b;
}

.menu li {
    padding: 0.7em 0.5em;
    margin: 0.3em 0;
    border-radius: 0.5em;
    cursor: pointer;
}

.menu li:hover {
    background: #2a2d35;
}

.active {
    background: #23242a;
}

.menu-open {
    display: block;
    opacity: 1;
}

.menu .grupo-titulo {
    font-weight: bold;
    color: #008CBA;
    background: transparent;
    padding: 0.5em 0.3em;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #555;
    cursor: default;
    pointer-events: none;
}
