/* -------- App shell layout (full height, sticky header/footer) -------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body.app-shell {
    margin: 0;
    padding: 0;
    background-color: #0e0f12;
    color: #e5e7eb;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    line-height: 1.5;
}

.app-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #0b0c0f;
    border-bottom: 1px solid #1f2937;
    flex-shrink: 0;
}

.app-footer {
    background: #0b0c0f;
    border-top: 1px solid #1f2937;
    flex-shrink: 0;
    margin-top: auto;
}

.app-main {
    flex: 1;
    padding: 24px 20px;
    width: 100%;
    max-width: 100%;
}

/* Footer */
.site-footer {
    background-color: transparent;
    color: #ffffff;
    padding: 16px 20px;
}

.site-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 0;
}

.footer-left {
    display: flex;
    align-items: center;
}

.footer-logo {
    height: 40px;
    width: auto;
}

.footer-center {
    flex: 1;
    text-align: center;
    font-size: 0.85rem;
    color: #9ca3af;
}

.footer-right {
    display: flex;
    justify-content: flex-end;
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-social-link {
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, transform 0.1s ease;
}

.footer-social-link:hover {
    color: #a3e635; /* verde mais claro no hover */
    transform: translateY(-1px);
}

.footer-icon {
    display: block;
}

.footer-icon-wrapper {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Utilitário para texto apenas para leitores de tela */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Container principal compartilhado */
.container {
    max-width: 1200px;
    width: 100%;
    padding: 0 20px;
    margin: 0 auto;
    background-color: transparent !important;
    border-radius: 0;
    border: 0;
    box-shadow: none;
}

/* Corrige o container do Bootstrap conflitante */
.container-fluid {
    padding: 0 20px;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #0b0c0f !important;
}

.header-logo {
    height: 72px;
    width: auto;
}

.header-bar {
    border-bottom: none;
}

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

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 16px;
}

.header-right {
    display: flex;
    align-items: center;
    padding-right: 16px;
}

.brand-link {
    text-decoration: none;
    color: #fff;
}

.brand-text {
    font-weight: 700;
    letter-spacing: 4px;
    font-size: 1.5rem;
}

.brand-link:hover,
.brand-link:focus,
.brand-link:active {
    color: #fff;
    text-decoration: none;
}

.brand-link:hover .brand-text {
    color: #fff;
}

.menu {
    display: flex;
    align-items: center;
}

.menu-list {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    gap: 6px;
}

.menu-item {
    margin-right: 0;
}

.menu-link {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 14px;
    border-radius: 8px;
    transition: color .15s ease, background .15s ease;
    display: inline-block;
}

.menu-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.menu-link:focus {
    outline: 2px solid rgba(163, 230, 53, 0.5);
    outline-offset: 2px;
}

/* Logout button – reset browser/global button styles so it matches menu links */
button.logout-btn {
    all: unset;
    color: #ef4444;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: color .15s ease, background .15s ease;
    display: inline-block;
}
button.logout-btn:hover {
    color: #fff;
    background: rgba(239, 68, 68, 0.15);
}

.user-menu-wrap {
    position: relative;
}

.user-menu-details {
    position: relative;
}

.user-menu-trigger {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
}

.user-menu-trigger::-webkit-details-marker {
    display: none;
}

.user-menu-trigger-static {
    cursor: default;
    pointer-events: none;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0ea5e9;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
}

.user-menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 180px;
    background: #0f172a;
    border: 1px solid #1f2937;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    padding: 8px;
    z-index: 100;
}

.user-menu-item {
    width: 100%;
    display: block;
    text-align: left;
    color: #e5e7eb;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.user-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.user-menu-logout {
    color: #f87171;
}

.profile-page {
    max-width: 980px;
    margin: 26px auto;
    padding: 0 16px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.profile-card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 14px;
    padding: 18px;
}

.profile-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
}

.profile-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.profile-avatar {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0ea5e9;
    color: #fff;
    font-weight: 800;
    font-size: 20px;
}

.profile-field {
    margin-bottom: 10px;
}

.profile-label {
    display: block;
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 2px;
}

.profile-value {
    color: #e5e7eb;
    font-size: 14px;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-help {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 8px;
}

.profile-form .helptext {
    display: block;
    color: #9ca3af;
    font-size: 12px;
    margin-top: 4px;
}

.profile-form ul {
    padding-left: 18px;
    margin: 6px 0;
    color: #fca5a5;
    font-size: 12px;
}

@media (max-width: 860px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

/* Profile form inputs */
.profile-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #1f2937;
    border-radius: 8px;
    background-color: #0f1217;
    color: #e5e7eb;
    font-size: 0.9rem;
    outline: none;
    transition: border-color .15s ease;
}

.profile-input:focus {
    border-color: #3b82f6;
}

/* Toggle switch */
.toggle-btn {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 12px;
    border: none;
    background: #374151;
    cursor: pointer;
    padding: 0;
    transition: background .2s ease;
}

.toggle-btn.active {
    background: #a3e635;
}

.toggle-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform .2s ease;
}

.toggle-btn.active .toggle-knob {
    transform: translateX(20px);
}

/* Modern buttons */
button,
.btn-primary,
.btn-outline,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid #2b3442;
    background: #111216;
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    transition: all .15s ease;
    text-decoration: none;
}

button:hover {
    background: #1a1d24;
    border-color: #3d4654;
}

button:active {
    transform: translateY(1px);
}

button:focus {
    outline: 2px solid rgba(163, 230, 53, 0.5);
    outline-offset: 2px;
}

button.btn-primary,
.btn-primary {
    background: #a3e635;
    color: #0b1020;
    border-color: #a3e635;
    font-weight: 600;
}

button.btn-primary:hover,
.btn-primary:hover {
    background: #84cc16;
    border-color: #84cc16;
}

button.btn-danger,
.btn-danger {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

button.btn-danger:hover,
.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

button.btn-outline,
.btn-outline {
    background: transparent;
    border-color: #3d4654;
    color: #e5e7eb;
}

button.btn-outline:hover,
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #5a6578;
}
   

/* Formulários */
.form-label {
    color: #ffffff; /* Cor cinza clara para os labels */
}

/* Inputs */
.form-control,
.form-select,
textarea,
input[type="text"],
input[type="password"],
input[type="date"],
select {
    background-color: #0f1217 !important;
    border: 1px solid #293241 !important;
    color: #e5e7eb !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Foco nos campos de formulário */
.form-control:focus,
.form-select:focus,
textarea:focus,
input:focus {
    border-color: #3b82f6 !important;
    background-color: #0f1217 !important;
}

/* Placeholder (Texto de exemplo nos campos) */
::placeholder { color: #94a3b8 !important; }

/* (Estilos de chat foram movidos para global/css/chat.css) */

/* Títulos */
h1, h2, h3, h4, h5, h6 {
    color: #fff;
    margin: 0 0 16px 0;
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: 1.75rem;
}

h2 {
    font-size: 1.5rem;
}

/* Seção oculta */
.hidden {
    display: none;
}

/* Bloquear o redimensionamento manual da caixa de input (textarea) */
textarea {
    resize: vertical !important;
    outline: none !important;
    box-shadow: none !important;
    min-height: 80px;
}

/* Título de páginas principais */
#header-page {
    text-align: center;
    margin-bottom: 24px;
}

.page-header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid #1f2937;
}

/* Estilo do texto DATAGRO AI */
#cortexis {
    font-size: 1.5rem;
    text-align: center;
    position: relative;
    z-index: 1;
    animation: glow 1.5s ease-in-out infinite alternate;
}

/* Efeito de brilho no texto */
@keyframes glow {
    0% {
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.6), 0 0 10px rgba(255, 255, 255, 0.4), 0 0 20px rgba(163, 230, 53, 0.3);
    }
    100% {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.6), 0 0 30px rgba(163, 230, 53, 0.5);
    }
}


/* ---- Overrides for header and layout tweaks ---- */
/* Make legacy header-link anchors slim, not pill buttons */
.header-link { padding: 0 !important; border: none !important; background: transparent !important; color: #e5e7eb; font-size: 14px; text-transform: none; }
.header-link::before { display: none !important; }

/* Remove padding do app-main quando tem landing page */
.app-main:has(.landing-page),
.app-main:has(.quick-chat-section) {
    padding: 0;
}

/* Esconder footer na Home para permitir scroll correto do chat temporário */
.app-layout:has(.quick-chat-section) .app-footer {
    display: none;
}

/* ---- Landing Page (index) ---- */
.landing-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 57px);
    padding: 24px 48px;
    background:
        radial-gradient(ellipse at top left, rgba(59,130,246,0.12), transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(163,230,53,0.08), transparent 50%),
        #0e0f12;
}

.landing-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    max-width: 1400px;
    width: 100%;
    align-items: center;
}

.landing-left {
    display: flex;
    flex-direction: column;
}

.landing-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 20px;
    width: fit-content;
}

.landing-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    line-height: 1.24;
    display: inline-block;
    overflow: visible;
    padding-bottom: 0.12em;
    margin: 0 0 20px 0;
    background: linear-gradient(135deg, #fff 0%, #a3e635 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-subtitle {
    font-size: 1.1rem;
    color: #9ca3af;
    line-height: 1.7;
    margin-bottom: 28px;
    max-width: 520px;
}

.landing-subtitle strong {
    color: #e5e7eb;
}

.landing-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
}

.landing-pill {
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 0.8rem;
    color: #d1d5db;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 32px;
}

.btn-lg {
    padding: 14px 28px !important;
    font-size: 1rem !important;
}

.landing-disclaimer {
    font-size: 0.8rem;
    color: #6b7280;
    max-width: 400px;
    line-height: 1.5;
}

.landing-right {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.landing-status {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 20px 24px;
}

.landing-status-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6b7280;
    margin: 0 0 16px 0;
    font-weight: 600;
}

.landing-status-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 24px;
}

.landing-status-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #e5e7eb;
}

.landing-preview {
    background: #0a0c10;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    overflow: hidden;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.preview-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
}

.preview-title {
    margin-left: auto;
    font-size: 0.7rem;
    color: #6b7280;
}

.preview-body {
    padding: 16px;
}

.preview-bubbles {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.4;
    max-width: 85%;
}

.preview-user {
    background: #1a1b23;
    color: #e5e7eb;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.preview-bot {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    color: #9ca3af;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

/* Responsivo Landing */
@media (max-width: 1024px) {
    .landing-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .landing-page {
        padding: 24px;
        min-height: auto;
    }
    
    .landing-status-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .landing-page {
        padding: 20px 16px;
    }
    
    .landing-title {
        font-size: 1.8rem;
    }
    
    .landing-actions {
        flex-direction: column;
    }
    
    .btn-lg {
        width: 100%;
        justify-content: center;
    }
}

/* Status dots and pills */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background-color: #4b5563;
    flex-shrink: 0;
}

.status-text {
    flex: 1;
}

.status-pill {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    background-color: rgba(15,23,42,0.9);
}

.status-dot.status-ativa {
    background-color: #22c55e;
}

.status-dot.status-em-andamento {
    background-color: #eab308;
}

.status-dot.status-proximas {
    background-color: #ef4444;
}

.status-pill.status-ativa {
    border-color: #22c55e;
    color: #bbf7d0;
    background-color: rgba(22,163,74,0.16);
}

.status-pill.status-em-andamento {
    border-color: #eab308;
    color: #fef9c3;
    background-color: rgba(202,138,4,0.18);
}

.status-pill.status-proximas {
    border-color: #ef4444;
    color: #fee2e2;
    background-color: rgba(220,38,38,0.18);
}

/* Mobile header/footer */
@media (max-width: 640px) {
    .header-container {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }

    .menu-list {
        flex-wrap: wrap;
        justify-content: center;
    }

    .site-footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-right {
        justify-content: center;
    }
}