/* Fondo público: landing, login, errores — colores vía variables (--sigeme-gradient-*) */
/* El scroll/fondo fijo vive en partials/public-page-scroll-bg.blade.php */

html:has(body.login-img) {
    height: auto !important;
    min-height: 100%;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

body.login-img {
    position: relative;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    min-height: 100vh;
    height: auto !important;
}

/* Compat: páginas que aún usan .page.bg-img con gradiente propio */
body.login-img:not(.landing-volgh-page):not(.auth-public-page) .bg-img {
    position: relative;
    display: block !important;
    min-height: 100vh;
    height: auto !important;
    background: var(--sigeme-gradient, linear-gradient(135deg, #5e2dd8 0%, #d43f8d 100%));
    overflow-x: hidden;
    overflow-y: visible;
    padding-bottom: 50px;
    background-attachment: scroll;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

body.login-img > .page.bg-img,
body.landing-volgh-page.login-img > .landing-volgh-page__shell.bg-img {
    display: block !important;
    flex: none !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
}

body.login-img:not(.landing-volgh-page):not(.auth-public-page) .bg-img {
    background-image:
        radial-gradient(ellipse 800px 600px at 10% 20%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse 600px 800px at 90% 80%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 500px 500px at 50% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        var(--sigeme-gradient, linear-gradient(135deg, #5e2dd8 0%, #d43f8d 100%));
}

/* ——— Estilo: curvas ——— */
body.sigeme-bg-style-curvas.login-img .bg-img::before {
    content: '';
    position: absolute;
    inset: 0;
    min-height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='1200' height='800' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='grad1' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:rgba(255,255,255,0.15);stop-opacity:1' /%3E%3Cstop offset='100%25' style='stop-color:rgba(255,255,255,0.05);stop-opacity:1' /%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0,400 Q300,200 600,400 T1200,400 L1200,800 L0,800 Z' fill='url(%23grad1)' opacity='0.6'/%3E%3Cpath d='M0,500 Q400,300 800,500 T1600,500 L1600,800 L0,800 Z' fill='url(%23grad1)' opacity='0.4'/%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    pointer-events: none;
    animation: sigeme-float 25s ease-in-out infinite;
}

body.sigeme-bg-style-curvas.login-img .bg-img::after {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 80%;
    height: 80%;
    min-height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='800' height='600' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='grad2' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:rgba(255,255,255,0.12);stop-opacity:1' /%3E%3Cstop offset='100%25' style='stop-color:rgba(255,255,255,0.03);stop-opacity:1' /%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0,200 Q200,0 400,200 T800,200 L800,600 L0,600 Z' fill='url(%23grad2)' opacity='0.5'/%3E%3C/svg%3E");
    background-size: contain;
    background-position: top right;
    background-repeat: no-repeat;
    z-index: 0;
    pointer-events: none;
    animation: sigeme-float-reverse 30s ease-in-out infinite;
}

/* ——— Estilo: ondas ——— */
body.sigeme-bg-style-ondas.login-img .bg-img::before {
    content: '';
    position: absolute;
    inset: 0;
    min-height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='rgba(255,255,255,0.12)' d='M0,192L48,197.3C96,203,192,213,288,229.3C384,245,480,267,576,250.7C672,235,768,181,864,181.3C960,181,1056,235,1152,234.7C1248,235,1344,181,1392,154.7L1440,128L1440,320L0,320Z'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-position: bottom;
    background-size: 100% auto;
    z-index: 0;
    pointer-events: none;
    animation: sigeme-wave-drift 18s ease-in-out infinite;
}

body.sigeme-bg-style-ondas.login-img .bg-img::after {
    content: '';
    position: absolute;
    inset: 0;
    min-height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='rgba(255,255,255,0.08)' d='M0,96L80,112C160,128,320,160,480,160C640,160,800,128,960,117.3C1120,107,1280,117,1360,122.7L1440,128L1440,0L0,0Z'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-position: top;
    background-size: 100% auto;
    z-index: 0;
    pointer-events: none;
}

/* ——— Estilo: círculos ——— */
body.sigeme-bg-style-circulos.login-img .bg-img::before {
    content: '';
    position: absolute;
    width: 55vmin;
    height: 55vmin;
    top: -10%;
    left: -8%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
    animation: sigeme-float 20s ease-in-out infinite;
}

body.sigeme-bg-style-circulos.login-img .bg-img::after {
    content: '';
    position: absolute;
    width: 70vmin;
    height: 70vmin;
    bottom: -15%;
    right: -12%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, transparent 68%);
    z-index: 0;
    pointer-events: none;
    animation: sigeme-float-reverse 24s ease-in-out infinite;
}

/* ——— Estilo: líneas ——— */
body.sigeme-bg-style-lineas.login-img .bg-img::before {
    content: '';
    position: absolute;
    inset: 0;
    min-height: 100%;
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.06) 0,
        rgba(255, 255, 255, 0.06) 2px,
        transparent 2px,
        transparent 14px
    );
    z-index: 0;
    pointer-events: none;
}

/* ——— Estilo: grid ——— */
body.sigeme-bg-style-grid.login-img .bg-img::before {
    content: '';
    position: absolute;
    inset: 0;
    min-height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 48px 48px;
    z-index: 0;
    pointer-events: none;
}

body.sigeme-bg-style-grid.login-img .bg-img::after {
    content: '';
    position: absolute;
    inset: 0;
    min-height: 100%;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.12) 100%);
    z-index: 0;
    pointer-events: none;
}

/* ——— Estilo: minimal ——— */
body.sigeme-bg-style-minimal.login-img .bg-img::before,
body.sigeme-bg-style-minimal.login-img .bg-img::after {
    display: none;
}

@keyframes sigeme-float {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
    50% { transform: translate(-30px, 30px) scale(1.05); opacity: 0.8; }
}

@keyframes sigeme-float-reverse {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); opacity: 0.4; }
    50% { transform: translate(20px, -20px) scale(1.03) rotate(5deg); opacity: 0.6; }
}

@keyframes sigeme-wave-drift {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-2%); }
}

body.login-img .bg-img > * {
    position: relative;
    z-index: 1;
}

.error-page {
    background-color: transparent !important;
}

.error-page .container,
.error-page .error-template {
    background-color: transparent !important;
}

.login-brand-box {
    background: #ffffff;
    padding: 20px 30px;
    border-radius: 5px;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.14), 0 4px 8px rgba(0, 0, 0, 0.06);
    display: block;
    margin: 0 auto 20px auto;
    width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-brand-box.login-width { max-width: 450px; }
.login-brand-box.register-width { max-width: 550px; }

.login-brand-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 6px 16px rgba(0, 0, 0, 0.1);
}

.login-brand-box a {
    text-decoration: none;
    color: inherit;
}

body.landing-volgh-page.login-img .landing-volgh-page__shell.bg-img > * {
    position: relative;
    z-index: 1;
}

/* Patrones decorativos sobre el fondo fijo (solo landing) */
body.landing-volgh-page.login-img.sigeme-bg-style-curvas .landing-volgh-page__shell.bg-img::before,
body.landing-volgh-page.login-img.sigeme-bg-style-ondas .landing-volgh-page__shell.bg-img::before,
body.landing-volgh-page.login-img.sigeme-bg-style-circulos .landing-volgh-page__shell.bg-img::before,
body.landing-volgh-page.login-img.sigeme-bg-style-lineas .landing-volgh-page__shell.bg-img::before,
body.landing-volgh-page.login-img.sigeme-bg-style-grid .landing-volgh-page__shell.bg-img::before {
    z-index: 0;
}

body.landing-volgh-page.login-img .landing-volgh-page__shell.bg-img::before,
body.landing-volgh-page.login-img .landing-volgh-page__shell.bg-img::after,
body.auth-public-page.login-img .landing-volgh-page__shell.bg-img::before,
body.auth-public-page.login-img .landing-volgh-page__shell.bg-img::after {
    position: fixed;
    pointer-events: none;
}

/* Vista previa en admin (contenedor local, sin afectar scroll del panel) */
.sigeme-landing-preview.login-img {
    position: relative;
    overflow: hidden;
    min-height: 220px;
    border-radius: 0.75rem;
}

.sigeme-landing-preview.login-img .bg-img {
    min-height: 220px;
    height: 100%;
    padding-bottom: 0;
}

.sigeme-landing-preview.login-img .bg-img::before,
.sigeme-landing-preview.login-img .bg-img::after {
    position: absolute;
    inset: 0;
    min-height: 100%;
}
