@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

html {
    width: 100%;
    height: 100dvh;
    overscroll-behavior: none; /* Previene scroll elástico / rubber-banding */
}

body {
    width: 100%;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff5f5;
    position: relative;
    padding: 15px;
}


/* =====================================================
   FONDOS DECORATIVOS AISLADOS
===================================================== */

.bg-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    z-index: 1;
    pointer-events: none; /* Evita bloquear clics del usuario */
}

.circle {
    position: absolute;
    border-radius: 50%;
}

.circle-left {
    width: 700px;
    height: 700px;
    background: linear-gradient(135deg, #d3133c, #ff184c);
    bottom: -350px;
    left: -250px;
}

.circle-right {
    width: 700px;
    height: 700px;
    background: linear-gradient(135deg, #f6a623, #ffb733);
    bottom: -350px;
    right: -250px;
}


/* =====================================================
   CONTENEDOR
===================================================== */

.container {
    position: relative;
    width: 900px;
    height: 550px;
    max-height: calc(100dvh - 30px);
    background: #fff;
    border-radius: 35px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    z-index: 10;
}


/* =====================================================
   FORMULARIOS
===================================================== */

.form-box {
    position: absolute;
    width: 50%;
    height: 100%;
    padding: 30px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: 0.7s ease;
}


/* =====================================================
   LOGO
===================================================== */

.logo {
    width: 72px;
    height: auto;
    display: block;
    margin: 0 auto 14px;
}


/* =====================================================
   TITULO Y DESCRIPCION
===================================================== */

h2 {
    text-align: center;
    margin-bottom: 18px;
    font-size: 28px;
    line-height: 1.2;
    color: #d3133c;
}

.description {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
    font-size: 14px;
}


/* =====================================================
   LOGIN Y RECUPERAR
===================================================== */

.login {
    left: 0;
    background: #fff;
}

.forgot {
    right: -100%;
    background: linear-gradient(135deg, #f6a623, #ffb733);
    color: #fff;
}

.forgot h2,
.forgot .description {
    color: #fff;
}


/* =====================================================
   INPUTS
===================================================== */

.input-box {
    width: 100%;
    height: 52px;
    margin-bottom: 13px;
    position: relative;
}

.input-box input {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    border-radius: 14px;
    background: #f5f5f5;
    padding-left: 50px;
    padding-right: 15px;
    font-size: 15px;
}

.forgot .input-box input {
    background: rgba(255, 255, 255, 0.9);
}

.input-box i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #d3133c;
    font-size: 17px;
}


/* =====================================================
   RECORDARME
===================================================== */

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    color: #666;
    font-size: 13px;
}

.remember input {
    cursor: pointer;
}


/* =====================================================
   BOTONES
===================================================== */

.btn {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s ease;
    color: #fff;
    background: linear-gradient(135deg, #d3133c, #ff184c);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    flex-shrink: 0;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.attendance-btn {
    margin-top: 9px;
    background: linear-gradient(135deg, #f6a623, #ffb733);
}

.attendance-btn:hover {
    box-shadow: 0 8px 20px rgba(246, 166, 35, 0.25);
}

.forgot .btn {
    background: linear-gradient(135deg, #ff7b00, #ff5e00);
}


/* =====================================================
   LINK INFERIOR
===================================================== */

.switch-text {
    text-align: center;
    margin-top: 14px;
    padding: 0;
    line-height: 1.4;
    font-size: 13px;
    flex-shrink: 0;
}

.switch-text a {
    text-decoration: none;
    font-weight: 500;
    color: #d3133c;
}

.switch-text a:hover {
    text-decoration: underline;
}

.forgot .switch-text a {
    color: #fff;
}


/* =====================================================
   ANIMACION
===================================================== */

.container.active .login {
    left: -100%;
}

.container.active .forgot {
    right: 0;
}


/* =====================================================
   TABLET (max-width: 950px)
===================================================== */

@media (max-width: 950px) {
    body {
        padding: 12px;
    }

    .container {
        width: 95vw;
        height: min(600px, calc(100dvh - 24px));
        max-height: calc(100dvh - 24px);
        min-height: 0;
        border-radius: 30px;
    }

    .form-box {
        padding: 28px 38px;
    }

    .logo {
        width: 68px;
        margin-bottom: 13px;
    }

    h2 {
        font-size: 26px;
        margin-bottom: 17px;
    }
}


/* =====================================================
   CELULAR (max-width: 600px)
===================================================== */

@media (max-width: 600px) {
    body {
        padding: 8px;
    }

    /* Reducción proporcional de círculos para evitar que tapen el responsive */
    .circle-left {
        width: 320px;
        height: 320px;
        bottom: -150px;
        left: -120px;
    }

    .circle-right {
        width: 320px;
        height: 320px;
        bottom: -150px;
        right: -120px;
    }

    .container {
        width: 100%;
        height: min(570px, 92dvh);
        max-height: 570px;
        min-height: 0;
        border-radius: 25px;
    }

    .form-box {
        width: 100%;
        height: 100%;
        padding: 22px 22px;
        justify-content: center;
    }

    .logo {
        width: 58px;
        margin: 0 auto 12px;
    }

    h2 {
        font-size: 23px;
        margin-bottom: 17px;
    }

    .input-box {
        height: 48px;
        margin-bottom: 11px;
    }

    .input-box input {
        font-size: 14px;
        padding-left: 46px;
    }

    .input-box i {
        left: 16px;
        font-size: 16px;
    }

    .remember {
        font-size: 12px;
        margin-bottom: 13px;
    }

    .btn {
        height: 46px;
        font-size: 14px;
    }

    .attendance-btn {
        margin-top: 8px;
    }

    .switch-text {
        margin-top: 12px;
        font-size: 12px;
    }
}


/* =====================================================
   CELULAR POCA ALTURA (max-height: 700px)
===================================================== */

@media (max-width: 600px) and (max-height: 700px) {
    .container {
        height: min(500px, 94dvh);
        max-height: 94dvh;
    }

    .form-box {
        padding: 15px 20px;
    }

    .logo {
        width: 48px;
        margin-bottom: 8px;
    }

    h2 {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .input-box {
        height: 42px;
        margin-bottom: 8px;
    }

    .input-box input {
        font-size: 13px;
        padding-left: 42px;
    }

    .input-box i {
        left: 14px;
        font-size: 14px;
    }

    .remember {
        margin-bottom: 9px;
        font-size: 11px;
    }

    .btn {
        height: 40px;
        font-size: 13px;
    }

    .attendance-btn {
        margin-top: 6px;
    }

    .switch-text {
        margin-top: 8px;
        font-size: 11px;
    }
}


/* =====================================================
   TELEFONO MUY PEQUEÑO (max-width: 380px)
===================================================== */

@media (max-width: 380px) and (max-height: 650px) {
    .container {
        height: 94dvh;
        max-height: 94dvh;
        border-radius: 20px;
    }

    .form-box {
        padding: 12px 17px;
    }

    .logo {
        width: 44px;
        margin-bottom: 6px;
    }

    h2 {
        font-size: 19px;
        margin-bottom: 10px;
    }

    .input-box {
        height: 39px;
        margin-bottom: 7px;
    }

    .remember {
        margin-bottom: 7px;
    }

    .btn {
        height: 38px;
        font-size: 12px;
    }

    .attendance-btn {
        margin-top: 5px;
    }

    .switch-text {
        margin-top: 7px;
        font-size: 10px;
    }
}