/* Cumbre Alta Design System: acceso ERP */

:root {
    --login-accent: #ffe000;
    --login-night-950: #080c14;
    --login-night-900: #0d121d;
    --login-panel: rgba(18, 24, 36, 0.88);
    --login-line: rgba(148, 163, 184, 0.25);
    --login-text: #f8fafc;
    --login-muted: #9aa6b8;
    --login-soft: #69768b;
    --login-danger: #ffb4b4;
    --login-font: 'Manrope', sans-serif;
    --login-mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    min-height: 100dvh;
    overflow-x: hidden;
    font-family: var(--login-font);
    color: var(--login-text);
    background: var(--login-night-950);
}

body.login-page {
    display: grid;
    place-items: center;
    min-height: 100dvh;
    padding: 1.25rem;
}

body button,
body input { font-family: var(--login-font); }
body .hidden { display: none !important; }

body .login-card {
    position: relative;
    width: min(100%, 480px);
    max-width: 480px;
    margin: 0;
    padding: 1.2rem 2rem 1.35rem;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 1.45rem;
    background: linear-gradient(145deg, rgba(24, 31, 46, 0.92), var(--login-panel));
    box-shadow: 0 2rem 4.5rem rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    opacity: 0;
    transform: translateY(2rem);
    z-index: 1;
}

body .login-card::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 18%;
    right: 18%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 224, 0, 0.7), transparent);
    box-shadow: 0 0 1.25rem rgba(255, 224, 0, 0.52);
}

body .login-card::after {
    content: "";
    position: absolute;
    right: -10rem;
    bottom: -12rem;
    width: 22rem;
    height: 22rem;
    border-radius: 50%;
    background: rgba(255, 224, 0, 0.035);
    filter: blur(35px);
    pointer-events: none;
}

body #pageBg,
body #pagePattern,
body #coldOrb1,
body #coldOrb2 {
    position: fixed;
    inset: 0;
    pointer-events: none;
    transition: opacity 300ms ease, background 300ms ease, filter 300ms ease;
}

body #pageBg {
    z-index: -5;
    background:
        radial-gradient(circle at 9% 44%, rgba(255, 208, 0, 0.17), transparent 22rem),
        radial-gradient(circle at 88% 82%, rgba(255, 204, 0, 0.13), transparent 20rem),
        radial-gradient(circle at 50% -10%, rgba(37, 53, 78, 0.32), transparent 36rem),
        linear-gradient(135deg, #151b28 0%, #0c111b 48%, #080c14 100%);
}

body #pagePattern {
    z-index: -4;
    opacity: 0.58;
    background-image: radial-gradient(rgba(211, 221, 236, 0.22) 0.7px, transparent 0.8px);
    background-size: 27px 27px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 80%);
}

body #pagePattern::before,
body #pagePattern::after {
    content: "";
    position: absolute;
    width: 54rem;
    height: 29rem;
    border: 1px solid rgba(255, 224, 0, 0.14);
    border-radius: 50%;
    transform: rotate(-28deg);
}

body #pagePattern::before { top: -10rem; left: -19rem; }
body #pagePattern::after { right: -18rem; bottom: -9rem; transform: rotate(28deg); }

body #coldOrb1 {
    z-index: -3;
    inset: auto auto 43% -16rem;
    width: 30rem;
    height: 30rem;
    border-radius: 50%;
    background: rgba(255, 224, 0, 0.1);
    filter: blur(90px);
}

body #coldOrb2 {
    z-index: -3;
    inset: auto -15rem -12rem auto;
    width: 28rem;
    height: 28rem;
    border-radius: 50%;
    background: rgba(255, 213, 61, 0.08);
    filter: blur(100px);
}

body .login-topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 2.5rem;
}

body .language-switch,
body .theme-toggle {
    position: static;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(148, 163, 184, 0.42);
    border-radius: 0.8rem;
    background: rgba(11, 16, 26, 0.45);
    color: var(--login-muted);
}

body .language-switch {
    gap: 0.15rem;
    padding: 0.2rem;
    overflow: hidden;
}

body .language-switch button {
    min-width: 2.65rem;
    min-height: 1.85rem;
    padding: 0.3rem 0.55rem;
    border: 0;
    border-radius: 0.55rem;
    color: var(--login-muted);
    background: transparent;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    cursor: pointer;
    appearance: none;
    transition: background 200ms ease, color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

body .language-switch button:hover:not(.is-active) { color: var(--login-text); background: rgba(148, 163, 184, 0.1); }
body .language-switch button:active { transform: translateY(1px); }
body .language-switch button.is-active {
    color: #202733;
    background: var(--login-accent);
    box-shadow: 0 0.3rem 0.8rem rgba(255, 224, 0, 0.16);
}

body .theme-toggle {
    gap: 0.5rem;
    padding: 0.58rem 0.88rem;
    color: var(--login-text);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 200ms ease, border-color 200ms ease, background 200ms ease;
}

body .theme-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 224, 0, 0.55);
}

body .language-switch button:focus-visible,
body .theme-toggle:focus-visible,
body .password-toggle:focus-visible,
body .forgot-link:focus-visible {
    outline: 2px solid rgba(255, 224, 0, 0.84);
    outline-offset: 3px;
}

body .theme-toggle svg { width: 1rem; height: 1rem; stroke-width: 1.8; }

body .login-heading {
    position: relative;
    z-index: 1;
    margin: 1rem 0 1.2rem;
    text-align: center;
}

body .logo-halo {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 4.85rem;
    height: 4.85rem;
    margin-bottom: 0.65rem;
    border-radius: 50%;
    background: rgba(255, 224, 0, 0.09);
    box-shadow: 0 0 2rem rgba(255, 224, 0, 0.09);
}

body .logo-halo::before {
    content: "";
    position: absolute;
    inset: -0.35rem;
    border: 1px solid rgba(255, 224, 0, 0.18);
    border-radius: 50%;
}

body #loginLogo {
    position: relative;
    width: 4.6rem;
    height: 4.6rem;
    object-fit: contain;
    filter: drop-shadow(0 0.8rem 1rem rgba(0, 0, 0, 0.28));
}

body .login-title {
    margin: 0;
    color: var(--login-text);
    font-family: var(--login-font);
    font-size: clamp(1.9rem, 4vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.055em;
}

body .status-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: min(100%, 22rem);
    margin: 0.8rem auto 0;
    padding: 0.48rem 0.8rem;
    border: 1px solid rgba(255, 224, 0, 0.42);
    border-radius: 999px;
    color: #282b1e;
    background: linear-gradient(90deg, #ffd500, #ffe900, #ffd500);
    box-shadow: 0 0.65rem 1.8rem rgba(255, 224, 0, 0.1);
    font-family: var(--login-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

body .status-chip svg { width: 0.92rem; height: 0.92rem; stroke-width: 2.2; }

body #formLogin {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0.82rem;
}

body #formLogin > .group {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 4.2rem;
    padding: 0.7rem 1.05rem;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 0.95rem;
    background: rgba(20, 27, 40, 0.68);
    transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

body #formLogin > .group:focus-within {
    border-color: rgba(255, 224, 0, 0.8);
    background: rgba(23, 31, 46, 0.92);
    box-shadow: 0 0 0 3px rgba(255, 224, 0, 0.1);
}

body #formLogin > .group > div:first-child {
    position: static;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    width: auto;
    height: auto;
    padding: 0;
    pointer-events: none;
}

body #formLogin > .group > div:first-child svg {
    width: 1.35rem;
    height: 1.35rem;
    margin-right: 0.95rem;
    color: var(--login-accent);
    stroke-width: 2;
}

body .field-content { min-width: 0; flex: 1; }
body .field-content label {
    display: block;
    margin-bottom: 0.12rem;
    color: #dce3ee;
    font-size: 0.72rem;
    font-weight: 700;
}

body #formLogin input[type="text"],
body #formLogin input[type="password"] {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    outline: 0;
    color: var(--login-text);
    background: transparent;
    box-shadow: none;
    font-size: 1rem;
    font-weight: 600;
}

body #formLogin input[type="text"]::placeholder,
body #formLogin input[type="password"]::placeholder { color: #7c879a; font-weight: 500; }

body .password-toggle {
    position: static;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    margin-left: 0.55rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 0.55rem;
    color: #8591a5;
    background: transparent;
    cursor: pointer;
    appearance: none;
    transition: color 200ms ease, background 200ms ease, border-color 200ms ease, transform 200ms ease;
}

body .password-toggle:hover { color: var(--login-accent); border-color: rgba(255, 224, 0, 0.26); background: rgba(255, 224, 0, 0.08); }
body .password-toggle:active { transform: translateY(1px); }
body .password-toggle svg { width: 1.3rem; height: 1.3rem; stroke-width: 2; }

body .remember-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 3.9rem;
    padding: 0.78rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 0.95rem;
    color: var(--login-text);
    background: rgba(20, 27, 40, 0.58);
    cursor: pointer;
    transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

body .remember-option:hover { border-color: rgba(255, 224, 0, 0.5); background: rgba(25, 33, 48, 0.8); }
body .remember-copy { min-width: 0; }
body .remember-title {
    display: flex;
    align-items: center;
    gap: 0.58rem;
    color: var(--login-text);
    font-size: 0.86rem;
    font-weight: 800;
}

body .remember-title svg { width: 1.25rem; height: 1.25rem; color: var(--login-accent); stroke-width: 2; }
body .remember-subtitle {
    display: block;
    margin-top: 0.16rem;
    color: var(--login-muted);
    font-size: 0.7rem;
    line-height: 1.4;
}

body .remember-checkbox { position: absolute; width: 1px; height: 1px; opacity: 0; }
body .remember-switch {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    width: 2.85rem;
    height: 1.6rem;
    border: 1px solid rgba(148, 163, 184, 0.44);
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.3);
    transition: background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

body .remember-switch::after {
    content: "";
    position: absolute;
    top: 0.18rem;
    left: 0.18rem;
    width: 1.12rem;
    height: 1.12rem;
    border-radius: 50%;
    background: #eef2f7;
    box-shadow: 0 0.15rem 0.45rem rgba(0, 0, 0, 0.32);
    transition: transform 200ms ease;
}

body .remember-checkbox:checked + .remember-switch {
    border-color: var(--login-accent);
    background: var(--login-accent);
    box-shadow: 0 0 0 3px rgba(255, 224, 0, 0.12);
}

body .remember-checkbox:checked + .remember-switch::after { transform: translateX(1.2rem); }
body .remember-checkbox:focus-visible + .remember-switch { outline: 2px solid rgba(255, 224, 0, 0.82); outline-offset: 3px; }

body #adminDeviceSessionOption,
body #adminDeviceSessionOptionWrap { display: none; }

body .login-actions {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.05rem;
}

body .forgot-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.48rem;
    justify-self: center;
    min-height: 2.35rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 0.65rem;
    color: #a8bdd8;
    background: rgba(20, 27, 40, 0.42);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    appearance: none;
    transition: color 200ms ease, border-color 200ms ease, background 200ms ease, transform 200ms ease;
}

body .forgot-link:hover {
    color: var(--login-accent);
    border-color: rgba(255, 224, 0, 0.42);
    background: rgba(255, 224, 0, 0.07);
    transform: translateY(-1px);
}
body .forgot-link:active { transform: translateY(0); }
body .forgot-link svg { width: 1rem; height: 1rem; stroke-width: 2; }

body .portal-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 3.1rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 0.85rem;
    color: #e3e9f2;
    background: rgba(20, 27, 40, 0.44);
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
    transition: border-color 200ms ease, color 200ms ease, background 200ms ease, transform 200ms ease;
}

body .portal-link:hover { color: var(--login-accent); border-color: rgba(255, 224, 0, 0.46); background: rgba(255, 224, 0, 0.045); transform: translateY(-1px); }
body .portal-link svg { width: 1.2rem; height: 1.2rem; stroke-width: 1.8; }

body .btn-login {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.58rem;
    min-height: 3.65rem;
    margin-top: 0.05rem;
    overflow: hidden;
    border-radius: 0.85rem;
    color: #202733;
    background: linear-gradient(100deg, #ffd000 0%, #ffe900 52%, #ffd000 100%) !important;
    box-shadow: 0 0.9rem 1.7rem rgba(255, 208, 0, 0.15);
    font-size: 0.93rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 200ms ease, box-shadow 200ms ease, opacity 200ms ease;
}

body .btn-login:hover { transform: translateY(-2px); box-shadow: 0 1.1rem 2rem rgba(255, 208, 0, 0.28); }
body .btn-login span, body .btn-login svg { position: relative; z-index: 1; }
body .btn-login svg { width: 1.18rem; height: 1.18rem; stroke-width: 2.2; }
body .is-spinning { animation: login-spin 900ms linear infinite; }
@keyframes login-spin { to { transform: rotate(360deg); } }

body #mensajeError {
    padding: 0.8rem 0.9rem;
    border: 1px solid rgba(248, 113, 113, 0.32);
    border-radius: 0.7rem;
    color: var(--login-danger);
    background: rgba(127, 29, 29, 0.2);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
}

body #mensajeError svg { display: inline-block; width: 0.95rem; height: 0.95rem; margin-right: 0.25rem; vertical-align: -0.15rem; }

body .login-footer {
    margin-top: 1.2rem;
    padding-top: 0.95rem;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    color: #66758b;
    font-family: var(--login-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.13em;
    line-height: 1.8;
    text-align: center;
    text-transform: uppercase;
}

body .login-footer a { color: inherit; text-decoration: none; transition: color 200ms ease; }
body .login-footer a:hover { color: var(--login-accent); }

body.theme-light {
    color: #172033;
    background: #eef2f7;
}

body.theme-light #pageBg {
    background:
        radial-gradient(circle at 8% 42%, rgba(255, 208, 0, 0.2), transparent 22rem),
        radial-gradient(circle at 90% 80%, rgba(148, 163, 184, 0.24), transparent 22rem),
        linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
}

body.theme-light #pagePattern { opacity: 0.3; background-image: radial-gradient(rgba(71, 85, 105, 0.2) 0.7px, transparent 0.8px); }
body.theme-light #pagePattern::before,
body.theme-light #pagePattern::after { border-color: rgba(146, 112, 0, 0.17); }

body.theme-light .login-card {
    border-color: rgba(100, 116, 139, 0.28);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 2rem 4rem rgba(51, 65, 85, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

body.theme-light .language-switch,
body.theme-light .theme-toggle,
body.theme-light #formLogin > .group,
body.theme-light .remember-option,
body.theme-light .portal-link { background: rgba(248, 250, 252, 0.9); }

body.theme-light .language-switch,
body.theme-light .theme-toggle { border-color: rgba(100, 116, 139, 0.35); color: #475569; }
body.theme-light .language-switch button.is-active { color: #172033; background: var(--login-accent); }
body.theme-light .login-title,
body.theme-light .remember-title,
body.theme-light .portal-link { color: #172033; }
body.theme-light #formLogin > .group { border-color: rgba(100, 116, 139, 0.28); }
body.theme-light #formLogin > .group:focus-within { background: #fff; }
body.theme-light .field-content label { color: #475569; }
body.theme-light #formLogin input[type="text"],
body.theme-light #formLogin input[type="password"] { color: #172033; }
body.theme-light #formLogin input[type="text"]::placeholder,
body.theme-light #formLogin input[type="password"]::placeholder { color: #94a3b8; }
body.theme-light .remember-subtitle { color: #64748b; }
body.theme-light .remember-option:hover { background: #fff; }
body.theme-light .forgot-link { color: #52739a; background: rgba(248, 250, 252, 0.92); border-color: rgba(100, 116, 139, 0.24); }
body.theme-light .forgot-link:hover { color: #172033; border-color: rgba(146, 112, 0, 0.48); background: rgba(255, 224, 0, 0.18); }
body.theme-light .portal-link { border-color: rgba(100, 116, 139, 0.25); }
body.theme-light .login-footer { border-color: rgba(100, 116, 139, 0.2); color: #64748b; }

body.theme-dark input:-webkit-autofill,
body.theme-dark input:-webkit-autofill:hover,
body.theme-dark input:-webkit-autofill:focus,
body.theme-dark input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #141b29 inset !important;
    -webkit-text-fill-color: #f8fafc !important;
    transition: background-color 5000s ease-in-out 0s;
}

body.theme-light input:-webkit-autofill,
body.theme-light input:-webkit-autofill:hover,
body.theme-light input:-webkit-autofill:focus,
body.theme-light input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #f8fafc inset !important;
    -webkit-text-fill-color: #172033 !important;
    transition: background-color 5000s ease-in-out 0s;
}

@media (max-width: 640px) {
    body.login-page { padding: 0.75rem; }
    body .login-card { width: min(100%, 480px); padding: 1rem 1.1rem 1.2rem; border-radius: 1.2rem; }
    body .login-heading { margin-top: 1rem; margin-bottom: 1.15rem; }
    body .logo-halo { width: 4.8rem; height: 4.8rem; }
    body #loginLogo { width: 4.55rem; height: 4.55rem; }
    body .login-title { font-size: 2rem; }
    body .status-chip { font-size: 0.63rem; }
    body #formLogin > .group { min-height: 4.25rem; }
    body .login-footer { margin-top: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
    body *, body *::before, body *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
