@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&display=swap');

:root {
    --bg-deep: #04132e;
    --bg-mid: #07204a;
    --bg-light: #0a2a5e;
    --cyan: #1ec4d6;
    --cyan-dark: #0fa3b8;
    --text: #ffffff;
    --text-muted: #b8c5d6;
    --line: rgba(255, 255, 255, 0.35);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: radial-gradient(ellipse at 30% 40%, var(--bg-light) 0%, var(--bg-mid) 35%, var(--bg-deep) 80%);
    overflow: hidden;
}

/* ---------- Stage ---------- */
.stage {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* ---------- Dot grid top-right ---------- */
.dot-grid {
    position: absolute;
    top: 0;
    right: 0;
    width: 45%;
    height: 45%;
    background-image: radial-gradient(circle, rgba(120, 180, 255, 0.35) 1px, transparent 1.5px);
    background-size: 14px 14px;
    -webkit-mask-image: radial-gradient(ellipse at top right, black 0%, black 30%, transparent 75%);
    mask-image: radial-gradient(ellipse at top right, black 0%, black 30%, transparent 75%);
    pointer-events: none;
}

/* ---------- Left-side checkmark art ---------- */
.check-art {
    position: absolute;
    left: 10%;
    top: 40%;
    transform: translateY(-50%);
    width: 600px;
    height: 600px;
    pointer-events: none;
    opacity: 0.95;
}

    .check-art svg {
        width: 100%;
        height: 100%;
        overflow: visible;
    }

@keyframes ringPulse {
    0%, 100% { opacity: 0.55; }
    50%       { opacity: 0.95; }
}

.ring-glow {
    animation: ringPulse 6s ease-in-out infinite;
    transform-origin: center;
}

    .ring-glow.delay {
        animation-delay: -3s;
    }

@keyframes orbit {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.orbit-dot-group {
    transform-origin: 360px 360px;
    animation: orbit 40s linear infinite;
}

    .orbit-dot-group.reverse {
        animation: orbit 55s linear infinite reverse;
    }

/* ---------- Wave canvas ---------- */
#waves {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    display: block;
    pointer-events: none;
    z-index: 1;
}

/* ---------- Login card ---------- */
.login-wrap {
    position: absolute;
    top: 50%;
    left: 58%;
    transform: translateY(-50%);
    width: 440px;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 44px;
    user-select: none;
}

h1.welcome {
    font-size: 36px;
    font-weight: 500;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

p.subtitle {
    font-size: 14px;
    font-weight: 300;
    color: var(--text-muted);
    margin-bottom: 36px;
}

/* ---------- Underline fields (main login form) ---------- */
.field {
    position: relative;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding: 10px 0 10px 36px;
    margin-bottom: 22px;
    transition: border-color 0.25s ease;
}

    .field:focus-within {
        border-bottom-color: var(--cyan);
    }

    .field svg.icon {
        position: absolute;
        left: 4px;
        width: 18px;
        height: 18px;
        color: rgba(255, 255, 255, 0.7);
    }

    .field input {
        flex: 1;
        background: transparent;
        border: none;
        outline: none;
        color: #fff;
        font-family: 'Outfit', system-ui, sans-serif;
        font-size: 15px;
        font-weight: 300;
        padding: 4px 0;
    }

        .field input::placeholder {
            color: rgba(255, 255, 255, 0.55);
            font-weight: 300;
        }

/* Password eye toggle inside field */
.field .passwordEyeContainer {
    position: absolute;
    right: 4px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: rgba(255,255,255,0.55);
}

    .field .passwordEyeContainer svg {
        width: 20px;
        height: 20px;
    }

    .field .passwordEyeContainer:hover {
        color: rgba(255,255,255,0.9);
    }

/* ---------- Forgot password ---------- */
.forgot-password-wrapper {
    text-align: right;
    margin-bottom: 4px;
    margin-top: -10px;
}

.forgot-password-link {
    font-size: 12px;
    color: var(--cyan);
    text-decoration: none;
    font-weight: 300;
}

    .forgot-password-link:hover {
        text-decoration: underline;
        color: var(--text);
    }

/* ---------- Error label ---------- */
#lblLogin {
    display: none;
    color: #ff5a78;
    font-size: 13px;
    font-weight: 400;
    margin-top: 10px;
    margin-bottom: -6px;
    min-height: 18px;
    text-align: left;
    line-height: 1.4;
}

/* ---------- Submit button ---------- */
.submit {
    margin-top: 28px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 20px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(180deg, #2bcad8 0%, #149fb2 100%);
    color: #fff;
    font-family: 'Outfit', inherit;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.2px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(20, 159, 178, 0.35);
    transition: transform 0.15s ease, box-shadow 0.25s ease, filter 0.2s ease;
    position: relative;
    overflow: hidden;
}

    .submit:hover {
        filter: brightness(1.08);
        box-shadow: 0 6px 24px rgba(20, 159, 178, 0.55);
    }

    .submit:active {
        transform: translateY(1px);
    }

    .submit svg {
        width: 18px;
        height: 18px;
    }

    .submit .btn-content {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        transition: opacity 0.2s ease;
    }

    .submit .spinner {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 22px;
        height: 22px;
        margin: -11px 0 0 -11px;
        border-radius: 50%;
        border: 2px solid rgba(255, 255, 255, 0.25);
        border-top-color: #fff;
        opacity: 0;
        transition: opacity 0.2s ease;
        animation: spin 0.7s linear infinite;
    }

    .submit.loading {
        pointer-events: none;
        cursor: wait;
    }

        .submit.loading .btn-content {
            opacity: 0;
        }

        .submit.loading .spinner {
            opacity: 1;
        }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Atenuar tarjeta durante carga */
.login-wrap.loading .field,
.login-wrap.loading h1.welcome,
.login-wrap.loading p.subtitle {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

/* ---------- Field error state ---------- */
.field.error {
    border-bottom-color: #ff5a78;
    animation: fieldShake 0.25s ease-in-out;
}

    .field.error svg.icon {
        color: #ff5a78;
    }

    .field.error input::placeholder {
        color: rgba(255, 90, 120, 0.75);
    }

@keyframes fieldShake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-4px); }
    75%       { transform: translateX(4px); }
}

/* ---------- Separator + social buttons ---------- */
.separador-login {
    position: relative;
    height: 52px;
    width: 100%;
    margin-top: 18px;
}

    .separador-login::before {
        content: "";
        position: absolute;
        width: 100%;
        height: 1px;
        top: 50%;
        left: 0;
        background: rgba(255,255,255,0.2);
    }

    .separador-login::after {
        content: "o";
        position: absolute;
        width: 36px;
        height: 36px;
        line-height: 36px;
        text-align: center;
        top: 50%;
        left: 50%;
        color: rgba(255,255,255,0.4);
        background: var(--bg-mid);
        transform: translate(-50%, -50%);
        font-size: 13px;
    }

.btn-social {
    width: 100%;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.15);
    margin: 5px 0;
    padding: 0;
    color: white;
    background: rgba(255,255,255,0.07);
    transition: background 0.2s ease;
    cursor: pointer;
}

    .btn-social:hover {
        background: rgba(255,255,255,0.13);
    }

    .btn-social div {
        display: flex;
        align-items: center;
    }

    .btn-social i {
        height: 40px;
        line-height: 40px;
        width: 40px;
        background: rgba(0,0,0,0.2);
        border-radius: 6px 0 0 6px;
    }

    .btn-social span {
        flex: 1;
        text-align: center;
        font-size: 14px;
        font-weight: 300;
    }

/* ---------- Sub-form sections (MFA, pwd change, client, personal data) ---------- */
.form-box {
    width: 100%;
}

    .form-box h4 {
        font-size: 15px;
        font-weight: 400;
        color: var(--text-muted);
        margin-bottom: 14px;
    }

    .form-box label {
        font-size: 13px;
        font-weight: 300;
        color: var(--text-muted);
        display: block;
        margin-bottom: 4px;
        margin-top: 12px;
    }

/* MFA & sub-form inputs */
.form-box .form-control,
#divMFA #input-mfa,
#divLoginCliente select {
    width: 100%;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(120,180,255,0.25);
    border-radius: 8px;
    color: #e8f0ff;
    padding: 10px 14px;
    font-size: 15px;
    font-family: 'Outfit', inherit;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

    .form-box .form-control:focus,
    #divMFA #input-mfa:focus,
    #divLoginCliente select:focus {
        border-color: var(--cyan);
        background: rgba(255,255,255,0.11);
    }

    .form-box .form-control::placeholder,
    #divMFA #input-mfa::placeholder {
        color: rgba(180,210,255,0.4);
    }

#divMFA #input-mfa {
    text-align: center;
    font-size: 36px;
    letter-spacing: 4px;
    height: 70px;
    margin: 14px 0 28px;
}

#divLoginCliente select {
    height: 44px;
    margin: 10px 0;
    cursor: pointer;
}

    #divLoginCliente select option {
        background: var(--bg-mid);
        color: #e8f0ff;
    }

/* Sub-form action buttons reuse .submit sizing but full-width */
.login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(180deg, #2bcad8 0%, #149fb2 100%);
    color: #fff;
    font-family: 'Outfit', inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(20, 159, 178, 0.3);
    transition: filter 0.2s ease, transform 0.15s ease;
}

    .login-button:hover {
        filter: brightness(1.08);
    }

    .login-button:active {
        transform: translateY(1px);
    }

/* Personal data update */
.btn-form-datos-personales {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 18px;
}

#divRequiereActualizarDatosPersonales > div > p {
    font-size: 14px;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 18px;
}

.forgot-password-link-sub,
#btn_recordar_mas_tarde,
.btn-form-datos-personales a {
    background: transparent;
    border: none;
    color: var(--cyan);
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}

    .btn-form-datos-personales a:hover,
    #btn_recordar_mas_tarde:hover {
        text-decoration: underline;
    }

/* Password requirements panel */
.pw-requeriments-info,
.pw-match-info {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(120,180,255,0.2);
    border-radius: 6px;
    padding: 10px 14px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    display: none;
}

    .pw-requeriments-info h4,
    .pw-match-info h4 {
        font-size: 12px;
        margin-bottom: 6px;
        color: rgba(255,255,255,0.7);
    }

    .pw-requeriments-info ul,
    .pw-match-info ul {
        list-style: none;
        padding: 0;
    }

        .pw-requeriments-info ul li,
        .pw-match-info ul li {
            padding: 2px 0;
        }

/* Password-related info box */
#divRequirePasswordChange > div > div[style*="background: #eef9ff"],
#divRequirePasswordChange > div > div[style*="background:#eef9ff"] {
    background: rgba(255,255,255,0.05) !important;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

/* ---- logueando overlay (keep for Login_V2.js compatibility) ---- */
.login-box.logueando {
    pointer-events: none;
}

/* ---------- devsys logo footer ---------- */
.footer-logo {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 5;
    opacity: 0.75;
    user-select: none;
}

/* ---------- Full-screen loader overlay ---------- */
body .vertical-centered-box {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    text-align: center;
    z-index: 2147483647;
}

#div-carga-nuevo {
    display: block;
}

body .vertical-centered-box::after {
    content: '';
    display: inline-block;
    height: 100%;
    vertical-align: middle;
    margin-right: -0.25em;
}

body .vertical-centered-box .content {
    box-sizing: border-box;
    animation: fadein 1s linear forwards;
    display: inline-block;
    vertical-align: middle;
    text-align: left;
    font-size: 0;
    opacity: 0;
}

.loader-circle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.1);
    margin-left: -50px;
    margin-top: -50px;
}

.loader-line-mask {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 50px;
    height: 100px;
    margin-left: -50px;
    margin-top: -50px;
    overflow: hidden;
    transform-origin: 50px 50px;
    -webkit-mask-image: -webkit-linear-gradient(top, #000000, rgba(0,0,0,0));
    mix-blend-mode: hard-light;
    opacity: 0.8;
}

    .loader-line-mask .loader-line {
        width: 100px;
        height: 100px;
        border-radius: 50%;
    }

    .loader-line-mask.one {
        animation: rotate 2s infinite linear;
    }

        .loader-line-mask.one .loader-line {
            box-shadow: inset 0 0 0 8px #00AEC7;
        }

    .loader-line-mask.two {
        animation: rotate 2s -1s infinite linear;
    }

        .loader-line-mask.two .loader-line {
            box-shadow: inset 0 0 0 8px #001871;
        }

@keyframes rotate {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadein {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .check-art {
        width: 560px;
        height: 560px;
        left: -10%;
        opacity: 0.55;
    }

    .login-wrap {
        left: 50%;
        transform: translate(-50%, -50%);
    }
}

@media (max-width: 640px) {
    .check-art {
        display: none;
    }

    .login-wrap {
        width: 88%;
    }

    h1.welcome {
        font-size: 28px;
    }
}
