html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    font-family: 'Inter', sans-serif;
    background-color: #f8f7f4;
    overflow-x: hidden; /* Correção para a barra de rolagem horizontal */
}

/*
 * ===================================================================
 * ESTRATÉGIA DE CSS ROBUSTA E ESPECÍFICA
 * ===================================================================
*/
.rl-button-reset {
    background-image: none !important;
    border: 1px solid transparent !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.rl-button-reset:focus,
.rl-button-reset:active,
.rl-button-reset:focus-visible {
    background-image: none !important;
    background-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
}

.rl-button-reset:hover {
     border-color: transparent !important;
}

.rl-text-button:hover {
    background-color: transparent !important;
    text-decoration: underline !important;
}

.rl-icon-button:hover {
    background-color: #f3f4f6 !important;
}

/*
 * ===================================================================
 * CORREÇÃO PARA O ÍCONE DA CÂMARA
 * ===================================================================
*/
body #app-container .ocr-button {
    cursor: pointer;
    transition: opacity 0.2s ease-in-out;
}

body #app-container .ocr-button:hover {
    opacity: 0.7;
}

body #app-container .ocr-button,
body #app-container .ocr-button:hover,
body #app-container .ocr-button:active,
body #app-container .ocr-button:focus,
body #app-container .ocr-button:focus-visible {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/*
 * ===================================================================
 * CSS para Tooltips (Versão Final e Definitiva)
 * ===================================================================
*/
.tooltip-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #e5e7eb;
    color: #4b5563;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    transition: background-color 0.2s ease-in-out;
    flex-shrink: 0;
}
.tooltip-container:hover .tooltip-icon {
    background-color: #d1d5db;
}

.tooltip-text {
    visibility: hidden;
    width: max-content;
    max-width: 280px;
    background-color: #2c3e50;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 12px;
    position: absolute;
    z-index: 10;
    bottom: calc(100% + 12px); 
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    white-space: normal;
    pointer-events: none;
    transform-origin: bottom center;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #2c3e50 transparent transparent transparent;
}

/* LÓGICA DE ALINHAMENTO PRECISO PARA TELAS MAIORES */
.tooltip-container.tooltip-align-right .tooltip-text {
    left: auto;
    right: 0;
    transform: none; /* Reseta a transformação para um novo cálculo */
}

.tooltip-container.tooltip-align-right .tooltip-text::after {
    left: auto;
    right: 10px; /* Posiciona a ponta da seta no centro do ícone (20px / 2) */
    transform: translateX(50%); /* Centraliza a base da seta nesse ponto */
}


/* CLASSE DE VISIBILIDADE */
.tooltip-text.tooltip-visible {
     visibility: visible;
     opacity: 1;
     transform: translateX(-50%) translateY(-4px); 
}
.tooltip-container.tooltip-align-right .tooltip-text.tooltip-visible {
    transform: translateY(-4px); /* Aplica apenas o efeito "pop" vertical */
}

/* AJUSTE UNIVERSAL PARA TELAS MENORES (TABLET E MOBILE) */
@media (max-width: 768px) {
    .tooltip-text, .tooltip-container.tooltip-align-right .tooltip-text {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        max-width: calc(100vw - 32px); 
    }

    .tooltip-text::after, .tooltip-container.tooltip-align-right .tooltip-text::after {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    .tooltip-text.tooltip-visible, .tooltip-container.tooltip-align-right .tooltip-text.tooltip-visible {
        transform: translateX(-50%) translateY(-4px);
    }
}


/*
 * ===================================================================
 * Outros Estilos
 * ===================================================================
*/
@keyframes spin {
  to { transform: rotate(360deg); }
}
.ocr-spinner {
  border-color: #4f46e5;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

#app-container nav .nav-item { border: 2px solid transparent !important; border-bottom-color: transparent !important; background-color: transparent !important; }
#app-container nav .nav-item.nav-active { color: #4f46e5 !important; border-bottom-color: #4f46e5 !important; }
#app-container nav .nav-item:hover { color: #6366f1; }
.stat-card { background-color: white; border-radius: 0.75rem; padding: 1.5rem; box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05); transition: all 0.2s ease-in-out; position: relative; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05); }

/* ################################################################# */
/* INÍCIO DA ATUALIZAÇÃO - FASE 1: Estilos (Ação 3 do Plano) */
/* ################################################################# */
.strategy-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.strategy-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); /* shadow-lg */
}
/* ################################################################# */
/* FIM DA ATUALIZAÇÃO - FASE 1 */
/* ################################################################# */

.premium-overlay { position: absolute; inset: 0; background-color: rgba(255, 255, 255, 0.9); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; text-align: center; border-radius: 0.75rem; z-index: 10; transition: opacity 0.3s ease-in-out; }
.chart-container { position: relative; width: 100%; max-width: 800px; margin-left: auto; margin-right: auto; }

.nav-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.nav-container::-webkit-scrollbar {
    display: none;
}
.nav-content {
    display: flex;
    justify-content: flex-start;
    white-space: nowrap;
}
@media (min-width: 640px) {
    .nav-content {
        justify-content: center;
    }
}

/*
 * ===================================================================
 * Lógica de Transição de Carregamento da Aplicação
 * ===================================================================
*/
#app-root, #loading-message {
    transition: opacity 0.3s ease-in-out;
}

/* Estado de carregamento: esconde a app, mostra a mensagem */
body.is-loading #app-root {
    opacity: 0;
    pointer-events: none;
}
body.is-loading #loading-message {
    opacity: 1;
    position: fixed;
    inset: 0;
    z-index: 100;
}

/* Estado carregado: mostra a app, esconde a mensagem */
#app-root {
    opacity: 1;
}
#loading-message {
    opacity: 0;
    pointer-events: none;
}

/*
 * ===================================================================
 * Estilos para as Páginas de Registo e Login
 * ===================================================================
*/
#register-background,
#login-background {
    background-image: url('../imagens/fundo_register_login.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100vw;
    min-height: 100vh;
}
