@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    width: 100%;
    min-height: 100vh;
    font-family: 'DM Sans', sans-serif;
    background: linear-gradient(120deg, rgb(78, 223, 133) 0%, rgb(46, 168, 98) 42%, rgba(239, 239, 240, 0.92) 42%, #e8edf0 100%);
    background-size: 160% 160%;
    animation: fondo-desplaza 16s ease-in-out infinite;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    padding: 24px 16px;
    position: relative;
}

.fondo {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.orbita {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.35;
}

.orbita-1 {
    width: 220px;
    height: 220px;
    left: 8%;
    top: 12%;
    background: rgba(255, 255, 255, 0.35);
    animation: flotar 11s ease-in-out infinite;
}

.orbita-2 {
    width: 160px;
    height: 160px;
    right: 12%;
    bottom: 14%;
    background: rgba(4, 50, 78, 0.25);
    animation: flotar 14s ease-in-out infinite reverse;
}

.orbita-3 {
    width: 90px;
    height: 90px;
    right: 28%;
    top: 18%;
    background: rgba(78, 223, 133, 0.45);
    animation: flotar 9s ease-in-out infinite 1s;
}

.contenedor {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: stretch;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    border-radius: 20px;
    width: min(1100px, 100%);
    min-height: 500px;
    overflow: hidden;
    animation: entrar 0.75s ease both;
}

.cimagen {
    flex: 1 1 50%;
    min-width: 0;
    height: auto;
    overflow: hidden;
}

.imagen {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 500px;
    object-fit: cover;
    object-position: center;
    animation: kenburns 18s ease-in-out infinite;
}

.cformulario {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px 40px;
    gap: 28px;
    background-color: #04324eb6;
    backdrop-filter: blur(6px);
}

.formulario {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: min(350px, 100%);
}

.formulario input {
    width: 100%;
    height: 40px;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.7);
    color: white;
    font-size: 17px;
    font-family: inherit;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.formulario input::placeholder {
    color: white;
    font-size: 17px;
    letter-spacing: 3px;
    font-weight: 300;
}

.formulario input:focus {
    outline: none;
    border-bottom-color: rgb(78, 223, 133);
    transform: translateY(-2px);
    box-shadow: 0 4px 0 0 rgba(78, 223, 133, 0.25);
}

.formulario .campo:nth-child(1),
.formulario input:nth-of-type(1) {
    animation: subir 0.55s ease 0.15s both;
}

.formulario .campo:nth-child(2),
.formulario input:nth-of-type(2) {
    animation: subir 0.55s ease 0.28s both;
}

.alerta {
    width: min(350px, 100%);
    margin: 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(180, 35, 35, 0.88);
    color: #fff;
    font-size: 14px;
    animation: subir 0.45s ease both;
}

.cbotones {
    display: flex;
    gap: 16px;
    width: min(350px, 100%);
    justify-content: center;
}

.botones {
    color: white;
    background-color: transparent;
    border: solid 1px white;
    font-size: 17px;
    letter-spacing: 1px;
    padding: 9px 32px;
    cursor: pointer;
    border-radius: 5px;
    font-family: inherit;
    transition: color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    animation: subir 0.55s ease 0.4s both;
}

.botones:hover,
.botones:focus {
    color: rgb(84, 84, 84);
    background-color: white;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.botones:active {
    transform: translateY(0);
}

.restablecer {
    cursor: pointer;
    margin: 0;
    color: white;
    text-decoration: none;
    letter-spacing: 0.4px;
    transition: color 0.25s ease, transform 0.25s ease;
    animation: subir 0.55s ease 0.5s both;
}

.restablecer:hover,
.restablecer:focus {
    color: rgb(78, 223, 133);
    transform: translateY(-1px);
}

.imagen2 {
    display: flex;
    justify-content: center;
    width: min(280px, 80%);
    animation: subir 0.7s ease 0.6s both;
}

.logo {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.25));
}

@keyframes fondo-desplaza {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes flotar {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(18px, -22px); }
}

@keyframes entrar {
    from {
        opacity: 0;
        transform: translateY(28px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes subir {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes kenburns {
    0% { transform: scale(1) translate(0, 0); }
    50% { transform: scale(1.08) translate(-1.5%, -1%); }
    100% { transform: scale(1) translate(0, 0); }
}

@media (max-width: 900px) {
    body {
        background: linear-gradient(180deg, rgb(78, 223, 133) 0%, rgb(46, 168, 98) 28%, #04324e 70%);
        align-items: flex-start;
        padding: 20px 12px 32px;
    }

    .contenedor {
        flex-direction: column;
        width: min(460px, 100%);
        min-height: 0;
    }

    .cimagen {
        flex: 0 0 auto;
        width: 100%;
        height: 168px;
    }

    .imagen {
        min-height: 168px;
        height: 168px;
    }

    .cformulario {
        width: 100%;
        padding: 32px 22px 36px;
        gap: 22px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px 8px 24px;
    }

    .cimagen {
        height: 132px;
    }

    .imagen {
        min-height: 132px;
        height: 132px;
    }

    .cformulario {
        padding: 28px 16px 32px;
        gap: 20px;
    }

    .formulario input,
    .formulario input::placeholder {
        font-size: 16px;
    }

    .formulario input::placeholder {
        letter-spacing: 1.5px;
    }

    .botones {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .imagen {
        transform: none;
    }
}
