body {
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    font-family: 'inter', 'arial';
    overflow: hidden;
    background: #F8FAFC;
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(26, 63, 216, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 63, 216, .04) 1px, transparent 1px);
    background-size: 32px 32px;
}

/* contenedor de la izquierda-contiene el login */
.cont1 {
    width: 45%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cont2 {
    /* contenedor de la derecha fondo azul */
    height: 100%;
    width: 55%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* background: linear-gradient(150deg, #0d114e, #202BBA);
    border-top-right-radius: 32%;
    border-bottom-right-radius: 60%; */
    /*  border-bottom-left-radius: 22rem; */
    margin-left: -10%;
    margin-top: -9%;
    position: relative;
}

.blob {
    width: 400px;
    height: 400px;
    top: 35rem;
    left: -5rem;
    position: absolute;
    background: radial-gradient(circle at 38% 38%, #2055e8, #0f2fa0 60%, #081d6b);
    box-shadow:
        inset -20px -20px 40px rgba(0, 0, 0, 0.28),
        inset 10px 10px 30px rgba(100, 140, 255, 0.18);
    animation: float1 7s ease-in-out infinite;
    border-radius: 50%;
}

.blob-2 {
    width: 250px;
    height: 250px;
    top: 36rem;
    left: 35rem;
    position: absolute;
    background: radial-gradient(circle at 38% 38%, #2055e8, #0f2fa0 60%, #081d6b);
    box-shadow:
        inset -20px -20px 40px rgba(0, 0, 0, 0.28),
        inset 10px 10px 30px rgba(100, 140, 255, 0.18);
    animation: float1 7s ease-in-out infinite;
    border-radius: 50%;
}

.blop-3 {
    width: 200px;
    height: 200px;
    top: 49rem;
    left: 94rem;
    position: absolute;
    background: radial-gradient(circle at 38% 38%, #2055e8, #0f2fa0 60%, #081d6b);
    box-shadow:
        inset -20px -20px 40px rgba(0, 0, 0, 0.28),
        inset 10px 10px 30px rgba(100, 140, 255, 0.18);
    /* animation: float1 7s ease-in-out infinite; */
    border-radius: 50%;
}

@keyframes float1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1)
    }

    50% {
        transform: translate(12px, 18px) scale(1.03)
    }
}

.video {
    position: relative;
    width: 100%;
}

/* texto dentro del video azul */
.section {
    /* blob grande que contiene texto a la izquierda */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: red;
    width: 100%;
    height: 50rem;
    background: radial-gradient(circle at 38% 38%, #2055e8, #0f2fa0 60%, #081d6b);
    box-shadow:
        inset -20px -20px 40px rgba(0, 0, 0, 0.28),
        inset 10px 10px 30px rgba(100, 140, 255, 0.18);
    border-radius: 50%;
}

.title3 {
    /* titulo de pedidos en el cuadro de la derecha fondo azul */
    font-family: 'italic';
    font-weight: bold;
    font-style: italic;
    font-size: 7rem;
    letter-spacing: -3px;
    color: rgba(255, 255, 255, 0.275);
    margin-bottom: -45px;
    text-align: center;
}

.title2 {
    font-family: 'italic';
    font-weight: bold;
    font-size: 8rem;
    letter-spacing: -1px;
    color: white;
    top: -3rem;
    margin-top: 0px;
    text-align: center;
}

/* titulo que hay primero sobre el fondo azul del login */
.sistema {
    width: 60%;
    z-index: 3;
    margin-top: 11rem;
}

/* ── card-login ── */
.card-login {
    /* glassmorphism style better for both but subtle for desktop */
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    
    display: flex;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border-radius: 1.25rem;
    width: 70%;
    height: auto;
    padding: 2.2rem 0 0 0;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

/* ── Borde rojo ── */
.card-login.border-error {
    border-color: #e74c3c;
    box-shadow: -2px 17px 26px -4px rgba(0, 0, 0, 0.29),
        0 0 0 3px rgba(231, 76, 60, 0.18);
    animation: borderPulseRed 1.8s ease forwards;
}

@keyframes borderPulseRed {
    0% {
        border-color: #e74c3c;
        box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.25);
    }

    60% {
        border-color: #e74c3c;
        box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.12);
    }

    100% {
        border-color: transparent;
        box-shadow: -2px 17px 26px -4px rgba(0, 0, 0, 0.29);
    }
}

/* ── Borde verde ── */
.card-login.border-ok {
    border-color: #27ae60;
    box-shadow: -2px 17px 26px -4px rgba(0, 0, 0, 0.29),
        0 0 0 3px rgba(39, 174, 96, 0.18);
}

/* ── Shake ── */
.card-login.shake {
    animation: shakeCard 0.55s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shakeCard {

    0%,
    100% {
        transform: translateX(0);
    }

    15% {
        transform: translateX(-7px) rotate(-0.4deg);
    }

    30% {
        transform: translateX(6px) rotate(0.3deg);
    }

    45% {
        transform: translateX(-5px) rotate(-0.2deg);
    }

    60% {
        transform: translateX(4px) rotate(0.2deg);
    }

    75% {
        transform: translateX(-2px);
    }

    90% {
        transform: translateX(2px);
    }
}

/* ── Barra de estado (top del card) ── */
.status-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    width: 0%;
    background: #e74c3c;
    border-radius: 0 4px 4px 0;
    opacity: 0;
    transition: width 0.55s cubic-bezier(.4, 0, .2, 1),
        background 0.4s ease,
        opacity 0.3s ease;
    z-index: 10;
}

/* ── head ── */
.head {
    width: 100%;
    text-align: center;
    display: flex;
    align-items: center;
    flex-direction: column;
    padding-bottom: 0.5rem;
}

/* ── card (ícono del camión) ── */
.card {
    background: #E8F3FE;
    padding: 0.7rem;
    border-radius: 0.5rem;
}


.icon {
    padding: 0.9rem;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #4A80FF 0%, #1A3FD8 100%);
    height: 30px;
    transition: all ease 0.3s;
    display: flex;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(74, 128, 255, 0.35);
}

.icon i {
    font-size: 1.5rem;
    color: white;
}

.icon:hover {
    transform: scale(1.05);
}

.saludo>p {
    color: gray;
    margin-top: 0.25rem;
    font-size: 0.95rem;
}

/* ── form ── */
form {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 90%;
}

/* ── inputs contenedor ── */
.inputs {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

/* ── field-wrap: columna que contiene label + input-wrap + mensaje ── */
.field-wrap {
    display: flex;
    flex-direction: column;
    position: relative;
}

.user {
    display: flex;
    flex-direction: column;
    position: relative;
}

.clave {
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ── input-wrap: contenedor SOLO del input + íconos internos ── */
/* Agrega este div en el HTML envolviendo el input y sus íconos */
.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

/* ── Ícono izquierdo del input (persona / candado) ── */
/* Ahora vive dentro de .input-wrap, top: 50% es exacto */
.input-wrap>i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.25s ease;
    z-index: 1;
    line-height: 1;
}

/* ── input base ── */
input {
    width: 100%;
    background: #F6F7F8;
    padding: 0.78rem 0.8rem 0.78rem 38px;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 14px;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.2s ease;
    box-sizing: border-box;
    line-height: 1.4;
}

input:focus {
    background: #fff;
    border-color: #137FEC;
    box-shadow: 0 0 0 3px rgba(19, 127, 236, 0.12);
}

/* ── Estado OK ── */
.field-wrap.field-ok input {
    border-color: #27ae60;
    background: #f0faf4;
}

.field-wrap.field-ok .input-wrap>i {
    color: #27ae60;
}

/* ── Estado ERROR ── */
.field-wrap.field-error input {
    border-color: #e74c3c;
    background: #fff8f8;
    animation: inputShiver 0.35s ease;
}

.field-wrap.field-error .input-wrap>i {
    color: #e74c3c;
}

@keyframes inputShiver {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-3px);
    }

    75% {
        transform: translateX(3px);
    }
}

/* ── Mensaje de validación por campo ── */
.field-msg {
    font-size: 12px;
    min-height: 16px;
    margin-top: 4px;
    padding-left: 2px;
    transition: color 0.2s ease, opacity 0.2s ease;
    opacity: 0;
}

.field-msg.error {
    color: #e74c3c;
    opacity: 1;
}

.field-msg.ok {
    color: #27ae60;
    opacity: 1;
}

/* ── Botón ojo ── */
.eye-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    z-index: 1;
    line-height: 1;
}

.eye-btn:hover {
    color: #137FEC;
}

.eye-btn i {
    font-size: 1rem;
    line-height: 1;
}

/* input contraseña: espacio para el botón ojo */
.clave input {
    padding-right: 40px;
}

/* ── label ── */
label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin: 0 0 6px 2px;
    /* limpia el margin de 0.5rem que desajustaba el espaciado */
}

/* ── Alerta de error (PHP + JS) ── */
.alerta-error {
    background: #fff2f2;
    border: 1px solid #fca5a5;
    border-left: 4px solid #e74c3c;
    color: #c0392b;
    border-radius: 0.5rem;
    padding: 0.65rem 0.9rem;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: alertSlideIn 0.3s ease;
}

.alerta-error.alerta-show {
    display: flex !important;
    animation: alertSlideIn 0.3s ease;
}

.alerta-error.alerta-hide {
    animation: alertSlideOut 0.3s ease forwards;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes alertSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-6px);
    }
}

/* ── Botón iniciar sesión ── */
.btn {
    width: 100%;
    position: relative;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn_iniciar {
    background: linear-gradient(135deg, #4A80FF 0%, #1A3FD8 100%);
    border: none;
    width: 90%;
    padding: 0;
    border-radius: 0.5rem;
    color: white;
    font-size: 17px;
    cursor: pointer;
    height: 50px;
    transition: all ease 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn_iniciar:hover {
    transform: scale(1.05);
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(74, 128, 255, .45);
}

.btn_iniciar:active {
    transform: scale(0.98);
}

/* ── footer ── */
.footer {
    border-top: 1px solid #c3c3c3d9;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3.5rem;
    text-align: center;
    background: #F8FAFC;
    color: gray;
    font-size: 14px;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
    margin-top: 0.5rem;
}

/* ── copyright ── */
.copy {
    font-size: 12px;
    color: rgb(196, 196, 196);
    top: 2rem;
    position: absolute;
    margin-top: 40rem;
}

body {
    position: relative;
}

#antigravity-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.cont1,
.cont2 {
    position: relative;
    z-index: 1;
}

/* ══════════════════════════════════════════
   RESPONSIVE — Tablet (≤ 900px)
══════════════════════════════════════════ */
@media (max-width: 900px) {
    body {
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        height: auto;
        min-height: 100vh;
    }

    .cont2 {
        display: none;
        /* Ocultar decoración del camión en tablet/móvil */
    }

    .cont1 {
        width: 100%;
        min-height: 100vh;
        padding: 1.5rem 1rem;
        box-sizing: border-box;
        align-items: center;
        justify-content: center;
    }

    .card-login {
        width: 100%;
        max-width: 420px;
    }
}

/* ══════════════════════════════════════════
   RESPONSIVE — Móvil (≤ 480px)
══════════════════════════════════════════ */
@media (max-width: 480px) {
    body {
        background-image:
            linear-gradient(rgba(26, 63, 216, .04) 1px, transparent 1px),
            linear-gradient(90deg, rgba(26, 63, 216, .04) 1px, transparent 1px);
        background-size: 24px 24px;
        overflow-y: auto;
        height: auto;
        min-height: 100dvh;
        align-items: center;
    }

    #antigravity-bg {
        opacity: 0.4;
    }

    .cont1 {
        width: 100%;
        min-height: 100dvh;
        padding: 1.25rem 1rem;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Card ocupa casi todo el ancho */
    .card-login {
        width: 100%;
        max-width: 100%;
        border-radius: 1.75rem;
        padding: 2.25rem 0 0 0;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
        background: rgba(255, 255, 255, 0.82);
        backdrop-filter: blur(15px);
        border: 1px solid rgba(255, 255, 255, 0.3);
    }

    /* Ícono camión un poco más pequeño */
    .icon {
        padding: 0.75rem;
        height: 26px;
    }

    .icon i {
        font-size: 1.35rem;
    }

    /* Títulos del saludo */
    .saludo h2 {
        font-size: 1.4rem;
        margin-bottom: 0.3rem;
        font-weight: 700;
    }

    .saludo p {
        font-size: 0.9rem;
        margin-top: 0;
    }

    /* Form con mayor padding lateral */
    form {
        width: 88%;
        padding: 0.25rem 0.25rem;
    }

    /* Inputs más grandes para dedos */
    input {
        padding: 0.9rem 0.9rem 0.9rem 40px;
        font-size: 16px;
        /* 16px evita el zoom automático en iOS */
        border-radius: 0.65rem;
    }

    label {
        font-size: 13px;
    }

    /* Botón más alto y fácil de tocar */
    .btn_iniciar {
        height: 52px;
        font-size: 16px;
        border-radius: 0.65rem;
        width: 100%;
    }

    .btn {
        margin-bottom: 1rem;
    }

    /* Alerta de error */
    .alerta-error {
        font-size: 13px;
        padding: 0.6rem 0.75rem;
    }

    /* Footer */
    .footer {
        height: 3rem;
        font-size: 13px;
    }

    /* Partículas de fondo — reducir en móvil (se ajustan en JS, solo ocultamos el canvas cuando no aporta) */
    #antigravity-bg {
        opacity: 0.4;
    }
}