/**
 * BizWhats — Autenticación (login, registro, reset)
 * Split screen · Plus Jakarta Sans · glass · stagger
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --bw-auth-primary: #37ce03;
    --bw-auth-primary-dark: #2db002;
    --bw-auth-slate: #0f172a;
    --bw-auth-muted: #64748b;
    --bw-auth-glass: rgba(255, 255, 255, 0.82);
    --bw-auth-glass-blur: 14px;
}

body.bw-auth-page.login-page,
body.bw-auth-page.register-page {
    font-family: 'Plus Jakarta Sans', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    display: block !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    height: auto !important;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    background: #f8fafc;
    overflow-x: hidden;
}

html:has(body.bw-auth-page) {
    height: 100%;
}

/* Ocultar layout legacy AdminLTE (logo + login-box centrado) */
body.bw-auth-page .login-box,
body.bw-auth-page .register-box {
    width: 100%;
    max-width: none;
    margin: 0;
    animation: none;
}

body.bw-auth-page .login-logo,
body.bw-auth-page .register-logo {
    display: none;
}

/* Split layout — pantalla completa */
.bw-auth {
    display: flex;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

.bw-auth__brand {
    flex: 1 1 44%;
    min-width: 0;
    align-self: stretch;
    min-height: 100vh;
    min-height: 100dvh;
    background:
        linear-gradient(145deg, rgba(15, 23, 42, 0.94) 0%, rgba(30, 41, 59, 0.92) 45%, rgba(36, 153, 2, 0.88) 100%);
    color: #fff;
    padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 3vw, 2rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.bw-auth__brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(55, 206, 3, 0.25) 0%, transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(37, 211, 102, 0.15) 0%, transparent 40%);
    pointer-events: none;
}

.bw-auth__brand-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: min(480px, 100%);
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bw-auth__logo-link {
    display: block;
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    text-align: center;
}

.bw-auth__logo {
    width: auto;
    max-width: min(240px, 88%);
    height: auto;
    max-height: clamp(44px, 11vw, 56px);
    object-fit: contain;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.25));
}

.bw-auth__logo--wordmark {
    border-radius: 0;
}

.bw-auth__tagline {
    font-size: clamp(1rem, 2.2vw, 1.125rem);
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: clamp(1rem, 3vw, 1.75rem);
    color: rgba(255, 255, 255, 0.92);
}

.bw-auth__features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.bw-auth__features li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.5rem 0.75rem;
    font-size: clamp(0.8125rem, 1.8vw, 0.9375rem);
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.bw-auth__features li i {
    flex-shrink: 0;
    margin-top: 0.1rem;
    width: 1.15rem;
    text-align: center;
}

.bw-auth__features .fab.fa-whatsapp {
    color: #25d366;
}

.bw-auth__brand-foot {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: min(480px, 100%);
    margin: clamp(1.25rem, 3vw, 2rem) auto 0;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.bw-auth__brand-foot p {
    margin: 0;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.65);
    text-align: center;
    letter-spacing: 0.02em;
}

.bw-auth__main {
    flex: 1 1 56%;
    min-width: 0;
    align-self: stretch;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 4vw, 3rem);
    background:
        radial-gradient(ellipse 90% 60% at 50% 0%, rgba(55, 206, 3, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 100% 100%, rgba(37, 211, 102, 0.05) 0%, transparent 45%),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.bw-auth__main-inner {
    width: 100%;
    max-width: min(440px, 100%);
    margin: 0 auto;
}

.bw-auth__title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--bw-auth-slate);
    margin: 0 0 0.35rem;
}

.bw-auth__subtitle {
    font-size: 0.9375rem;
    color: var(--bw-auth-muted);
    margin: 0 0 1.25rem;
    line-height: 1.45;
}

.bw-auth__intro {
    margin-bottom: 0.25rem;
    text-align: center;
}

.bw-auth__card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: var(--bw-auth-glass);
    backdrop-filter: blur(var(--bw-auth-glass-blur));
    -webkit-backdrop-filter: blur(var(--bw-auth-glass-blur));
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.bw-auth__card .card-body {
    padding: 1.75rem 1.5rem 1.25rem;
}

.bw-auth__footer {
    background: rgba(248, 250, 252, 0.9);
    border-top: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
}

.bw-auth__alert {
    border-radius: 10px;
    border: none;
    font-size: 0.875rem;
}

.bw-auth-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bw-auth-slate);
    margin-bottom: 0.35rem;
}

.bw-auth__main .input-group {
    margin-bottom: 0;
}

.bw-auth__main .form-group {
    margin-bottom: 1.1rem;
}

.bw-auth__main .input-group-text {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: var(--bw-auth-muted);
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.bw-auth__main .form-control {
    border-color: #e2e8f0;
    padding: 0.65rem 0.85rem;
    font-size: 0.9375rem;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bw-auth__main .form-control:focus {
    border-color: var(--bw-auth-primary);
    box-shadow: 0 0 0 0.2rem rgba(55, 206, 3, 0.18);
}

.bw-auth__main .input-group:focus-within .input-group-text {
    border-color: var(--bw-auth-primary);
    background: #f0fdf4;
    color: var(--bw-auth-primary-dark);
}

.bw-auth-btn {
    background: linear-gradient(135deg, var(--bw-auth-primary) 0%, var(--bw-auth-primary-dark) 100%);
    border: none;
    border-radius: 8px;
    padding: 0.7rem 1rem;
    font-weight: 600;
    font-size: 0.9375rem;
    box-shadow: 0 4px 14px rgba(55, 206, 3, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.bw-auth-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(55, 206, 3, 0.35);
    background: linear-gradient(135deg, var(--bw-auth-primary-dark) 0%, #239901 100%);
}

.bw-auth-btn:disabled {
    opacity: 0.85;
    cursor: wait;
}

.bw-auth-link {
    color: var(--bw-auth-primary-dark);
    font-weight: 600;
    text-decoration: none;
}

.bw-auth-link:hover {
    color: #239901;
    text-decoration: underline;
}

.icheck-primary input[type="checkbox"]:checked + label::before {
    background-color: var(--bw-auth-primary);
    border-color: var(--bw-auth-primary);
}

/* Stagger entrada */
@keyframes bwAuthStaggerIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bw-auth-stagger .bw-stagger-item {
    animation: bwAuthStaggerIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) backwards;
    animation-delay: var(--stagger-delay, 0s);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .bw-auth__card {
        background: #fff;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bw-auth-stagger .bw-stagger-item,
    .bw-auth-btn {
        animation: none !important;
        transition: none;
    }
}

@media (max-width: 991.98px) {
    .bw-auth {
        flex-direction: column;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .bw-auth__brand {
        flex: 0 0 auto;
        min-height: 0;
        width: 100%;
        padding: max(1.25rem, env(safe-area-inset-top)) 1.25rem 1.35rem;
        padding-left: max(1.25rem, env(safe-area-inset-left));
        padding-right: max(1.25rem, env(safe-area-inset-right));
        justify-content: flex-start;
    }

    .bw-auth__brand-inner {
        flex: 0 0 auto;
        justify-content: flex-start;
        max-width: 100%;
        text-align: left;
    }

    .bw-auth__brand-foot {
        margin-top: 1rem;
        max-width: 100%;
    }

    .bw-auth__logo-link {
        display: block;
        text-align: center;
        margin-bottom: 1rem;
    }

    .bw-auth__tagline {
        text-align: center;
        margin-bottom: 1rem;
        font-size: 0.9375rem;
    }

    .bw-auth__features {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .bw-auth__features li {
        padding: 0.55rem 0.85rem;
    }

    .bw-auth__main {
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        align-items: center;
        justify-content: center;
        padding: 1.25rem 1rem max(1.75rem, env(safe-area-inset-bottom));
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .bw-auth__main-inner {
        max-width: 480px;
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .bw-auth__brand {
        padding: 1.25rem 1rem 1.15rem;
    }

    .bw-auth__tagline {
        font-size: 0.875rem;
        line-height: 1.45;
        padding: 0 0.25rem;
    }

    .bw-auth__features li {
        font-size: 0.8125rem;
    }

    .bw-auth__title {
        font-size: 1.375rem;
    }

    .bw-auth__subtitle {
        font-size: 0.875rem;
    }

    .bw-auth__card .card-body {
        padding: 1.35rem 1.15rem 1rem;
    }
}

@media (min-width: 992px) {
    .bw-auth__brand-inner {
        padding: 0 0.5rem;
    }
}
