﻿/* ============================================================
   LOGIN EL TEJAR — cssLogin.css
   Panel blanco elegante + inputs blancos
   ============================================================ */

:root {
    --gold: #ffc107;
    --gold-light: #ffd75e;
    --gold-deep: #c8951a;
    --panel-bg: rgba(255, 255, 255, 0.96);
    --panel-edge: rgba(0, 0, 0, 0.08);
    --field-bg: #ffffff;
    --field-edge: rgba(0, 0, 0, 0.12);
    --text-hi: #1f2937;
    --text-lo: rgba(31, 41, 55, 0.62);
    --danger: #ff6b61;
    --success: #38c47f;
    --warning: #ffb020;
    --info: #4d9aff;
    --panel-w: 480px;
}

* {
    box-sizing: border-box;
}

html {
    background: #0e1526;
}

html,
body {
    height: 100%;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-x: hidden;
}

body {
    background: transparent;
}

    /* =========================
   FONDOS
========================= */

    body::before,
    body::after,
    body .bg-third {
        content: "";
        position: fixed;
        inset: 0;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        transform: scale(1.08);
        animation: bgMove 20s ease-in-out infinite alternate;
        pointer-events: none;
    }

    body::before {
        z-index: -3;
        opacity: 1;
        background-image: radial-gradient(circle at 15% 10%, rgba(0,0,0,0.25), rgba(0,0,0,0.55)), url('/Img/login1.jpg');
        animation: bgMove 20s ease-in-out infinite alternate, fade1 16s ease-in-out infinite;
    }

    body::after {
        z-index: -2;
        opacity: 0;
        background-image: radial-gradient(circle at 15% 10%, rgba(0,0,0,0.25), rgba(0,0,0,0.55)), url('/Img/login2.jpg');
        animation: bgMove 20s ease-in-out infinite alternate, fade2 16s ease-in-out infinite;
    }

    body .bg-third {
        z-index: -1;
        opacity: 0;
        background-image: radial-gradient(circle at 15% 10%, rgba(0,0,0,0.25), rgba(0,0,0,0.55)), url('/Img/login3.jpg');
        animation: bgMove 20s ease-in-out infinite alternate, fade3 16s ease-in-out infinite;
    }

@keyframes bgMove {
    0% {
        transform: scale(1.12) translate(0px, 0px);
    }

    50% {
        transform: scale(1.18) translate(-18px, -10px);
    }

    100% {
        transform: scale(1.14) translate(10px, -14px);
    }
}

@keyframes fade1 {
    0%, 30% {
        opacity: 1;
    }

    40%, 95% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes fade2 {
    0%, 30% {
        opacity: 0;
    }

    40%, 62% {
        opacity: 1;
    }

    72%, 100% {
        opacity: 0;
    }
}

@keyframes fade3 {
    0%, 62% {
        opacity: 0;
    }

    72%, 92% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    body::before,
    body::after,
    body .bg-third,
    .toast-item,
    .panel-inner,
    .hero-content > *,
    .login-panel,
    .logo-ring {
        animation-duration: 0.01s !important;
    }
}

/* ============================================================
   LAYOUT
   ============================================================ */

.login-split {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
}

/* ----- Hero izquierda ----- */

.login-hero {
    flex: 1;
    display: flex;
    align-items: flex-end;
    padding: 64px;
}

.hero-content {
    max-width: 560px;
}

    .hero-content > * {
        animation: heroUp .8s ease both;
    }

        .hero-content > *:nth-child(2) {
            animation-delay: .12s;
        }

        .hero-content > *:nth-child(3) {
            animation-delay: .24s;
        }

@keyframes heroUp {
    from {
        opacity: 0;
        transform: translateY(22px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-eyebrow {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--gold);
    background: rgba(0, 0, 0, .42);
    border: 1px solid rgba(255, 193, 7, .45);
    border-radius: 99px;
    padding: 6px 14px;
    margin-bottom: 14px;
    backdrop-filter: blur(4px);
}

.hero-title {
    font-family: 'Sora', sans-serif;
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -.02em;
    margin: 0 0 8px;
    text-shadow: 0 4px 30px rgba(0, 0, 0, .55);
}

.hero-sub {
    color: rgba(255, 255, 255, .88);
    font-size: 1.05rem;
    margin: 0;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .5);
}

/* ============================================================
   PANEL DERECHO BLANCO
   ============================================================ */

.login-panel {
    position: relative;
    width: var(--panel-w);
    min-height: 100vh;
    flex-shrink: 0;
    background: linear-gradient( 180deg, rgba(255, 255, 255, 0.98), rgba(245, 246, 248, 0.96) );
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-left: 1px solid var(--panel-edge);
    box-shadow: -25px 0 60px rgba(0, 0, 0, .25);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 48px;
    overflow: hidden;
    overflow-y: auto;
    animation: panelIn .65s cubic-bezier(.2, .9, .3, 1) both;
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: translateX(70px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Brillo dorado suave */

.panel-glow {
    position: absolute;
    top: -150px;
    right: -150px;
    width: 390px;
    height: 390px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 193, 7, .22), transparent 65%);
    pointer-events: none;
    animation: glowPulse 6s ease-in-out infinite alternate;
}

@keyframes glowPulse {
    from {
        opacity: .55;
        transform: scale(1);
    }

    to {
        opacity: .95;
        transform: scale(1.15);
    }
}

.panel-inner {
    position: relative;
    width: 100%;
    max-width: 340px;
    z-index: 1;
}

    .panel-inner.shake {
        animation: shake .45s ease both;
    }

@keyframes shake {
    10%, 90% {
        transform: translateX(-2px);
    }

    20%, 80% {
        transform: translateX(4px);
    }

    30%, 50%, 70% {
        transform: translateX(-6px);
    }

    40%, 60% {
        transform: translateX(6px);
    }
}

/* ============================================================
   HEADER LOGIN
   ============================================================ */

.panel-header {
    text-align: center;
    margin-bottom: 36px;
}

.brand-logo {
    position: relative;
    width: 84px;
    height: 84px;
    margin: 0 auto 18px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(255, 193, 7, .22), rgba(255, 193, 7, .06));
    border: 1px solid rgba(255, 193, 7, .45);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .85);
}

    .brand-logo img {
        width: 48px;
        height: 48px;
    }

.logo-ring {
    position: absolute;
    inset: -7px;
    border-radius: 28px;
    border: 1.5px dashed rgba(255, 193, 7, .45);
    animation: spinRing 14s linear infinite;
    pointer-events: none;
}

@keyframes spinRing {
    to {
        transform: rotate(360deg);
    }
}

.panel-header h2 {
    font-family: 'Sora', sans-serif;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-hi);
    letter-spacing: -.02em;
    margin: 0 0 5px;
}

.panel-header p {
    color: var(--text-lo);
    font-size: .9rem;
    margin: 0;
}

/* ============================================================
   CAMPOS LOGIN
   ============================================================ */

.field-group {
    margin-bottom: 20px;
}

.field-label {
    display: block;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold);
    margin: 0 0 8px 4px;
}

.field-shell {
    position: relative;
    display: flex;
    align-items: center;
    height: 54px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease;
}

    .field-shell:hover {
        border-color: rgba(255, 193, 7, 0.65);
    }

    .field-shell:focus-within {
        background: #ffffff;
        border-color: var(--gold);
        box-shadow: 0 0 0 4px rgba(255, 193, 7, .22), 0 12px 28px rgba(0, 0, 0, .12);
        transform: translateY(-1px);
    }

.field-ico {
    width: 48px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: .95rem;
    flex-shrink: 0;
    transition: color .2s ease, transform .2s ease;
}

.field-shell:focus-within .field-ico {
    color: var(--gold-deep);
    transform: scale(1.08);
}

.field-shell .login-field {
    flex: 1;
    width: 100%;
    height: 54px;
    padding: 0 12px;
    border: 0 !important;
    outline: none !important;
    background: #ffffff !important;
    box-shadow: none !important;
    font-size: .95rem;
    font-weight: 500;
    color: #1f2937 !important;
    caret-color: var(--gold);
}

    .field-shell .login-field::placeholder {
        color: rgba(31, 41, 55, 0.40);
    }

    .field-shell .login-field:focus {
        background: #ffffff !important;
        color: #1f2937 !important;
        outline: none !important;
    }

    /* Quita el azul oscuro del autocompletado del navegador */

    .field-shell .login-field:-webkit-autofill,
    .field-shell .login-field:-webkit-autofill:hover,
    .field-shell .login-field:-webkit-autofill:focus,
    .field-shell .login-field:-webkit-autofill:active {
        -webkit-text-fill-color: #1f2937 !important;
        -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
        box-shadow: 0 0 0 1000px #ffffff inset !important;
        background-color: #ffffff !important;
        border-radius: 0 !important;
        transition: background-color 9999s ease-in-out 0s;
    }

/* Ojo password */

.input-eye {
    width: 50px;
    height: 54px;
    margin-right: 0;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    flex-shrink: 0;
    background: #ffffff;
    transition: background .18s ease, color .18s ease;
    user-select: none;
}

    .input-eye:hover {
        background: rgba(255, 193, 7, .12);
        color: var(--gold-deep);
        transform: none;
    }

    .input-eye .material-icons {
        font-size: 20px;
    }

/* Caps lock */

.caps-hint {
    margin-top: 8px;
    font-size: .76rem;
    font-weight: 700;
    color: #9a6500;
    background: rgba(255, 176, 32, .14);
    border: 1px solid rgba(255, 176, 32, .35);
    border-radius: 8px;
    padding: 5px 10px;
    display: inline-block;
    animation: capsIn .2s ease both;
}

@keyframes capsIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.caps-hint.d-none {
    display: none;
}

/* ============================================================
   BOTÓN ACCEDER
   ============================================================ */

.login-btn {
    position: relative;
    width: 100%;
    border: 0;
    border-radius: 16px;
    padding: 15px 16px;
    margin-top: 10px;
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    color: #241a02;
    background: linear-gradient(180deg, var(--gold-light), var(--gold));
    box-shadow: 0 14px 34px rgba(255, 193, 7, .34), inset 0 1px 0 rgba(255, 255, 255, .5);
    cursor: pointer;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

    .login-btn::after {
        content: "";
        position: absolute;
        top: 0;
        left: -80%;
        width: 50%;
        height: 100%;
        background: linear-gradient( 100deg, transparent, rgba(255, 255, 255, .6), transparent );
        transform: skewX(-20deg);
        transition: left .5s ease;
    }

    .login-btn:hover {
        transform: translateY(-2px);
        filter: brightness(1.05);
        box-shadow: 0 18px 40px rgba(255, 193, 7, .44), inset 0 1px 0 rgba(255, 255, 255, .5);
    }

        .login-btn:hover::after {
            left: 130%;
        }

    .login-btn:active {
        transform: translateY(0) scale(.99);
    }

    .login-btn:focus {
        outline: 3px solid rgba(255, 193, 7, .5);
        outline-offset: 3px;
    }

/* ============================================================
   FOOTER PANEL
   ============================================================ */

.panel-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--text-lo);
    font-size: .78rem;
    margin-top: 26px;
}

.dot-secure {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(56, 196, 127, .5);
    animation: securePulse 2s ease-out infinite;
}

@keyframes securePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 196, 127, .5);
    }

    70% {
        box-shadow: 0 0 0 7px rgba(56, 196, 127, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(56, 196, 127, 0);
    }
}

/* ============================================================
   NOTIFICACIONES PUSH
   ============================================================ */

#toastStack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(360px, calc(100vw - 36px));
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(18, 26, 48, .96);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, .12);
    border-left: 4px solid var(--info);
    border-radius: 14px;
    padding: 14px 14px 16px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .5);
    position: relative;
    overflow: hidden;
    animation: toastIn .38s cubic-bezier(.2, .9, .3, 1.2) both;
}

    .toast-item.leaving {
        animation: toastOut .28s ease-in forwards;
    }

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(60px) scale(.96);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(70px) scale(.95);
    }
}

.toast-item.t-error {
    border-left-color: var(--danger);
}

.toast-item.t-success {
    border-left-color: var(--success);
}

.toast-item.t-warning {
    border-left-color: var(--warning);
}

.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .95rem;
    color: #ffffff;
    background: var(--info);
}

.t-error .toast-icon {
    background: var(--danger);
}

.t-success .toast-icon {
    background: var(--success);
}

.t-warning .toast-icon {
    background: var(--warning);
    color: #241a02;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: .88rem;
    color: #ffffff;
    margin: 0 0 2px;
}

.toast-msg {
    font-size: .82rem;
    color: rgba(235, 240, 235, .7);
    margin: 0;
    line-height: 1.45;
    word-wrap: break-word;
}

.toast-close {
    background: none;
    border: 0;
    color: rgba(235, 240, 235, .45);
    cursor: pointer;
    font-size: .85rem;
    padding: 2px 4px;
    line-height: 1;
    flex-shrink: 0;
}

    .toast-close:hover {
        color: #ffffff;
    }

.toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    transform-origin: left;
    background: currentColor;
    opacity: .5;
    animation: toastBar linear forwards;
}

.t-error .toast-progress {
    color: var(--danger);
}

.t-success .toast-progress {
    color: var(--success);
}

.t-warning .toast-progress {
    color: var(--warning);
}

.t-info .toast-progress {
    color: var(--info);
}

@keyframes toastBar {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

/* ============================================================
   LOADING
   ============================================================ */

.login-loading {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(8px);
}

    .login-loading.d-none {
        display: none;
    }

.login-loading-card {
    width: 290px;
    border-radius: 20px;
    padding: 24px 18px 20px;
    text-align: center;
    background: rgba(18, 26, 48, .96);
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
}

.login-loading-logo {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 193, 7, .16);
    border: 1px solid rgba(255, 193, 7, .35);
    animation: pulseLogo 1.1s ease-in-out infinite;
}

    .login-loading-logo img {
        width: 46px;
        height: 46px;
    }

@keyframes pulseLogo {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

.login-loading-text {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    color: #ffffff;
    font-size: .95rem;
    margin-bottom: 14px;
}

.login-loading-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    overflow: hidden;
    position: relative;
}

    .login-loading-bar::before {
        content: "";
        position: absolute;
        inset: 0;
        width: 40%;
        border-radius: 999px;
        background: linear-gradient(90deg, var(--gold), var(--gold-light));
        animation: loadingBar 1.2s ease-in-out infinite;
    }

@keyframes loadingBar {
    0% {
        transform: translateX(-120%);
    }

    50% {
        transform: translateX(110%);
    }

    100% {
        transform: translateX(260%);
    }
}

/* ============================================================
   MODAL CONTRASEÑA
   ============================================================ */

.pass-modal {
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 18px;
    overflow: hidden;
    background: #ffffff;
    color: var(--text-hi);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
}

    .pass-modal .modal-header {
        background: rgba(255, 193, 7, .12);
        border-bottom: 1px solid rgba(0, 0, 0, .08);
        color: var(--text-hi);
    }

        .pass-modal .modal-header .close {
            color: var(--text-hi);
            opacity: .7;
            text-shadow: none;
        }

    .pass-modal .modal-title {
        font-family: 'Sora', sans-serif;
        font-size: 1.02rem;
        font-weight: 800;
    }

    .pass-modal .modal-body label {
        color: var(--text-hi);
        font-weight: 700;
    }

.pass-hint {
    font-size: .8rem;
    color: #8a6500;
    background: rgba(255, 193, 7, .12);
    border: 1px solid rgba(255, 193, 7, .3);
    border-radius: 10px;
    padding: 9px 12px;
    margin: 8px 0 16px;
}

.modal-shell {
    margin-bottom: 12px;
}

.pass-modal .modal-footer {
    border-top: 1px solid rgba(0, 0, 0, .08);
}

.pass-modal .btn-light {
    background: #f4f5f7;
    border: 1px solid rgba(0, 0, 0, .08);
    color: var(--text-hi);
    border-radius: 10px;
}

    .pass-modal .btn-light:hover {
        background: #e9ecef;
        color: var(--text-hi);
    }

.btn-save {
    background: linear-gradient(180deg, var(--gold-light), var(--gold));
    border: 0;
    color: #241a02;
    font-weight: 800;
    border-radius: 10px;
    padding: 8px 24px;
    box-shadow: 0 8px 20px rgba(255, 193, 7, .3);
}

    .btn-save:hover {
        filter: brightness(1.05);
        color: #241a02;
    }

/* Medidor fuerza contraseña */

.strength-wrap {
    margin-top: 4px;
}

    .strength-wrap small {
        color: var(--text-lo) !important;
    }

.strength-bar {
    height: 6px;
    border-radius: 99px;
    background: rgba(0, 0, 0, .08);
    overflow: hidden;
    margin-bottom: 6px;
}

    .strength-bar span {
        display: block;
        height: 100%;
        width: 0%;
        border-radius: 99px;
        background: rgba(255, 193, 7, .8);
        transition: width .3s ease, background .3s ease;
    }

/* ============================================================
   MODO PRUEBAS
   ============================================================ */

.watermark-pruebas {
    display: none;
}

body.modo-pruebas .watermark-pruebas {
    display: block;
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    font-size: 120px;
    font-weight: 900;
    letter-spacing: 18px;
    color: rgba(255, 0, 0, 0.18);
    transform: rotate(-25deg);
    user-select: none;
    text-transform: uppercase;
    font-family: 'Sora', Arial, sans-serif;
    text-shadow: 0 0 10px rgba(255,0,0,0.15), 0 0 25px rgba(255,0,0,0.10);
}

body.modo-pruebas .watermark-1 {
    top: 12%;
    left: 8%;
}

body.modo-pruebas .watermark-2 {
    top: 45%;
    left: 28%;
}

body.modo-pruebas .watermark-3 {
    bottom: 8%;
    right: 5%;
}

body.modo-pruebas .login-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: repeating-linear-gradient( 45deg, var(--warning) 0 14px, #141c34 14px 28px );
    z-index: 2;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1100px) {
    :root {
        --panel-w: 430px;
    }

    .login-hero {
        padding: 44px;
    }
}

@media (max-width: 768px) {
    .login-split {
        flex-direction: column;
    }

    .login-hero {
        flex: none;
        min-height: 24vh;
        align-items: flex-end;
        padding: 22px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-sub {
        font-size: .92rem;
    }

    .login-panel {
        width: 100%;
        min-height: 76vh;
        border-left: 0;
        border-top: 1px solid var(--panel-edge);
        border-radius: 28px 28px 0 0;
        box-shadow: 0 -25px 70px rgba(0, 0, 0, .30);
        padding: 42px 26px;
        animation-name: panelUp;
    }

    @keyframes panelUp {
        from {
            opacity: 0;
            transform: translateY(60px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    body.modo-pruebas .watermark-pruebas {
        font-size: 64px;
        letter-spacing: 10px;
    }
}

@media (max-width: 400px) {
    .login-panel {
        padding: 34px 20px;
    }

    .panel-header {
        margin-bottom: 28px;
    }

    .hero-eyebrow {
        display: none;
    }

    .brand-logo {
        width: 72px;
        height: 72px;
    }

        .brand-logo img {
            width: 42px;
            height: 42px;
        }
}
