/* Reset y configuración base */
*, *:before, *:after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Solo aplicar font-size pequeño en la página de login */
body.login-page {
    font-family: 'Open Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.login-page,
body.login-page html {
    font-size: 62.5%;
    height: 100%;
    overflow: hidden;
}

@media (max-width: 768px) {
    body.login-page,
    body.login-page html {
        font-size: 50%;
    }
}

/* Unificar estilo para enlaces en todo el sistema (sin diferencia visitado/no-visitado) */
a, a:link, a:visited { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

/* SVG Icons */
svg {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    overflow: visible;
}

.svg-icon path {
    stroke: rgba(255, 255, 255, 0.9);
    fill: none;
    stroke-width: 1;
}

input, button {
    outline: none;
    border: none;
}

/* Contenedor principal con imagen de fondo */
.cont {
    position: relative;
    height: 100%;
    width: 100%;
    background-image: url('../img/login.jpg');
    background-size: cover;
    background-position: center;
    overflow: auto;
    font-family: 'Open Sans', 'Segoe UI', Helvetica, Arial, sans-serif;
}

.cont::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.85) 0%, rgba(30, 64, 175, 0.75) 50%, rgba(59, 130, 246, 0.7) 100%);
}

:root,
body.login-page {
    --login-scale: 0.9;
}

.demo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(var(--login-scale));
    transform-origin: center;
    width: 30rem;
    height: 56rem;
    overflow: hidden;
    z-index: 1;
}

/* Login container */
.login {
    position: relative;
    height: 100%;
    background: linear-gradient(to bottom, rgba(30, 58, 138, 0.9) 0%, rgba(0, 0, 0, 0.7) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    transition: opacity 0.1s, transform 0.3s cubic-bezier(0.17, -0.65, 0.665, 1.25);
    transform: scale(1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.login.inactive {
    opacity: 0;
    transform: scale(1.1);
}

/* Checkmark decorativo */
.login__check {
    position: absolute;
    top: 16rem;
    left: 13.5rem;
    width: 14rem;
    height: 2.8rem;
    background: #fff;
    transform-origin: 0 100%;
    transform: rotate(-45deg);
    opacity: 0.1;
}

.login__check:before {
    content: "";
    position: absolute;
    left: 0;
    bottom: 100%;
    width: 2.8rem;
    height: 5.2rem;
    background: #fff;
    box-shadow: inset -0.2rem -2rem 2rem rgba(0, 0, 0, 0.2);
}

/* Formulario de login */
.login__form {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 3rem 2.5rem 2rem;
    text-align: center;
}

/* Header del login */
.login__header {
    margin-bottom: 3rem;
}

.login__logo {
    width: 8rem;
    height: 8rem;
    margin: 0 auto 1.5rem;
    filter: drop-shadow(0 5px 15px rgba(255, 255, 255, 0.3));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.login__title {
    font-size: 3rem;
    color: #fff;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.login__subtitle {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
    margin-bottom: 2rem;
}

/* Filas de input */
.login__row {
    height: 5rem;
    padding-top: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.login__icon {
    margin-bottom: -0.4rem;
    margin-right: 0.5rem;
}

.login__icon.name path {
    stroke-dasharray: 73.50196075439453;
    stroke-dashoffset: 73.50196075439453;
    animation: animatePath 2s 0.5s forwards;
}

.login__icon.pass path {
    stroke-dasharray: 92.10662841796875;
    stroke-dashoffset: 92.10662841796875;
    animation: animatePath 2s 0.5s forwards;
}

.login__input {
    display: inline-block;
    width: 22rem;
    height: 100%;
    padding-left: 1.5rem;
    font-size: 1.5rem;
    background: transparent;
    color: #FDFCFD;
}

.login__input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 1.4rem;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* Botón de submit */
.login__submit {
    position: relative;
    width: 100%;
    height: 4.5rem;
    margin: 3rem 0 2rem;
    color: rgba(255, 255, 255, 0.95);
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    font-size: 1.6rem;
    font-weight: 600;
    border-radius: 3rem;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.4);
}

.login__submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 50%, #93c5fd 100%);
}

.login__submit:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -1.5rem;
    margin-top: -1.5rem;
    width: 3rem;
    height: 3rem;
    border: 2px dotted #fff;
    border-radius: 50%;
    border-left: none;
    border-bottom: none;
    transition: opacity 0.1s 0.4s;
    opacity: 0;
}

.login__submit.processing {
    pointer-events: none;
}

.login__submit.processing:after {
    opacity: 1;
    animation: rotate 0.5s 0s infinite linear;
}

.login__submit.processing .btn-text {
    opacity: 0;
}

.login__submit.success {
    transition: transform 0.3s 0.1s ease-out, opacity 0.1s 0.3s;
    transform: scale(30);
    opacity: 0.9;
}

.login__submit.success:after {
    transition: opacity 0.1s 0s;
    opacity: 0;
    animation: none;
}

/* Mensajes */
.login__message {
    margin-top: 1.5rem;
    padding: 1.2rem;
    border-radius: 8px;
    font-size: 1.3rem;
    text-align: center;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.login__message.show {
    opacity: 1;
    transform: translateY(0);
}

.login__message.success {
    background: rgba(52, 211, 153, 0.2);
    color: #10b981;
    border: 1px solid rgba(52, 211, 153, 0.4);
}

.login__message.error {
    background: rgba(248, 113, 113, 0.2);
    color: #ef4444;
    border: 1px solid rgba(248, 113, 113, 0.4);
}

/* Ripple effect */
.ripple {
    position: absolute;
    width: 15rem;
    height: 15rem;
    margin-left: -7.5rem;
    margin-top: -7.5rem;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: animRipple 0.5s;
    border-radius: 50%;
    pointer-events: none;
}

/* Animaciones */
@keyframes animRipple {
    to {
        transform: scale(3.5);
        opacity: 0;
    }
}

@keyframes rotate {
    to {
        transform: rotate(360deg);
    }
}

@keyframes animatePath {
    to {
        stroke-dashoffset: 0;
    }
}

/* Responsivo */
@media (max-width: 1200px) {
    body.login-page {
        --login-scale: 0.85;
    }
}

@media (max-width: 992px) {
    body.login-page {
        --login-scale: 0.8;
    }
}

@media (max-width: 768px) {
    body.login-page {
        --login-scale: 0.72;
    }
}

@media (max-width: 560px) {
    body.login-page {
        --login-scale: 0.66;
    }
}

@media (max-width: 420px) {
    body.login-page {
        --login-scale: 0.6;
    }
}