@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400..800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Baloo 2', sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(90deg, #740505, #2955e6);
}

.contianer {
    position: relative;
    width: 850px;
    height: 550px;
    background: #740505;
    border-radius: 30px;
    box-shadow: 0 0 30px rgba(0, 0, 0, .2);
    margin: 20px;
    overflow: hidden;
}

.form-box {
    position: absolute;
    right: 0;
    width: 50%;
    height: 100%;
    background: #740505;
    display: flex;
    align-items: center;
    color: #fff;
    text-align: center;
    padding: 40px;
    z-index: 1;
    transition: .6s ease-in-out 1.2s, visibility 0s 1s;
}

.contianer.active .form-box {
    right: 50%;
}

.form-box.register {
    visibility: hidden;
}

.contianer.active .form-box.register {
    visibility: visible;
}

form {
    width: 100%;
}

.contianer h1 {
    font-size: 36px;
    margin: -10px 0;
}

.input-box {
    position: relative;
    margin: 30px 0;
}

.input-box input {
    width: 100%;
    padding: 13px 50px 13px 20px;
    background: #eee;
    border-radius: 8px;
    border: none;
    outline: none;
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.input-box input::placeholder {
    color: #888;
    font-weight: 400;
}

.input-box i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #2955e6;
}

.forgot-link {
    margin: -15px 0 15px;
}

.forgot-link a {
    font-size: 14.5px;
    color: #fff;
    text-decoration: none;
}

.btn {
    width: 100%;
    height: 48px;
    background: #2955e6;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, .1);
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #fff;
    font-weight: 600;
}

.contianer p {
    font-size: 14.5px;
    margin: 15px 0;
}

.social-icons {
    display: flex;
    justify-content: center;
}

.social-icons a {
    display: inline-flex;
    padding: 10px;
    border: 2px solid #ccc;
    border-radius: 8px;
    font-size: 24px;
    color: #ffffff;
    text-decoration: none;
    margin: 0 8px;
}

.toggle-box {
    position: absolute;
    width: 100%;
    height: 100%;
}

.toggle-box::before {
    content: '';
    position: absolute;
    left: -250%;
    width: 300%;
    height: 100%;
    background: #2955e6;
    border-radius: 150px;
    z-index: 2;
    transition: 1.3s ease-in-out;
}

.contianer.active .toggle-box::before {
    left: 50%;
}

.toggle-panel {
    position: absolute;
    width: 50%;
    height: 100%;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
    transition: .6s ease-in-out;
}

.toggle-panel.toggle-left {
    left: 0;
    transition-delay: 1.2s;
}

.contianer.active .toggle-panel.toggle-left {
    left: -50%;
    transition-delay: .6s;
}

.toggle-panel.toggle-right {
    right: -50%;
    transition-delay: .6s;
}

.contianer.active .toggle-panel.toggle-right {
    right: 0;
    transition-delay: 1.2s;
}

.toggle-panel p {
    margin-bottom: 20px;
}

.toggle-panel .btn {
    width: 160px;
    height: 46px;
    border: 2px solid #fff;
    box-shadow: none;
}

@media screen and (max-width: 650px) {
    .contianer {
        height: calc(100vh - 40px);
    }

    .form-box {
        bottom: 0;
        width: 100%;
        height: 70%;
    }

    .contianer.active .form-box {
        right: 0;
        bottom: 30%;
    }

    .toggle-box::before {
        left: 0;
        top: -270%;
        width: 100%;
        height: 300%;
        border-radius: 20vw;
    }

    .contianer.active .toggle-box::before {
        left: 0;
        top: 70%;
    }

    .toggle-panel {
        width: 100%;
        height: 30%;
    }

    .toggle-panel.toggle-left {
        top: 0;
    }

    .contianer.active .toggle-panel.toggle-left {
        left: 0;
        top: -30%;
    }

    .toggle-panel.toggle-right {
        right: 0;
        bottom: -30%;
    }

    .contianer.active .toggle-panel.toggle-right {
        bottom: 0;
    }
}

@media screen and (max-width: 400px) {
    .form-box {
        padding: 20px;
    }

    .toggle-panel h1 {
        font-size: 30px;
    }
}

/* ==========================================
   AJUSTES AL CONTENEDOR PRINCIPAL
   AGREGAR AL FINAL DE css/style.css
   ========================================== */

/* Aumentar altura del contenedor para evitar cortes */
.contianer {
    position: relative;
    width: 850px;
    height: 600px;
    /* Aumentado de 550px a 600px */
    background: #740505;
    border-radius: 30px;
    box-shadow: 0 0 30px rgba(0, 0, 0, .2);
    margin: 20px;
    overflow: hidden;
}

/* Ajustar padding del formulario de registro para más espacio */
.form-box.register {
    padding: 30px 40px;
    /* Reducido padding vertical */
}

/* Reducir margen del título en registro */
.form-box.register h1 {
    margin: -5px 0 15px 0;
    /* Menos espacio arriba y abajo */
}

/* Reducir margen de los input-box en registro */
.form-box.register .input-box {
    margin: 20px 0;
    /* Reducido de 30px */
}

/* Reducir margen del botón en registro */
.form-box.register .btn {
    margin-top: 15px;
    /* Menos espacio arriba del botón */
}

/* Reducir margen del párrafo en registro */
.form-box.register p {
    margin: 10px 0;
    /* Menos espacio */
}

/* ==========================================
   ESTILOS MEJORADOS PARA SELECT
   Hacer que se vean como los demás inputs
   ========================================== */

.input-box select {
    width: 100%;
    padding: 13px 50px 13px 20px;
    background: #eee;
    border-radius: 8px;
    border: none;
    outline: none;
    font-size: 16px;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    /* Estilos para quitar la flecha por defecto del navegador */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Agregar una flecha personalizada */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232955e6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 20px;
}

.input-box select:focus {
    box-shadow: 0 0 10px rgba(41, 85, 230, 0.3);
}

/* Color del placeholder en select */
.input-box select option:first-child {
    color: #888;
}

.input-box select:invalid {
    color: #888;
}

.input-box select:valid {
    color: #333;
}

/* Animación suave cuando aparece el selector de nivel */
#box-nivel {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive - Ajustes para móvil */
@media screen and (max-width: 650px) {
    .contianer {
        height: calc(100vh - 40px);
        width: calc(100% - 20px);
        /* Small margin to show gradient */
        margin: 20px 10px;
        border-radius: 20px;
        box-shadow: 0 0 30px rgba(0, 0, 0, .2);
        overflow-x: hidden;
    }

    .form-box {
        padding: 20px 15px;
        width: 100%;
    }

    .form-box.register {
        padding: 20px 15px;
        height: 70%;
        overflow-y: auto;
    }

    .form-box.register h1 {
        font-size: 24px;
        word-wrap: break-word;
    }

    .form-box.register .input-box {
        margin: 15px 0;
        width: 100%;
    }

    .input-box input,
    .input-box select {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 13px 40px 13px 15px !important;
    }
}

@media screen and (max-width: 400px) {

    .form-box,
    .form-box.register {
        padding: 15px 10px;
    }

    .form-box.register h1 {
        font-size: 22px;
        margin: 0 0 15px 0;
    }

    .input-box input,
    .input-box select {
        font-size: 14px;
        padding: 12px 30px 12px 10px !important;
    }
}