/* css/landing.css - COMPLETO */

/* --- 1. Variáveis e Cores --- */
:root {
    /* Light Mode (Default) */
    --bg-body: #f5f5f5;
    --bg-hero: #ffe08a;
    --bg-card: #ffffff;
    --text-main: #363636;
    --text-light: #7a7a7a;
    --modal-overlay: rgba(10, 10, 10, 0.86);
    --modal-bg: #ffffff;
    --border: #dbdbdb;
    
    /* Font Stack Nativo (RGPD Friendly - Sem pedidos externos) */
    --font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;

    /* Controlo de Ícones */
    --display-sun: none;
    --display-moon: block;
}

/* Dark Mode (Forçado pelo utilizador) */
:root[data-theme="dark"] {
    --bg-body: #111827;
    --bg-hero: #1f2937;
    --bg-card: #1f2937;
    --text-main: #f3f4f6;
    --text-light: #9ca3af;
    --modal-bg: #1f2937;
    --border: #374151;

    --display-sun: block;
    --display-moon: none;
}

/* Dark Mode (Automático do Sistema) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-body: #111827;
        --bg-hero: #1f2937;
        --bg-card: #1f2937;
        --text-main: #f3f4f6;
        --text-light: #9ca3af;
        --modal-bg: #1f2937;
        --border: #374151;

        --display-sun: block;
        --display-moon: none;
    }
}

/* --- 2. Base e Layout --- */
body {
    margin: 0;
    font-family: var(--font-family);
    color: var(--text-main);
    background-color: var(--bg-body);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Hero Section */
.hero {
    background-color: var(--bg-hero);
    padding: 2rem 1rem 5rem 1rem;
    text-align: center;
    transition: background-color 0.3s ease;
}

.hero h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-top: 0.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.logo {
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 20%;
    max-width: 150px;
}

/* Tool Container (Iframe) */
.tool-container {
    max-width: 650px;
    margin: -4rem auto 3rem auto;
    background: transparent;
    position: relative;
    z-index: 10;
    padding: 0 1rem;
}

iframe {
    width: 100%;
    border: none;
    display: block;
    height: 600px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    background: var(--bg-card); /* Previne fundo branco em dark mode durante load */
    transition: background-color 0.3s ease;
}

/* Content Sections */
.content-section {
    max-width: 800px;
    margin: 3rem auto;
    padding: 1rem 1rem 3rem 1rem;
}

.ad-slot {
    background: rgba(128, 128, 128, 0.1);
    padding: 1.5rem;
    text-align: center;
    margin: 2rem 0;
    border-radius: 4px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.8rem;
    border: 1px dashed var(--border);
}

h2 { font-size: 1.8rem; margin-top: 2rem; }
h3 { font-size: 1.4rem; margin-top: 1.5rem; }
code { background: rgba(128,128,128,0.2); padding: 0.2rem 0.4rem; border-radius: 4px; }

/* Footer */
footer {
    text-align: center;
    padding: 3rem 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
    background-color: rgba(0,0,0,0.05);
    margin-top: 2rem;
}

footer a { color: var(--text-main); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* --- 3. Botão de Tema (Sol/Lua) --- */
.theme-toggle {
    background: transparent;
    border: 2px solid rgba(128, 128, 128, 0.2);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 20px;
    right: 20px;
    transition: all 0.3s ease;
    z-index: 100;
}

.theme-toggle:hover {
    background-color: rgba(128, 128, 128, 0.1);
    transform: rotate(15deg);
}

.icon-sun { display: var(--display-sun); }
.icon-moon { display: var(--display-moon); }

/* --- 4. Modals --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: var(--modal-overlay);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background-color: var(--modal-bg);
    margin: auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    color: var(--text-main);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 { margin: 0; font-size: 1.5rem; }

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
    line-height: 1;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    text-align: right;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}

.btn-primary {
    background-color: var(--text-main);
    color: var(--bg-card);
}

/* Responsivo */
@media (max-width: 600px) {
    .hero h1 { font-size: 2rem; }
    .tool-container { margin-top: -2rem; }
    .theme-toggle { top: 10px; right: 10px; width: 36px; height: 36px; }
}