:root {
    --bg-dark: #020617; /* Keeping for internal reference */
    --gold: #f59e0b;    /* Keeping for internal reference */
    --primary: #f59e0b;  /* Orange/Gold */
    --secondary: #020617; /* Dark Blue */
    --accent: #0f172a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* overflow: hidden; Removed to allow scrolling */
    font-family: 'Inter', -apple-system, sans-serif;
    color: white;
}

/* --- BACKGROUND LAVA LAMP --- */
.lava-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #020617 0%, #0a192f 50%, #020617 100%);
    background-size: 400% 400%;
    animation: gradientMove 15s ease infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* --- HEADER --- */
header {
    padding: 30px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.header-line {
    width: 40px;
    height: 1px;
    background: var(--gold);
}

.header-text {
    color: white;
    font-size: 11px;
    letter-spacing: 6px;
    text-transform: uppercase;
    font-weight: 300;
    opacity: 0.8;
}

/* --- CONTEÚDO CENTRAL --- */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

/* CONTAINER DO SVG */
#logo-container {
    width: 100%;
    max-width: 400px;
    margin-bottom: 50px;
    filter: drop-shadow(0 0 30px rgba(245, 158, 11, 0.3));
    display: flex;
    justify-content: center;
    align-items: center;
}

#logo-container svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

#logo-container svg path {
    fill: var(--gold) !important;
    opacity: 0;
}

/* --- BOTAO MINIMALISTA --- */
.btn-entrar {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 22px 90px;
    font-size: 12px;
    letter-spacing: 8px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 0;
    position: relative;
}

.btn-entrar:hover {
    background: white;
    color: black;
    border-color: white;
    letter-spacing: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Landing page responsiveness audit */
@media (max-width: 1024px) {
    header { padding: 25px 40px; }
    #logo-container { max-width: 320px; }
    .btn-entrar { padding: 20px 60px; letter-spacing: 6px; }
}

@media (max-width: 768px) {
    header { padding: 20px 24px; }
    .header-text { font-size: 9px; letter-spacing: 4px; }
    #logo-container { max-width: 260px; margin-bottom: 40px; }
    .btn-entrar { padding: 18px 0; width: 85%; letter-spacing: 5px; font-size: 11px; }
    .btn-entrar:hover { letter-spacing: 7px; }
}

@media (max-width: 480px) {
    #logo-container { max-width: 220px; margin-bottom: 30px; }
    .btn-entrar { width: 90%; letter-spacing: 4px; padding: 16px 0; }
    .modal-box { padding: 40px 25px; }
    .modal-box h2 { font-size: 12px; letter-spacing: 3px; }
}

/* --- MODAL DE LOGIN --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: linear-gradient(145deg, #0f172a, #020617);
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: 50px 40px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 20px rgba(245, 158, 11, 0.05);
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.modal-overlay.active .modal-box {
    transform: translateY(0) scale(1);
}

.fechar-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
}

.fechar-modal:hover {
    color: var(--gold);
    transform: rotate(90deg);
}

.modal-box h2 {
    color: white;
    font-size: 14px;
    letter-spacing: 5px;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 40px;
    font-weight: 300;
}

.input-group {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
}

.input-group label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 9px;
    letter-spacing: 3px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.input-group input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    border-radius: 0;
}

.input-group input:focus {
    border-color: var(--gold);
    background: rgba(245, 158, 11, 0.05);
}

/* --- LAYOUT DE CONTEÚDO --- */
.content-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 50px auto;
    padding: 0 20px;
    z-index: 10;
}

.entry-header {
    margin-bottom: 40px;
    text-align: center;
}

.entry-header h1 {
    font-size: 32px;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 300;
    color: var(--gold);
    margin-bottom: 20px;
}

.post-thumbnail {
    margin-bottom: 40px;
    border: 1px solid rgba(245, 158, 11, 0.2);
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s ease;
}

.post-thumbnail:hover img {
    transform: scale(1.05);
}

.entry-content {
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
}

.entry-content p {
    margin-bottom: 25px;
}

.entry-content h2, .entry-content h3 {
    color: white;
    margin: 40px 0 20px;
    letter-spacing: 2px;
}

/* --- SIDEBAR --- */
.sidebar-panel {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    padding: 30px;
}

.widget {
    margin-bottom: 40px;
}

.widget-title {
    color: var(--gold);
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
    padding-bottom: 10px;
}

.widget ul {
    list-style: none;
    padding: 0;
}

.widget ul li {
    margin-bottom: 12px;
}

.widget ul li a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.widget ul li a:hover {
    color: var(--gold);
}

.btn-submit {
    width: 100%;
    background: var(--gold);
    color: #020617;
    border: none;
    padding: 18px 0;
    font-size: 11px;
    letter-spacing: 6px;
    text-transform: uppercase;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s;
}

.btn-submit:hover {
    background: white;
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.2);
    letter-spacing: 8px;
}

/* =========================================
   APP INTERFACE (Utility Pages)
   ========================================= */

.app-interface .lava-bg { display: none !important; }

.header-app {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: var(--v2-navy); /* Sólido Luxo */
    border-bottom: 2px solid var(--v2-primary);
    box-shadow: var(--v2-shadow-lg); /* Profundidade extrema */
    z-index: 9999;
    display: flex;
    align-items: center;
    transition: top 0.3s;
}

/* WP Admin Bar Support */
.admin-bar .header-app {
    top: 32px;
}

@media (max-width: 600px) {
    .admin-bar .header-app {
        top: 46px;
    }
}

.header-app-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-app a {
    text-decoration: none;
}

.logo-monochromatic {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 5px;
    color: var(--primary);
    text-transform: uppercase;
}

.nav-app {
    display: flex;
    gap: 30px;
}

.nav-item {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: 0.2s;
}

.nav-item:hover {
    color: var(--primary);
}

.nav-logout {
    color: #ef4444;
}

/* SOBER APP BUTTONS */
.btn-app {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary);
    color: #000 !important;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: none; /* No delays */
}

.btn-app:active {
    transform: scale(0.98);
}

.btn-app:hover {
    background: #fff;
    color: #000 !important;
}

/* Modificador para Botões Escuros do CRM (Mantém texto branco) */
.btn-app-dark {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #ffffff !important;
}
.btn-app-dark:hover {
    background: #0f172a !important;
    color: #ffffff !important;
}

.btn-app.btn-secondary {
    background: var(--secondary);
    border: 1px solid var(--primary);
    color: var(--primary) !important;
}

.btn-app-mini {
    padding: 8px 16px;
    font-size: 9px;
}

table.crm-table {
    width: 100%;
    border-collapse: collapse;
}

table.crm-table th {
    padding: 20px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--primary);
    font-size: 9px;
    text-align: left;
    letter-spacing: 2px;
}

table.crm-table td {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    font-size: 13px;
}

/* Fix content overlap behind fixed header-app */
.portal-headless {
    padding-top: 100px !important;
}

/* Active nav state */
.nav-item.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 2px;
}

/* =========================================
   APP INTERFACE - GLOBAL LAYOUT
   Ensures standard fixed-header spacing.
   ========================================= */

body.app-interface {
    padding-top: 80px !important; /* Offset for fixed header */
    background-color: #eef0f4 !important;
    color: #1c1c2e !important;
}

/* =========================================
   APP INTERFACE - MOBILE RESPONSIVENESS
   ========================================= */

.app-hamburger {
    display: none; /* Hidden on desktop */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 999999; /* Absolute top priority */
}

.app-hamburger span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--primary);
    margin: 5px 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 992px) {
    .app-hamburger {
        display: block;
    }

    /* Hamburger animation to X */
    .app-hamburger.is-active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .app-hamburger.is-active span:nth-child(2) {
        opacity: 0;
    }
    .app-hamburger.is-active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-app {
        position: fixed;
        top: 80px; /* Below header */
        left: 0;
        width: 100%;
        background: var(--secondary);
        border-bottom: 2px solid var(--primary);
        flex-direction: column;
        align-items: center;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        z-index: 100000;
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .nav-app.nav-mobile-active {
        max-height: 300px; /* Large enough to hold items */
        padding: 20px 0;
        opacity: 1;
        visibility: visible;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }

    .nav-item {
        width: 100%;
        text-align: center;
        padding: 15px 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .nav-item.active {
        border-bottom: 1px solid rgba(255,255,255,0.05);
        color: var(--primary);
        background: rgba(245, 158, 11, 0.05);
        padding: 15px 0 !important; /* Reset desktop padding-bottom:2px (higher specificity) */
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .header-app-container {
        padding: 0 20px;
    }
}

/* =========================================
   APP INTERFACE — COLOR RESET
   Fundo branco + texto herdado branco = ilegível.
   ========================================= */

.portal-headless {
    background: #eef0f4; 
    min-height: 100vh;
    /* NOTE: padding-top is handled globally by body.app-interface */
}

.portal-headless,
.portal-headless *,
.lp-modal,
.lp-modal *,
.form-dropdown-inner,
.form-dropdown-inner * {
    color: #1c1c2e;
}

/* Exceções: elementos que devem manter cores especiais */
.portal-headless .painel-role-badge   { color: var(--primary) !important; }
.portal-headless .stat-value          { color: inherit; } /* herda a cor definida inline */
.portal-headless .td-muted            { color: #888 !important; }
.portal-headless .crm-empty           { color: #bbb !important; }
.portal-headless .stat-label          { color: #999 !important; }
.portal-headless .lp-toast            { color: #fff !important; }

/* Cabeçalhos da tabela */
table.crm-light th                    { color: #999 !important; }

/* Labels do formulário */
.form-field label                     { color: #666 !important; }
.form-dropdown-header                 { color: #777 !important; }
.lp-modal-header                      { color: #666 !important; }

/* Inputs: texto digitado */
.form-field input,
.form-field select                    { color: #1c1c2e !important; }
.form-field input::placeholder        { color: #bbb !important; }

/* Botões: manter contraste */
.btn-app                              { color: #000 !important; }
.btn-app.btn-secondary                { color: var(--primary) !important; }

/* Forçar substituição do botão escuro overriding regras globais */
button.btn-app.btn-app-dark           { color: #ffffff !important; }

.btn-orcamento                        { color: var(--primary) !important; }
.btn-orcamento.btn-ver                { color: #1d4ed8 !important; }
.btn-orcamento:hover                  { color: #000 !important; }
.btn-orcamento.btn-ver:hover          { color: #fff !important; }
.lp-modal-close                       { color: #aaa !important; }
.lp-modal-close:hover                 { color: #333 !important; }
.form-close-btn                       { color: #aaa !important; }

/* Texto de erro de telefone */
.phone-error                          { color: #ef4444 !important; }

/* Painel title */
.painel-title                         { color: #1c1c2e !important; }

/* Garantir que o body nao interfira no background do portal */
body.app-interface {
    background-color: #eef0f4 !important;
    color: #1c1c2e !important;
}
