/* Login PROFARMA - colores tomados del logo */
:root{
    --pf-navy: #173d5a;
    --pf-navy-dark: #0e2638;
    --pf-sky: #78c6e6;
    --pf-blue: #3789c8;
    --pf-text: #2b3a4a;
    --pf-muted: #7a8899;
    --pf-border: #d8e2ec;
}

html, body{
    height: 100%;
}
body{
    padding: 0;
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--pf-text);
    background: var(--pf-navy-dark);
    overflow-x: hidden;
}

/* ---------- Fondo ---------- */
.bg-photo{
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('../img/background2.jpg') center / cover no-repeat;
    animation: bgZoom 30s ease-in-out infinite alternate;
    z-index: 0;
}
.bg-overlay{
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(120, 198, 230, .35), transparent 55%),
        linear-gradient(135deg, rgba(14, 38, 56, .88) 0%, rgba(23, 61, 90, .72) 50%, rgba(55, 137, 200, .55) 100%);
    z-index: 1;
}
.bg-bubbles{
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    z-index: 2;
    pointer-events: none;
}
.bg-bubbles span{
    position: absolute;
    bottom: -160px;
    display: block;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .35), rgba(120, 198, 230, .12));
    animation: bubbleUp linear infinite;
}
.bg-bubbles span:nth-child(1){ left: 8%;  width: 90px;  height: 90px;  animation-duration: 22s; }
.bg-bubbles span:nth-child(2){ left: 28%; width: 40px;  height: 40px;  animation-duration: 17s; animation-delay: 4s; }
.bg-bubbles span:nth-child(3){ left: 62%; width: 120px; height: 120px; animation-duration: 28s; animation-delay: 2s; }
.bg-bubbles span:nth-child(4){ left: 80%; width: 55px;  height: 55px;  animation-duration: 19s; animation-delay: 8s; }
.bg-bubbles span:nth-child(5){ left: 45%; width: 70px;  height: 70px;  animation-duration: 25s; animation-delay: 12s; }

/* ---------- Contenedor ---------- */
.wrap{
    position: relative;
    z-index: 3;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    box-sizing: border-box;
}
#gorro{
    display: none;
}

/* ---------- Tarjeta ---------- */
.login{
    width: 100%;
    max-width: 380px;
    padding: 36px 32px 24px;
    background: rgba(255, 255, 255, .96);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(8, 24, 38, .45), 0 0 0 1px rgba(255, 255, 255, .4);
    animation: cardIn .7s cubic-bezier(.2, .8, .2, 1) both;
    position: relative;
    overflow: hidden;
}
/* Linea de acento animada en la parte superior */
.login::before{
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--pf-navy), var(--pf-sky), var(--pf-blue), var(--pf-navy));
    background-size: 300% 100%;
    animation: accentMove 8s linear infinite;
}

.image{
    text-align: center;
    margin: 0 0 6px;
    animation: fadeUp .7s .15s both;
}
.image img{
    max-width: 100% !important;
    height: auto;
}
.subtitle{
    text-align: center;
    color: var(--pf-muted);
    font-size: 13px;
    margin: 0 0 22px;
    animation: fadeUp .7s .25s both;
}

/* ---------- Campos ---------- */
.field{
    position: relative;
    margin-bottom: 14px;
    animation: fadeUp .6s both;
}
.field:nth-of-type(2){ animation-delay: .3s; }
.field:nth-of-type(3){ animation-delay: .38s; }
.field:nth-of-type(4){ animation-delay: .46s; }

.field-icon{
    position: absolute;
    left: 13px;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    fill: var(--pf-muted);
    transition: fill .25s ease;
    pointer-events: none;
    z-index: 2;
}
.login .form-control{
    height: 44px !important;
    padding-left: 42px;
    border: 1px solid var(--pf-border);
    border-radius: 10px;
    background: #f7fafc;
    box-shadow: none;
    color: var(--pf-text);
    font-size: 15px;
    transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
}
.login select.form-control{
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237a8899'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    cursor: pointer;
}
.login .form-control:focus{
    border-color: var(--pf-sky);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(120, 198, 230, .25);
    outline: 0;
}
.field:focus-within .field-icon{
    fill: var(--pf-blue);
}
.login .form-control::placeholder{
    color: #9aa7b5;
}
/* Ocultar flechas del input number */
.login input[type="number"]::-webkit-outer-spin-button,
.login input[type="number"]::-webkit-inner-spin-button{
    -webkit-appearance: none;
    margin: 0;
}
.login input[type="number"]{
    -moz-appearance: textfield;
}

/* Boton mostrar contraseña */
.login #pass{
    padding-right: 44px;
}
.toggle-pass{
    position: absolute;
    right: 6px;
    top: 50%;
    width: 34px;
    height: 34px;
    margin-top: -17px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    z-index: 2;
}
.toggle-pass svg{
    width: 18px;
    height: 18px;
    fill: var(--pf-muted);
    transition: fill .2s ease;
}
.toggle-pass:hover svg,
.toggle-pass.is-active svg{
    fill: var(--pf-blue);
}
.toggle-pass:focus{
    outline: 2px solid var(--pf-sky);
}

/* ---------- Boton Entrar ---------- */
.login .btn-login{
    display: block;
    width: 100%;
    height: 46px;
    margin: 22px 0 0;
    border: 0;
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: linear-gradient(90deg, var(--pf-navy) 0%, var(--pf-blue) 50%, var(--pf-sky) 100%);
    background-size: 200% 100%;
    background-position: 0 0;
    box-shadow: 0 8px 20px rgba(23, 61, 90, .3);
    cursor: pointer;
    transition: background-position .5s ease, transform .2s ease, box-shadow .2s ease;
    animation: fadeUp .6s .55s both;
}
.login .btn-login:hover,
.login .btn-login:focus{
    color: #fff;
    background-position: 100% 0;
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(55, 137, 200, .4);
    outline: 0;
}
.login .btn-login:active{
    transform: translateY(0);
}
.login .btn-login.is-loading{
    cursor: wait;
    opacity: .85;
    background-position: 100% 0;
    animation: pulse 1.2s ease-in-out infinite;
}

/* ---------- Alertas ---------- */
.login .alert{
    border-radius: 10px;
    font-size: 13px;
    text-align: left;
    animation: shake .45s ease both;
    transition: opacity .25s ease, transform .25s ease;
}
.login .alert p{
    margin: 0;
}
.login .alert.is-hiding{
    opacity: 0;
    transform: translateY(-6px);
}

.footer-note{
    margin: 20px 0 0;
    text-align: center;
    font-size: 11px;
    color: var(--pf-muted);
}

/* ---------- Animaciones ---------- */
@keyframes bgZoom{
    from{ transform: scale(1); }
    to  { transform: scale(1.12); }
}
@keyframes bubbleUp{
    0%  { transform: translateY(0) scale(1);       opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: .8; }
    100%{ transform: translateY(-120vh) scale(1.3); opacity: 0; }
}
@keyframes cardIn{
    from{ opacity: 0; transform: translateY(24px) scale(.98); }
    to  { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeUp{
    from{ opacity: 0; transform: translateY(10px); }
    to  { opacity: 1; transform: translateY(0); }
}
@keyframes accentMove{
    from{ background-position: 0% 0; }
    to  { background-position: 300% 0; }
}
@keyframes pulse{
    0%, 100%{ box-shadow: 0 8px 20px rgba(23, 61, 90, .3); }
    50%     { box-shadow: 0 8px 28px rgba(120, 198, 230, .6); }
}
@keyframes shake{
    0%, 100%{ transform: translateX(0); }
    20%, 60%{ transform: translateX(-6px); }
    40%, 80%{ transform: translateX(6px); }
}

/* Usuarios que prefieren menos movimiento */
@media (prefers-reduced-motion: reduce){
    *, *::before, *::after{
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 480px){
    .login{
        padding: 28px 20px 20px;
    }
}
