/* Paleta principal usada em todo o site. */
:root {
    --bg-main: #0f172a;
    --bg-secondary: #020617;
    --bg-panel: rgba(15, 23, 42, 0.78);
    --bg-card: #1e293b;
    --bg-card-soft: rgba(30, 41, 59, 0.74);
    --border: #334155;
    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #86efac;
    --danger: #fca5a5;
}

* {
    box-sizing: border-box;
}

/* Base global da pagina. */
html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

/* Fundo visual fixo que da profundidade ao site. */
body::before {
    content: "";
    position: fixed;
    inset: -20%;
    z-index: -3;
    background:
        radial-gradient(circle at 15% 10%, rgba(56, 189, 248, 0.14), transparent 28%),
        radial-gradient(circle at 80% 0%, rgba(134, 239, 172, 0.10), transparent 24%),
        linear-gradient(135deg, #020617 0%, #0f172a 50%, #111827 100%);
}

body.auth-locked {
    overflow: hidden;
}

a {
    color: inherit;
}

button,
.button {
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #020617;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: inherit;
    font-weight: 800;
    min-height: 44px;
    padding: 12px 22px;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

button:hover,
.button:hover {
    background: var(--text-main);
    box-shadow: 0 14px 28px rgba(56, 189, 248, 0.18);
    transform: translateY(-2px);
}

.button.secondary {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.34);
    color: var(--text-main);
}

.button.secondary:hover {
    border-color: var(--accent);
}

#site-content[hidden] {
    display: none;
}

/* Ecran de login que protege o acesso ao conteudo. */
#login-screen {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 24px;
    background: var(--bg-secondary);
}

.login-background-video {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.34;
}

#login-screen::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(135deg, rgba(2, 6, 23, 0.78), rgba(15, 23, 42, 0.62));
}

.login-card {
    position: relative;
    z-index: 2;
    width: min(100%, 430px);
    padding: 34px;
    border: 1px solid rgba(56, 189, 248, 0.38);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(14px);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.52);
}

.login-kicker,
.eyebrow,
.component-type {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: 1.85rem;
}

.login-subtitle {
    margin: 0 0 24px;
    color: var(--text-muted);
}

.login-card label {
    display: block;
    margin: 14px 0 8px;
    font-weight: 700;
}

.login-card input,
#chat-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #020617;
    color: var(--text-main);
    font: inherit;
    outline: none;
}

.login-card input {
    padding: 13px 14px;
}

.login-card input:focus,
#chat-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

#login-error {
    min-height: 24px;
    margin: 12px 0;
    color: var(--danger);
    font-weight: 700;
}

.login-card button {
    width: 100%;
}

/* Loader inicial apresentado enquanto a pagina carrega. */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: var(--bg-main);
    color: var(--accent);
}

.loader {
    width: 52px;
    height: 52px;
    margin-bottom: 15px;
    border: 5px solid #334155;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.fade-out {
    opacity: 0;
    transition: opacity 0.55s ease;
}
/* Header fixo com marca, navegacao e logout. */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 76px;
    padding: 14px 8%;
    border-bottom: 1px solid rgba(51, 65, 85, 0.78);
    background: rgba(2, 6, 23, 0.88);
    backdrop-filter: blur(12px);
}

.brand {
    display: grid;
    gap: 2px;
    min-width: 160px;
    color: var(--text-main);
    text-decoration: none;
}

.brand span {
    min-height: 26px;
    color: var(--text-main);
    font-size: 1.18rem;
    font-weight: 800;
}

.brand small {
    color: var(--accent);
    font-weight: 800;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-nav a,
#logout-button {
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.94rem;
    font-weight: 800;
    min-height: 40px;
    padding: 9px 14px;
    text-decoration: none;
}

.site-nav a:hover,
.site-nav a.active {
    background: rgba(56, 189, 248, 0.13);
    color: var(--accent);
}

#logout-button {
    margin-left: 8px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.28);
    color: var(--accent);
}

.nav-toggle {
    display: none;
    width: 44px;
    padding: 0;
}

main {
    min-height: calc(100vh - 76px);
}

.hero,
.page-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: grid;
    align-items: center;
    min-height: 76vh;
    padding: 92px 8%;
}

.home-hero {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    gap: 40px;
}

.hero-background-video {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero::after,
.page-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.84), rgba(15, 23, 42, 0.70));
}

.hero-content {
    max-width: 780px;
}

.hero h1,
.page-hero h1 {
    margin: 0 0 18px;
    font-size: clamp(2.7rem, 8vw, 5.4rem);
    line-height: 0.95;
}

.hero-copy,
.page-hero p:not(.eyebrow) {
    max-width: 780px;
    margin: 0 0 28px;
    color: var(--text-muted);
    font-size: clamp(1.04rem, 2vw, 1.25rem);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.hero-stats,
.score-grid {
    display: grid;
    gap: 14px;
}

.hero-stats div,
.score-grid div,
.info-list div,
.check-item,
.feature-card,
.analysis-card,
.timeline-step,
.component-card {
    border: 1px solid rgba(51, 65, 85, 0.86);
    border-radius: 8px;
    background: var(--bg-card-soft);
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.22);
}

.hero-stats div,
.score-grid div {
    padding: 22px;
}

.hero-stats strong,
.score-grid strong {
    display: block;
    color: var(--text-main);
    font-size: 1.6rem;
}

.hero-stats span,
.score-grid span {
    color: var(--text-muted);
}

.page-hero {
    min-height: 42vh;
    background: radial-gradient(circle at 20% 10%, rgba(56, 189, 248, 0.16), transparent 34%), var(--bg-secondary);
}

.section {
    padding: 82px 8%;
}

.compact-section {
    padding-top: 54px;
}

/* Cabecalhos reutilizados nas secoes de conteudo. */
.section-heading {
    max-width: 760px;
    margin-bottom: 32px;
}

.section-heading h2,
.split-copy h2 {
    margin: 0 0 12px;
    color: var(--text-main);
    font-size: clamp(1.9rem, 4vw, 3rem);
    line-height: 1.08;
}

.section-heading p:not(.eyebrow),
.split-copy p:not(.eyebrow) {
    color: var(--text-muted);
    margin: 0;
}

.feature-grid,
.analysis-grid,
.check-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.feature-card,
.analysis-card {
    padding: 26px;
}

.feature-card span {
    color: var(--accent);
    font-weight: 800;
}

.feature-card h3,
.analysis-card h2,
.timeline-step h2,
.component-card h2 {
    margin: 8px 0 10px;
}

.feature-card p,
.analysis-card p,
.timeline-step p,
.component-card p,
.info-list span {
    color: var(--text-muted);
}

.feature-card a,
.component-card a {
    color: var(--accent);
    font-weight: 800;
    text-decoration: none;
}

.feature-card a:hover,
.component-card a:hover {
    text-decoration: underline;
}

.split-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 440px);
    gap: 32px;
    align-items: center;
}

.info-list {
    display: grid;
    gap: 14px;
}

.info-list div {
    padding: 20px;
}

.info-list strong {
    display: block;
    margin-bottom: 6px;
}
/* Layout dos cards de componentes. */
.component-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.component-card {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 20px;
    min-height: 230px;
    padding: 18px;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.component-card:hover,
.feature-card:hover,
.analysis-card:hover,
.timeline-step:hover {
    border-color: rgba(56, 189, 248, 0.68);
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.32);
    transform: translateY(-4px);
}

.component-card img,
.component-symbol {
    width: 100%;
    height: 100%;
    min-height: 190px;
    border-radius: 8px;
    background: #020617;
    object-fit: cover;
}

.component-symbol {
    display: grid;
    place-items: center;
    border: 1px solid rgba(56, 189, 248, 0.26);
    color: var(--accent);
    font-size: 2.2rem;
    font-weight: 800;
}

/* Linha de etapas usada na pagina Montagem. */
.timeline {
    display: grid;
    gap: 18px;
    max-width: 980px;
    margin: 0 auto;
}

.timeline-step {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 20px;
    padding: 24px;
}

.timeline-step > span {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.14);
    color: var(--accent);
    font-weight: 800;
}

.check-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.check-item {
    padding: 18px;
    color: var(--text-main);
    font-weight: 800;
}

.check-item::before {
    content: "✓";
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    border-radius: 50%;
    background: rgba(134, 239, 172, 0.14);
    color: var(--success);
}

.conclusion-section {
    padding-top: 42px;
}

.benchmark-section {
    padding-top: 48px;
}

/* Galeria de imagens da pagina Analise. */
.benchmark-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.benchmark-card {
    overflow: hidden;
    border: 1px solid rgba(51, 65, 85, 0.86);
    border-radius: 8px;
    background: var(--bg-card-soft);
    box-shadow: 0 22px 58px rgba(0, 0, 0, 0.30);
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.benchmark-card:hover {
    border-color: rgba(56, 189, 248, 0.68);
    box-shadow: 0 28px 68px rgba(0, 0, 0, 0.38);
    transform: translateY(-4px);
}

.benchmark-card img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #020617;
}

.benchmark-content {
    padding: 22px;
}

.benchmark-content h3 {
    margin: 6px 0 10px;
    font-size: 1.25rem;
}

.benchmark-content p:last-child {
    margin-bottom: 0;
    color: var(--text-muted);
}

/* Rodape partilhado por todas as paginas. */
footer {
    padding: 42px 8%;
    border-top: 1px solid rgba(51, 65, 85, 0.7);
    background: var(--bg-secondary);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
    max-width: 1180px;
    margin: 0 auto;
}

.footer-grid p {
    margin: 4px 0;
    color: var(--text-muted);
}

.footer-grid strong {
    color: var(--text-main);
}

/* Botao flutuante que abre o assistente. */
#chat-toggle {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 0;
    font-size: 1.4rem;
}
/* Janela principal do chatbot. */
#chatbot {
    position: fixed;
    right: 20px;
    bottom: 92px;
    z-index: 9999;
    display: none;
    flex-direction: column;
    width: min(380px, calc(100vw - 32px));
    overflow: hidden;
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 8px;
    background: #1e293b;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.44);
    animation: chatIn 0.22s ease;
}

@keyframes chatIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(135deg, var(--accent), #7dd3fc);
    color: #020617;
    font-weight: 800;
    padding: 12px 14px;
}

#chat-header span {
    display: block;
    color: rgba(2, 6, 23, 0.74);
    font-size: 0.76rem;
    font-weight: 700;
}

#chat-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 340px;
    overflow-y: auto;
    padding: 12px;
}

.message {
    max-width: 86%;
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 0.92rem;
}

.message.bot {
    line-height: 1.5;
}

.message.user {
    align-self: flex-end;
    background: var(--accent);
    color: #020617;
}

.message.bot {
    align-self: flex-start;
    background: #334155;
    color: var(--text-main);
}

/* Botoes de sugestoes rapidas dentro do chat. */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.quick-reply {
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid rgba(56, 189, 248, 0.30);
    background: rgba(56, 189, 248, 0.10);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 800;
}

.quick-reply:hover {
    background: rgba(56, 189, 248, 0.20);
    color: var(--text-main);
    box-shadow: none;
    transform: translateY(-1px);
}

.chat-link {
    color: var(--accent);
    font-weight: 800;
    text-decoration: underline;
}

#chat-input-area {
    display: grid;
    grid-template-columns: 1fr 52px;
    border-top: 1px solid rgba(51, 65, 85, 0.8);
}

#chat-input {
    border: 0;
    border-radius: 0;
    padding: 12px;
}

#chat-send {
    min-height: 0;
    border-radius: 0;
    padding: 0;
}

/* Estado inicial dos elementos animados por JavaScript. */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Ajustes para tablets e ecra medio. */
@media (max-width: 1040px) {
    .home-hero,
    .split-section,
.component-grid {
        grid-template-columns: 1fr;
    }

    .feature-grid,
    .analysis-grid,
    .check-grid,
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Layout mobile: menu, grelhas e chat compactos. */
@media (max-width: 760px) {
.site-header {
        align-items: center;
        padding: 12px 5%;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 12px 5% 16px;
        border-bottom: 1px solid rgba(51, 65, 85, 0.86);
        background: rgba(2, 6, 23, 0.96);
    }

    .site-nav.open {
        display: flex;
    }

    .site-nav a,
    #logout-button {
        width: 100%;
        justify-content: center;
        margin-left: 0;
        text-align: center;
    }

    .hero,
    .page-hero,
    .section {
        padding-left: 5%;
        padding-right: 5%;
    }

    .hero,
    .page-hero {
        min-height: 64vh;
        padding-top: 72px;
        padding-bottom: 72px;
    }

    .hero-actions,
    .button {
        width: 100%;
    }

    .component-card {
        grid-template-columns: 1fr;
    }

    .component-card img,
    .component-symbol {
        height: 210px;
    }

    .timeline-step {
        grid-template-columns: 1fr;
    }

    .feature-grid,
    .analysis-grid,
    .benchmark-gallery,
    .check-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 24px;
    }
#chatbot {
        right: 16px;
        bottom: 86px;
    }

    #chat-body {
        height: 320px;
    }
}
