/* ================================================================
   MaisBook — Página de Acesso (código do cliente)
   ================================================================ */

html:has(body.acesso-page) {
    margin: 0;
    padding: 0;
    background: var(--color-bg, #0A0A10);
}

html.admin-bar:has(body.acesso-page) {
    margin-top: 0 !important;
}

body.acesso-page.admin-bar {
    padding-top: 32px;
}

body.acesso-page {
    font-family: var(--font-family, 'Outfit', sans-serif);
    background: var(--color-bg, #0A0A10);
    color: var(--color-text, #F5F5F7);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.acesso-page .acesso-particles,
body.acesso-page .acesso-grain,
body.acesso-page .acesso-orbs,
body.acesso-page .acesso-cursor-canvas {
    pointer-events: none !important;
}

@media (hover: hover) {
    html.acesso-has-cursor,
    body.acesso-page.acesso-has-cursor,
    body.acesso-page.acesso-has-cursor * {
        cursor: none !important;
    }
}

.acesso-cursor-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    display: block;
    margin: 0;
    padding: 0;
    border: none;
    pointer-events: none;
    z-index: 2147483646;
}

body.acesso-page:not(.acesso-has-cursor) .acesso-cursor-canvas {
    display: none;
}

/* ---- Ambient layers ---- */
.acesso-particles {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    display: block;
    margin: 0;
    padding: 0;
    border: none;
    pointer-events: none;
    z-index: 0;
    opacity: 0.55;
}

.acesso-grain {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    pointer-events: none;
    z-index: 2;
    opacity: 0.04;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 180px 180px;
}

.acesso-orbs {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.acesso-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    will-change: transform;
}

.acesso-orb--1 {
    width: 420px;
    height: 420px;
    background: var(--color-primary, #F0863A);
    top: -100px;
    right: -60px;
}

.acesso-orb--2 {
    width: 320px;
    height: 320px;
    background: #8B5CF6;
    bottom: 15%;
    left: -80px;
    opacity: 0.2;
}

.acesso-orb--3 {
    width: 240px;
    height: 240px;
    background: var(--color-primary, #F0863A);
    bottom: -60px;
    right: 20%;
    opacity: 0.25;
}

/* ---- Reveal (GSAP / fallback) ---- */
[data-reveal] {
    opacity: 0;
    transform: translateY(28px);
}

body.acesso-page.acesso-ready [data-reveal].is-visible,
body.acesso-page.acesso-reduced-motion [data-reveal] {
    opacity: 1;
    transform: none;
}

/* ---- Layout ---- */
.acesso-split {
    display: flex;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    position: relative;
    z-index: 3;
}

.acesso-left {
    flex: 1 1 auto;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 48px;
    background: transparent;
    z-index: 1;
}

.acesso-footer {
    position: absolute;
    bottom: 22px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.7rem;
    color: var(--color-text-muted, #A1A1A6);
    letter-spacing: 0.2px;
    opacity: 0.6;
    z-index: 2;
}

.acesso-form-area {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 400px;
    padding: 40px 32px;
    background: var(--glass-bg-strong, rgba(20, 20, 30, 0.88));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-lg, 20px);
    backdrop-filter: blur(var(--glass-blur, 16px));
    -webkit-backdrop-filter: blur(var(--glass-blur, 16px));
    box-shadow: var(--shadow-lg, 0 16px 48px rgba(0, 0, 0, 0.35));
    text-align: center;
}

.acesso-title {
    margin: 0 0 10px;
    line-height: 0;
}

.acesso-logo-img {
    display: block;
    height: 45px;
    width: auto;
    max-width: 220px;
    margin: 0 auto;
    object-fit: contain;
}

.acesso-subtitle {
    font-size: 0.92rem;
    color: var(--color-text-muted, #A1A1A6);
    line-height: 1.5;
    margin: 0 0 28px;
}

.acesso-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin: 0 0 20px;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-radius: var(--radius-sm, 10px);
    color: #fca5a5;
    font-size: 0.85rem;
    text-align: left;
    line-height: 1.4;
}

.acesso-alert svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--color-error, #F87171);
}

.acesso-field {
    position: relative;
    margin-bottom: 8px;
    padding-top: 4px;
}

.acesso-field label {
    position: absolute;
    left: 0;
    top: 20px;
    font-size: 0.98rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--color-text-muted, #A1A1A6);
    pointer-events: none;
    transition: top 0.2s ease, font-size 0.2s ease, color 0.2s ease;
}

.acesso-field.is-filled label,
.acesso-field:focus-within label {
    top: 0;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--color-primary, #F0863A);
}

.acesso-input {
    width: 100%;
    padding: 22px 0 10px;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: left;
    color: var(--color-text, #F5F5F7);
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 0;
    outline: 0;
    box-shadow: none;
    transition: border-color 0.2s ease, border-width 0.2s ease, padding-bottom 0.2s ease;
}

.acesso-field:focus-within .acesso-input {
    border-bottom-color: var(--color-primary, #F0863A);
    border-bottom-width: 2px;
    padding-bottom: 9px;
}

.acesso-input.shake {
    animation: shake 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    border-bottom-color: var(--color-error, #F87171) !important;
}

.acesso-btn {
    margin-top: 24px;
    width: 100%;
    height: 48px;
    padding: 0 20px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1;
    border: none;
    border-radius: 12px;
    background: var(--color-primary, #F0863A);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow-sm, 0 0 20px rgba(240, 134, 58, 0.18));
    outline: 0;
    opacity: 1;
    transform: scale(1);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.acesso-btn:focus,
.acesso-btn:focus-visible {
    background: var(--color-primary, #F0863A);
    color: #fff;
    outline: 0;
}

@media (hover: hover) {
    .acesso-btn:hover {
        transform: scale(1.03);
        box-shadow: var(--shadow-glow, 0 0 48px rgba(240, 134, 58, 0.22));
    }
}

.acesso-btn:active {
    transform: scale(0.97) translateY(2px);
    transition: transform 80ms ease;
}

.acesso-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 14px;
    color: var(--color-text-muted, #A1A1A6);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.acesso-divider::before,
.acesso-divider::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.acesso-cadastro-btn {
    padding: 12px 18px;
    font-size: 0.9rem;
    border-radius: 10px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--color-text, #F5F5F7);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s;
}

.acesso-cadastro-btn:hover {
    border-color: var(--color-primary, #F0863A);
    background: rgba(240, 134, 58, 0.08);
}

/* ---- Success burst overlay ---- */
.acesso-success-flash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    background: rgba(240, 134, 58, 0.55);
    opacity: 0;
}

/* ---- LGPD footer (wp_footer) ---- */
body.acesso-page .maisbook-lgpd-footer {
    flex-shrink: 0;
    width: 100%;
    position: relative;
    z-index: 4;
    padding: 16px 24px 20px;
    margin-top: auto;
    background: transparent;
    border-top: none;
}

/* ---- Light theme ---- */
.maisbook-light body.acesso-page,
body.acesso-page.maisbook-light {
    background: var(--color-bg);
    color: var(--color-text);
}

.maisbook-light .acesso-input {
    color: var(--color-text);
    border-bottom-color: var(--color-border-strong, rgba(0, 0, 0, 0.2));
}

.maisbook-light .acesso-field:focus-within .acesso-input {
    border-bottom-color: var(--color-primary, #F0863A);
}

/* ---- Responsive ---- */
@media (max-width: 980px) {
    .acesso-left {
        width: 100%;
        padding: 32px 20px 28px;
        justify-content: flex-start;
    }

    .acesso-form-area {
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
        padding: 28px 22px;
    }

    .acesso-footer {
        position: static;
        margin-top: 24px;
        text-align: center;
    }
}

@media (max-width: 560px) {
    .acesso-left {
        padding: 24px 16px 24px;
    }

    .acesso-form-area {
        padding: 24px 18px;
        border-radius: 14px;
    }

    .acesso-logo-img {
        height: 45px;
        max-width: 220px;
    }

    .acesso-subtitle {
        font-size: 0.88rem;
        margin-bottom: 22px;
    }

    .acesso-input {
        font-size: 1rem;
        letter-spacing: 1.5px;
    }

    .acesso-btn {
        height: 50px;
        font-size: 1rem;
    }
}

@media (max-width: 380px) {
    .acesso-left {
        padding: 20px 14px;
    }

    .acesso-form-area {
        padding: 20px 14px;
    }

    .acesso-logo-img {
        height: 45px;
        max-width: 200px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .acesso-particles {
        display: none;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }
}
