/* =========================
   AUTH V2 (layout tipo demo)
========================= */

body.auth.auth-v2 {
    min-height: 100vh;
    background: #0b1220;
    overflow-x: hidden;
}

body.auth.auth-v2 main {
    display: grid !important;
    place-items: center !important;
    min-height: 100vh !important;
    padding: 24px !important;

    /* neutraliza grids/areas del theme */
    grid-template-areas: none !important;
    grid-template-rows: none !important;
    grid-template-columns: none !important;
}

html,
body {
    height: 100%;
}

/* Shell centrado */
.auth-shell {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: clamp(8px, 1.2vw, 16px);
}

/* Tarjeta principal */
.auth-panel {
    width: min(1400px, 98%);
    height: min(88vh, 760px);
    min-height: 560px;
    background: rgba(255, 255, 255, .92);
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .25);
    border: 1px solid rgba(255, 255, 255, .22);
    backdrop-filter: blur(10px);
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    overflow: hidden;
}

/* =========================
LEFT
========================= */

.auth-left {
    position: relative;
    background: var(--primary-gradient);
    padding: 48px;
    color: #fff;
    display: flex;
    align-items: center;
}

.auth-left::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at 30% 35%, rgba(255, 255, 255, .18), transparent 45%);
    transform: rotate(12deg);
}

.auth-left-inner {
    position: relative;
    z-index: 2;
    max-width: 560px;
}

.auth-left-logo {
    width: 170px;
    height: auto;
    margin-bottom: 28px;
    /* filter: drop-shadow(0 10px 25px rgba(0, 0, 0, .18)); */
    filter: brightness(0) invert(1) drop-shadow(0 4px 14px rgba(0, 0, 0, .45));
}

.auth-left-title {
    font-size: 34px;
    line-height: 1.15;
    font-weight: 800;
    margin: 0 0 10px 0;
    letter-spacing: -0.02em;
}

.auth-left-subtitle {
    margin: 0;
    opacity: .92;
    font-size: 14px;
    max-width: 450px;
}

/* Mockup (dashboard flotante) */
.auth-mock {
    margin-top: 40px;
    width: 100%;
    display: flex;
    justify-content: center;
    perspective: 1200px;
}

.auth-mock img {
    width: min(680px, 100%);
    height: auto;

    /* importante para PNG con transparencia */
    background: transparent !important;
    border: 0 !important;

    /* look flotante */
    transform: rotate(-7deg) translateY(4px);
    filter: drop-shadow(0 28px 55px rgba(0, 0, 0, .35));
    transition: transform .6s ease, filter .6s ease;
}

/* efecto suave al hover del panel izquierdo */
.auth-left:hover .auth-mock img {
    transform: rotate(-4deg) translateY(0) scale(1.02);
    filter: drop-shadow(0 34px 70px rgba(0, 0, 0, .42));
}

/* =========================
   RIGHT
========================= */

.auth-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 54px 46px;
    background: rgba(255, 255, 255, .96);
}

.auth-right-inner {
    width: min(420px, 100%);
}

/* Form tweaks (sin tocar el partial) */
.auth-right .title-font {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.auth-right .form-label {
    font-size: 12px;
    font-weight: 600;
    color: #1f2937;
}

.auth-right .form-control {
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, .12);
}

.auth-right .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 .2rem rgba(0, 72, 70, .15);
}

.auth-right .input-group-text {
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, .12);
    background: #fff;
}

.auth-right .btn-primary {
    border-radius: 12px;
    padding: 14px 16px;
    font-weight: 800;
    letter-spacing: .06em;
}

/* enlaces */
.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 12px;
}

.auth-link:hover {
    text-decoration: underline;
}

.cursor-pointer {
    cursor: pointer;
}

.btn-loading {
    pointer-events: none;
    opacity: .9;
}

.btn-loading .spinner-border {
    vertical-align: -2px;
}

.auth-footnote {
    margin-top: 18px;
    font-size: 12px;
    color: rgba(0, 0, 0, .55);
}

.auth-footnote a {
    color: rgba(0, 0, 0, .75);
    text-decoration: none;
}

.auth-footnote a:hover {
    text-decoration: underline;
}


/* =========================
   FORM PREMIUM
========================= */

.auth-form {
    width: 100%;
}

.auth-title {
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: 28px;
    color: var(--theme-color9);
}

.auth-subtitle {
    font-size: 14px;
    color: rgba(0, 0, 0, .55);
}

.auth-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--theme-color3);
}

/* INPUT WRAPPER */
.input-icon-group {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    font-size: 14px;
    color: rgba(0, 0, 0, .35);
    pointer-events: none;
}

.auth-input {
    padding-left: 42px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, .12);
    transition: all .2s ease;
}

.auth-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 .2rem rgba(var(--accent-rgb), .15);
}

/* PASSWORD TOGGLE */
.input-password-toggle {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: rgba(0, 0, 0, .4);
    font-size: 16px;
    cursor: pointer;
}

.input-password-toggle:hover {
    color: var(--primary-color);
}

/* BUTTON */
.auth-btn {
    border-radius: 14px;
    padding: 14px 18px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    background: var(--primary-gradient);
    border: none;
    color: #fff;
    transition: all .25s ease;
    box-shadow: 0 10px 25px rgba(var(--primary-rgb), .25);
}

.auth-btn:focus-visible {
    outline: 3px solid rgba(var(--accent-rgb), .35);
    outline-offset: 3px;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 35px rgba(var(--primary-rgb), .35);
    color: white !important;
}

.auth-btn:active {
    transform: translateY(0);
}

/* CHECKBOX */
.form-check-input:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

body.auth.auth-v2 {
    position: relative;
    isolation: isolate;
    /* crea nuevo stacking context limpio */
}

.auth-shell,
.auth-panel,
.auth-right,
.auth-left {
    position: relative;
    z-index: 9999 !important;
}

/* mata posibles overlays del theme */
body.auth.auth-v2::before,
body.auth.auth-v2::after,
.layout-border::before,
.layout-border::after,
.layout-default::before,
.layout-default::after {
    pointer-events: none !important;
}

.auth-panel {
    animation: fadeUp .6s ease-out both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-panel.loading {
    opacity: .7;
    pointer-events: none;
}

.alert-success {
    border-radius: 14px;
    font-size: 14px;
}

.password-strength {
    height: 6px;
    background: #E5E7EB;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 6px;
}

.strength-bar {
    height: 100%;
    width: 0%;
    transition: width .3s ease, background .3s ease;
    border-radius: 999px;
}

/* =========================
Responsive
========================= */

@media (max-width: 991.98px) {

    body.auth.auth-v2 main {
        padding: 0 !important;
    }

    .auth-shell {
        padding: 0;
    }

    .auth-panel {
        grid-template-columns: 1fr;
        width: 100%;
        height: auto;
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-left {
        padding: 26px 20px;
        border-radius: 0 0 24px 24px;
        align-items: flex-start;
    }

    .auth-left-inner {
        max-width: 100%;
    }

    .auth-left-title {
        font-size: 26px;

    }

    .auth-left-subtitle {
        max-width: 100%;
        opacity: .95;
    }

    .auth-mock {
        display: none;
    }

    .auth-right {
        padding: 36px 24px 48px 24px;
        background: #fff;
    }

    .auth-footnote {
        text-align: center;
    }
}

@media (max-width: 420px) {
    .auth-shell {
        padding: 16px;
    }

    .auth-left {
        padding: 26px 20px;
    }

    .auth-left-title {
        font-size: 22px;
    }

    .auth-left-logo {
        width: 130px;
    }

    .auth-right {
        padding: 28px 20px 40px 20px;
    }

    .auth-title {
        font-size: 24px;
    }

    .auth-btn {
        padding: 16px;
    }
}

@media (max-height: 950px) {
    .auth-panel {
        height: 92vh;
    }

    .auth-left-title {
        font-size: 30px;
    }
}