/* ============================================================
   LOGIN - ESTILOS
   LINEA DE TIEMPO - PROYECTO DIQUE B4
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --login-bg: #071a2d;
    --login-bg-secondary: #0b2238;
    --login-card: rgba(11, 32, 53, 0.94);
    --login-primary: #5ec8ea;
    --login-primary-dark: #3a8bb5;
    --login-text: #eef3f6;
    --login-text-secondary: #a9bfd1;
    --login-text-muted: #6f899f;
    --login-input: rgba(7, 21, 35, 0.85);
    --login-border: rgba(94, 200, 234, 0.20);
    --login-danger: #e0604f;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--login-text);
    background: linear-gradient(135deg, #071a2d 0%, #102945 50%, #091e37 100%);
}

/* ============================================================
   PAGINA / LAYOUT
   ============================================================ */

.login-page {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 2;
}

/* ============================================================
   FONDO: GRID + ESTRELLAS
   ============================================================ */

.background-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(94, 200, 234, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(94, 200, 234, 0.06) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 90%);
    mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 90%);
}

.background-grid::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(2px 2px at 20% 30%, rgba(94, 200, 234, 0.35), transparent),
        radial-gradient(2px 2px at 40% 75%, rgba(94, 200, 234, 0.25), transparent),
        radial-gradient(2px 2px at 65% 20%, rgba(94, 200, 234, 0.35), transparent),
        radial-gradient(2px 2px at 82% 62%, rgba(94, 200, 234, 0.25), transparent),
        radial-gradient(1px 1px at 12% 82%, rgba(94, 200, 234, 0.45), transparent),
        radial-gradient(1px 1px at 92% 12%, rgba(94, 200, 234, 0.45), transparent);
    background-size: 220px 220px;
    animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* ============================================================
   FONDO: GLOWS
   ============================================================ */

.background-glow {
    position: fixed;
    z-index: 0;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    animation: drift 12s ease-in-out infinite alternate;
}

.glow-one {
    width: 420px;
    height: 420px;
    top: -120px;
    left: -100px;
    background: radial-gradient(circle, var(--login-primary) 0%, transparent 70%);
}

.glow-two {
    width: 480px;
    height: 480px;
    bottom: -160px;
    right: -140px;
    background: radial-gradient(circle, var(--login-primary-dark) 0%, transparent 70%);
    animation-delay: -6s;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(20px, -20px) scale(1.08); }
}

/* ============================================================
   TARJETA
   ============================================================ */

.login-card {
    background: var(--login-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 44px 40px 36px;
    border: 1px solid var(--login-border);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(94, 200, 234, 0.10);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================================
   MARCA
   ============================================================ */

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.brand-mark {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 14px;
    background: rgba(94, 200, 234, 0.08);
    border: 1px solid rgba(94, 200, 234, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.brand-mark span {
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--login-primary), var(--login-primary-dark));
    animation: bounce 1.6s ease-in-out infinite;
}

.brand-mark span:nth-child(2) {
    height: 24px;
    animation-delay: 0.15s;
}

.brand-mark span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes bounce {
    0%, 100% { transform: scaleY(0.6); opacity: 0.7; }
    50% { transform: scaleY(1); opacity: 1; }
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-text strong {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--login-text);
}

.brand-text small {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--login-text-muted);
    text-transform: uppercase;
}

/* ============================================================
   CABECERA
   ============================================================ */

.login-heading {
    margin-bottom: 28px;
}

.login-heading .eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.6px;
    color: var(--login-primary);
    text-transform: uppercase;
    margin-bottom: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(94, 200, 234, 0.10);
    border: 1px solid rgba(94, 200, 234, 0.20);
}

.login-heading h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--login-text);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.login-heading p {
    font-size: 14px;
    color: var(--login-text-secondary);
    font-weight: 400;
    line-height: 1.5;
}

/* ============================================================
   ALERTAS
   ============================================================ */

.alert-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 22px;
    background: rgba(224, 96, 79, 0.12);
    color: #ff9c8d;
    border: 1px solid rgba(224, 96, 79, 0.30);
    animation: shake 0.5s ease-in-out;
}

.alert-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(224, 96, 79, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* ============================================================
   FORMULARIO
   ============================================================ */

.login-form {
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--login-text-secondary);
    margin-bottom: 7px;
    letter-spacing: 0.2px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--login-text-muted);
    pointer-events: none;
    transition: color 0.25s ease;
}

.input-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.form-group input {
    width: 100%;
    height: 52px;
    padding: 14px 16px 14px 46px;
    background: var(--login-input);
    border: 2px solid rgba(26, 65, 98, 0.60);
    border-radius: 12px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--login-text);
    outline: none;
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
}

#password {
    padding-right: 46px;
}

.form-group input:hover {
    border-color: rgba(94, 200, 234, 0.35);
}

.form-group input:focus {
    border-color: var(--login-primary);
    box-shadow: 0 0 0 4px rgba(94, 200, 234, 0.12);
    background: rgba(7, 21, 35, 0.98);
}

.form-group input:focus + .password-toggle,
.input-wrapper:focus-within .input-icon {
    color: var(--login-primary);
}

.form-group input::placeholder {
    color: #4f6d87;
}

.form-group input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #0b2035 inset !important;
    -webkit-text-fill-color: var(--login-text) !important;
}

.password-toggle {
    position: absolute;
    right: 14px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    color: var(--login-text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--login-primary);
}

.password-toggle svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* ============================================================
   BOTON
   ============================================================ */

.btn-login {
    width: 100%;
    height: 52px;
    padding: 14px 16px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(
        135deg,
        var(--login-primary) 0%,
        var(--login-primary-dark) 100%
    );
    color: #071523;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        filter 0.25s ease;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.btn-login svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transition: transform 0.25s ease;
}

.btn-login::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.12),
        transparent
    );
    transform: rotate(45deg) translateX(-100%);
    transition: 0.6s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(94, 200, 234, 0.25);
    filter: brightness(1.05);
}

.btn-login:hover svg {
    transform: translateX(3px);
}

.btn-login:hover::after {
    transform: rotate(45deg) translateX(100%);
}

.btn-login:active {
    transform: translateY(0);
}

/* ============================================================
   INFO DE ESTADO
   ============================================================ */

.login-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    font-size: 12px;
    color: var(--login-text-muted);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4fd68c;
    box-shadow: 0 0 0 0 rgba(79, 214, 140, 0.6);
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 rgba(79, 214, 140, 0.55); }
    70% { box-shadow: 0 0 0 6px rgba(79, 214, 140, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 214, 140, 0); }
}

/* ============================================================
   PIE
   ============================================================ */

.login-footer {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(94, 200, 234, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--login-text-muted);
    letter-spacing: 0.2px;
}

.login-footer .separator {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--login-text-muted);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 480px) {
    .login-page {
        padding: 14px;
    }

    .login-card {
        padding: 32px 24px 28px;
        border-radius: 20px;
    }

    .login-heading {
        margin-bottom: 24px;
    }

    .login-heading h1 {
        font-size: 22px;
    }

    .login-heading p {
        font-size: 13px;
    }

    .form-group input {
        height: 50px;
    }

    .btn-login {
        height: 50px;
    }
}

@media (max-height: 650px) {
    .login-card {
        padding-top: 28px;
        padding-bottom: 24px;
    }

    .login-heading {
        margin-bottom: 20px;
    }
}