﻿/* ===== Tokens ===== */
:root {
  --bg: #0b1416; --surface: #10201f; --surface-2: #0f1b1c; --line: #1d3230; --text: #e6eeef; --muted: #9fb0b2;
  --accent: #ff7900; --accent-ink: #0b1416; --brand: #006770; --brand-2: #008C95; --deep: #006770;
  --accent-text: #ff7900; --brand-text: #35b5bd; --error: #ff6b6b;
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif; --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --sq-off: #33514e; --nav-bg: #070f11;
  --radius: 6px; --wrap: 1320px; --gutter: 40px; --shadow: none;
  color-scheme: dark;
}
/* tema médio "spark": navy-ciano-âmbar, cartões de vidro, corpo em Inter (base dark: herda tudo de :root) */
[data-theme="spark"] {
  --bg: #02151e; --surface: #002530; --surface-2: #011e28; --line: rgba(255,255,255,.10); --text: #f5f9fb; --muted: rgba(255,255,255,.55);
  --accent: #ec8f27; --accent-ink: #02151e; --brand: #007a8d; --brand-2: #00a0b9; --deep: #00738a;
  --accent-text: #f7bd79; --brand-text: #46c7dc; --sq-off: rgba(255,255,255,.22);
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --radius: 10px; --nav-bg: #010d14;
}
[data-theme="spark"] body { background: #02151e; }
[data-theme="spark"] body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: linear-gradient(180deg, #02151e, #002530 45%, #000c13); }
[data-theme="spark"] .card { background: rgba(255,255,255,.055); }
[data-theme="spark"] .card:hover { background: rgba(255,255,255,.075); }
[data-theme="spark"] .site-header { background: rgba(0,37,48,.72); backdrop-filter: blur(10px); }
[data-theme="spark"] h1, [data-theme="spark"] h2 { letter-spacing: -0.025em; }
[data-theme="light"] {
  --bg: #006770; --surface: #ffffff; --surface-2: #ffffff; --line: rgba(255,255,255,.35); --text: #ffffff; --muted: #d5eaec;
  --accent: #e66d00; --accent-ink: #12292c; --shadow: 0 6px 24px rgba(0,103,112,.10);
  --accent-text: #ffdba8; --brand-text: #d6f2f4; --error: #c62828; --sq-off: rgba(255,255,255,.45); --nav-bg: #00363c;
  color-scheme: light;
}
@font-face { font-family: "Space Grotesk"; font-weight: 500; src: url(/fonts/space-grotesk-latin-500-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Space Grotesk"; font-weight: 700; src: url(/fonts/space-grotesk-latin-700-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; src: url(/fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; src: url(/fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; src: url(/fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 400; src: url(/fonts/inter-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 500; src: url(/fonts/inter-latin-500-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 600; src: url(/fonts/inter-latin-600-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Shadows Into Light"; font-weight: 400; src: url(/fonts/shadows-into-light-latin-400-normal.woff2) format("woff2"); font-display: swap; }

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font-body); transition: background-color .3s, color .3s; }
/* tema claro: faixa teal no topo, brilho laranja à direita, fundo teal-cinza */
[data-theme="light"] body { background: var(--bg); }
[data-theme="light"] main { background: radial-gradient(900px 420px at 100% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%); }
/* dentro das folhas e cartões brancos volta o texto escuro */
[data-theme="light"] .card, [data-theme="light"] .alert, [data-theme="light"] .prose ol.steps li, [data-theme="light"] .prose ul.tags li, [data-theme="light"] .lang ul { --text: #12292c; --muted: #4f6266; --accent-text: #b85600; --brand-text: #006770; --line: #d3e0e2; color: var(--text); }
[data-theme="light"] .strip { --text: #ffffff; }
[data-theme="light"] .pill { border-color: rgba(255,255,255,.5); }
[data-theme="light"] .btn-ghost { border-color: rgba(255,255,255,.5); }
[data-theme="light"] .icon-btn { border-color: rgba(255,255,255,.5); }
/* tema claro: o texto principal numa folha branca sobre o fundo colorido */
[data-theme="light"] .site-header { background: color-mix(in srgb, #005a62 88%, transparent); border-bottom-color: rgba(255,255,255,.2); }
/* tema claro: rodapé teal */
[data-theme="light"] .site-footer { background: #004e55; color: #cfe4e7; border-top: 0; }
[data-theme="light"] .site-footer h4 { color: #fff; } [data-theme="light"] .site-footer a { color: #e6f3f4; } [data-theme="light"] .site-footer a:hover { color: #fff; }
[data-theme="light"] .site-footer .social a { border-color: rgba(255,255,255,.35); } [data-theme="light"] .site-footer .wa svg { color: #7ef0a4; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.1; letter-spacing: -0.01em; text-wrap: pretty; }
h1 { font-size: clamp(40px, 5vw, 72px); line-height: 1.02; letter-spacing: -0.02em; }
h2 { font-size: clamp(28px, 3vw, 36px); }
h3 { font-size: 22px; }
p { margin: 0 0 1em; }
a { color: var(--accent-text); text-decoration: none; } a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.muted { color: var(--muted); }
.eyebrow { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-text); font-weight: 600; }
.section { padding: 96px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 40px; }
.section-head p { max-width: 520px; text-align: right; margin: 0; }
.prose { max-width: 760px; } .prose h2 { font-size: 26px; margin: 1.6em 0 .5em; } .prose ul { padding-left: 1.2em; } .prose li { margin-bottom: .6em; padding-left: .3em; }
.prose li::marker { color: var(--accent-text); font-size: 1.1em; } .prose strong { color: var(--brand-text); }
.prose > p:first-child { font-size: 18px; }
/* secções <h2> do corpo em cartões (Missão, Visão, Valores, Objetivos) */
.section-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 40px; }
.section-cards .card { gap: 0; } .section-cards .card h2 { margin: 0 0 12px; font-size: 22px; color: var(--card-text); }
.section-cards .card p, .section-cards .card ul { margin: 0; font-size: 15px; } .section-cards .card ul { padding-left: 1.1em; } .section-cards .card li { margin-bottom: .7em; }
.section-cards .card:has(ul) { grid-column: 1 / -1; }

/* ===== Botões / tags ===== */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 24px; border-radius: var(--radius); font-weight: 600; font-size: 15px; border: 1px solid transparent; cursor: pointer; font-family: inherit; line-height: 1; min-height: 44px; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-sm { padding: 10px 16px; font-size: 14px; }
.theme-switch { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.theme-switch button { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 44px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.theme-switch button:hover { color: var(--text); }
.theme-switch button[aria-pressed="true"] { background: var(--brand-2); color: #fff; }
[data-theme="light"] .theme-switch { border-color: rgba(255,255,255,.5); }
[data-theme="light"] .theme-switch button[aria-pressed="true"] { background: #ffffff; color: #12292c; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--radius); border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; }
.tag { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.pill { padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; min-height: 44px; }
.pill[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ===== Cartões V2 ===== */
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--card-color, var(--brand-2)); border-radius: var(--radius); padding: 32px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); transition: transform .25s, border-color .25s; }
a.card { color: inherit; } a.card:hover { text-decoration: none; transform: translateY(-3px); }
.card .badge { width: 44px; height: 44px; border-radius: 8px; background: var(--card-color, var(--brand-2)); display: flex; align-items: center; justify-content: center; color: #fff; }
.card .card-link { color: var(--card-text, var(--accent-text)); font-size: 14px; font-weight: 600; margin-top: auto; }
.card-teal { --card-color: var(--brand-2); --card-text: var(--brand-text); } .card-orange { --card-color: var(--accent); --card-text: var(--accent-text); } .card-deep { --card-color: var(--deep); --card-text: var(--brand-text); }
.card-sm { padding: 22px; gap: 8px; } .card-sm .tag { color: var(--card-text); }
.card-img { aspect-ratio: 16/10; object-fit: cover; border-radius: 4px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }

/* tema claro: cartões V1 — fundo suavemente tintado com a cor do cartão (o escuro mantém V2) */
[data-theme="light"] .card { background: color-mix(in srgb, var(--card-color, var(--brand-2)) 24%, #ffffff); border-color: color-mix(in srgb, var(--card-color, var(--brand-2)) 55%, var(--line)); }
[data-theme="light"] .card .badge { box-shadow: 0 4px 12px color-mix(in srgb, var(--card-color, var(--brand-2)) 45%, transparent); }
[data-theme="light"] .prose ol.steps li { background: color-mix(in srgb, var(--brand-2) 20%, #ffffff); border-color: color-mix(in srgb, var(--brand-2) 30%, var(--line)); }
[data-theme="light"] .prose ul.tags li { background: color-mix(in srgb, var(--brand-2) 22%, #ffffff); border-color: color-mix(in srgb, var(--brand-2) 35%, var(--line)); }
[data-theme="light"] .strip { box-shadow: 0 16px 40px rgba(0,103,112,.25); }

/* cartão do logótipo animado: sempre com o fundo do tema escuro (o logo foi desenhado para ele) */
.logo-card, [data-theme="light"] .logo-card { --text: #ffffff; --muted: #9fb0b2; --line: #1d3230; background: #0b1416 !important; border-color: #1d3230 !important; color: var(--text); }
.logo-card .logo-anim .sq { background: var(--sq-off); } .logo-card .logo-thoughts { color: #ffffff; }
[data-theme="light"] .logo-card { background: #143d41 !important; border-color: rgba(53,181,189,.45) !important; border-top: 4px solid #35b5bd !important; --line: #2a5a5f; }   /* no claro, o mesmo teal dos outros cartões */

/* tema claro: cartões teal como variante mais clara do fundo (como no escuro), com texto branco */
[data-theme="light"] .card-teal, [data-theme="light"] .card-deep { background: #143d41; border-color: rgba(53,181,189,.45); border-top-color: #35b5bd; --text: #ffffff; --muted: #9fb0b2; --brand-text: #7fe0e6; --card-text: #7fe0e6; --accent-text: #ffc77d; --line: #1d3230; color: #ffffff; box-shadow: 0 8px 24px rgba(0,40,45,.25); }
[data-theme="light"] .card-orange { --accent-text: #8a4000; --card-text: #8a4000; }
[data-theme="light"] .card-teal .badge, [data-theme="light"] .card-deep .badge { background: #008C95; color: #ffffff; }
[data-theme="light"] .card-teal h2, [data-theme="light"] .card-deep h2, [data-theme="light"] .card-teal h3, [data-theme="light"] .card-deep h3 { color: #ffffff; }
[data-theme="light"] .card-teal .card-img, [data-theme="light"] .card-deep .card-img { border: 3px solid rgba(255,255,255,.6); }

/* ===== Header ===== */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 16px; padding-bottom: 16px; }
.site-header-portal .wrap { height: 55px; padding: 0 24px 0 20px; max-width: none; }
.site-header-portal .brand { min-height: 36px; font-size: 18px; }
.site-header-portal .brand .logo-anim { width: 24px; height: 24px; }
.brand { display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 32px; } .nav a { color: var(--muted); font-size: 15px; } .nav a:hover, .nav a[aria-current="page"] { color: var(--text); text-decoration: none; }
.actions { display: flex; align-items: center; gap: 12px; }
.lang-curto { display: none; }
.lang { position: relative; } .lang summary { list-style: none; cursor: pointer; font-size: 13px; font-weight: 600; padding: 12px 10px; }
.lang summary::-webkit-details-marker { display: none; }
.lang ul { position: absolute; right: 0; top: 100%; margin: 4px 0 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 150px; }
.lang li a { display: block; padding: 12px 12px; color: var(--text); font-size: 14px; border-radius: 4px; } .lang li a:hover { background: var(--bg); text-decoration: none; }
.burger { display: none; }
.theme-toggle .sun, .theme-toggle .half { display: none; }
[data-theme="spark"] .theme-toggle .half { display: block; } [data-theme="spark"] .theme-toggle .moon { display: none; }
[data-theme="light"] .theme-toggle .sun { display: block; } [data-theme="light"] .theme-toggle .moon { display: none; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 24px; font-size: 14px; color: var(--muted); background: color-mix(in srgb, var(--brand) 10%, var(--bg)); }
.site-footer .wrap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.site-footer h4 { font-family: var(--font-body); font-size: 14px; color: var(--text); margin-bottom: 6px; }
.site-footer p { margin-bottom: .6em; }
.site-footer h4 + p + h4, .site-footer p + h4 { margin-top: 14px; }
.site-footer a { color: var(--muted); } .site-footer a:hover { color: var(--text); }
.site-footer .partner img { width: 160px; margin-top: 10px; }   /* PNG com texto branco sobre transparente: fica direto sobre o rodapé escuro */
.social { display: flex; gap: 12px; } .social a { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: var(--radius); }

/* ===== Hero ===== */
.hero { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 32px; align-items: center; padding-top: 120px; padding-bottom: 96px; }   /* não usar o shorthand: apagaria o gutter do .wrap */
.hero-text { grid-column: span 7; display: flex; flex-direction: column; gap: 28px; }
.hero-text p { font-size: 20px; max-width: 560px; margin: 0; color: var(--muted); }
.hero-art { grid-column: span 5; display: flex; justify-content: flex-end; }
.hero-cta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

/* ===== Logótipo animado (baralha "a trabalhar" → assenta → lâmpada 4 s) ===== */
.logo-anim { position: relative; width: 240px; height: 240px; cursor: pointer; }
.logo-anim .sq { position: absolute; left: 0; top: 0; width: 64px; height: 64px; border-radius: 4px; background: var(--sq-off); display: flex; align-items: center; justify-content: center; transition: transform .55s cubic-bezier(.2,.8,.2,1), background-color .5s ease, opacity .5s ease; }
.logo-anim.lit-on .sq { opacity: .45; } .logo-anim.lit-on .sq.lit { opacity: 0; }
.logo-anim .sq.settle { transition-duration: 1.6s, 1.6s, .5s; }
.logo-anim .big-bulb { position: absolute; left: 50%; top: 50%; width: 62%; height: 62%; transform: translate(-50%, -50%) scale(0); opacity: 0; pointer-events: none; transition: transform 1.9s cubic-bezier(.3,.6,.3,1), opacity .5s, filter 1.9s; z-index: 3; filter: drop-shadow(0 0 2px rgba(255,209,102,.3)); }
.logo-anim .big-bulb.fly { opacity: 1; transform: translate(-50%, -50%) scale(1) !important; filter: drop-shadow(0 0 28px rgba(255,209,102,1)); }
.logo-anim.lit-on .big-bulb { animation: bulb-pulse 1.1s ease-in-out infinite alternate; }
@keyframes bulb-pulse { from { filter: drop-shadow(0 0 10px rgba(255,209,102,.6)); } to { filter: drop-shadow(0 0 30px rgba(255,209,102,1)); } }
.logo-thoughts { min-height: 40px; font-family: "Shadows Into Light", "Segoe Script", cursive; font-size: 28px; color: var(--muted); opacity: 0; transition: opacity .3s; }
.logo-thoughts.on { opacity: 1; }

/* ===== Quadro de giz (hero) — sequência do site antigo ===== */
.chalk { position: relative; width: 100%; max-width: 520px; aspect-ratio: 520/380; }
.chalk img { position: absolute; opacity: 0; transform: scale(.3); animation: chalk-pop .6s cubic-bezier(.34,1.56,.64,1) forwards; mix-blend-mode: screen; }
[data-theme="light"] .chalk img { filter: none; }   /* giz branco sobre o teal */
.chalk .box { right: 8%; bottom: 22%; width: 22%; animation-delay: .4s; }
.chalk .b1 { right: 26%; bottom: 44%; width: 4%; animation-delay: .7s; }
.chalk .b2 { right: 31%; bottom: 50%; width: 6%; animation-delay: .9s; }
.chalk .b3 { right: 38%; bottom: 57%; width: 9%; animation-delay: 1.1s; }
.chalk .cloud { left: 0; top: 0; width: 66%; animation-delay: 1.4s; animation-duration: .8s; }
.chalk .motto { position: absolute; left: 4%; bottom: 0; margin: 0; font-family: "Shadows Into Light", "Segoe Script", cursive; font-size: clamp(30px, 3.6vw, 52px); line-height: 1.05; color: var(--text); text-transform: uppercase; opacity: 0; transform: translateX(-40px); animation: chalk-text .6s ease-out 1.9s forwards; }
.chalk .motto span { display: block; } .chalk .motto span:nth-child(2) { padding-left: .6em; } .chalk .motto span:nth-child(3) { padding-left: 1.2em; }
@keyframes chalk-pop { to { opacity: 1; transform: scale(1); } }
@keyframes chalk-text { to { opacity: 1; transform: none; } }
.brand .logo-anim { width: 30px; height: 30px; } .brand .logo-anim .sq { border-radius: 1px; transition-duration: .8s, .4s; }


/* ===== Faixa ===== */
.strip { background: var(--brand); color: #fff; border-radius: var(--radius); padding: 56px 64px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 32px; align-items: center; }
.strip .eyebrow { color: #ffd1a6; } .strip h2 { grid-column: span 8; font-size: 28px; line-height: 1.25; }
.strip > div:first-child { grid-column: span 8; } .strip > div:last-child { grid-column: span 4; display: flex; justify-content: flex-end; }
.strip .btn { background: #fff; color: var(--brand); }

/* ===== Página com coluna lateral (serviço, sobre nós) ===== */
.page-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 64px; align-items: start; }
.page-layout .prose { max-width: none; }
.page-aside { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 20px; }
.page-aside .logo-anim { width: 150px; height: 150px; flex: none; }
.page-aside .logo-thoughts { flex: 1; font-size: 22px; line-height: 1.2; min-height: 0; }
.logo-thoughts.tagline { display: flex; flex-direction: column; justify-content: space-between; font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: -0.01em; color: var(--text); }
.page-aside .logo-thoughts.tagline { height: 150px; }
.logo-thoughts.tagline span { transform-origin: left center; animation: tag-grow 3.2s cubic-bezier(.3,.6,.3,1) both; }
.logo-thoughts.tagline span:nth-child(2) { animation-delay: .4s; } .logo-thoughts.tagline span:nth-child(3) { animation-delay: .8s; } .logo-thoughts.tagline span:nth-child(4) { animation-delay: 1.2s; }
@keyframes tag-grow { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }
.prose ul.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.prose ul.tags li { margin: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: 14px; }

/* ===== Processo em passos (ol.steps no texto rico) ===== */
.prose ol.steps { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; counter-reset: step; }
.prose ol.steps li { position: relative; margin: 0; padding: 52px 16px 18px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--brand-2); border-radius: var(--radius); font-size: 14px; line-height: 1.5; counter-increment: step; }
.prose ol.steps li::before { content: counter(step, decimal-leading-zero); position: absolute; top: 12px; left: 16px; font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--accent-text); }
.prose ol.steps li strong { display: block; font-family: var(--font-display); font-size: 17px; color: var(--text); margin-bottom: 6px; }
.prose h3 { font-size: 15px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 28px 0 10px; }
.prose ul.tags + h3 { margin-top: 20px; } .prose ol.steps + h3:has(+ ul.tags) { margin-top: 28px; }

/* ===== Funcionalidades (ul.features no texto rico das soluções) ===== */
.prose ul.features { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; }
.prose ul.features > li { position: relative; padding-left: 26px; margin: 0; font-size: 15px; }
.prose ul.features > li::before { content: ""; position: absolute; left: 0; top: 4px; width: 17px; height: 17px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11' fill='%23008C95'/%3E%3Cpath d='M7 12.5l3.2 3.2L17 9' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.prose ul.features > li:has(ul) { grid-column: 1 / -1; }
.prose ul.features ul { list-style: none; padding: 6px 0 0 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; }
.prose ul.features ul li { position: relative; padding-left: 18px; margin: 0; font-size: 14px; color: var(--muted); }
.prose ul.features ul li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ===== Carrossel (caixa única, imagens a passar em fade) ===== */
.carousel { position: relative; aspect-ratio: 3 / 2; border-radius: 10px; overflow: hidden; border: 4px solid var(--surface); outline: 1px solid var(--line); background: var(--surface); box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.carousel-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.85); color: #12292c; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity .25s, background .2s; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.carousel-arrow.prev { left: 12px; } .carousel-arrow.next { right: 12px; }
.carousel:hover .carousel-arrow, .carousel:focus-within .carousel-arrow { opacity: 1; }
.carousel-arrow:hover { background: var(--accent); color: var(--accent-ink); }
@media (hover: none) { .carousel-arrow { opacity: 1; } }
.carousel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .8s ease; }
.carousel img.is-active { opacity: 1; }
.carousel-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 8px; }
.carousel-dots button { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 0; background: rgba(255,255,255,.55); cursor: pointer; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.carousel-dots button[aria-selected="true"] { background: var(--accent); }
.solution-aside { position: sticky; top: 96px; }


.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.2,1); transition-delay: calc(var(--i, 0) * 80ms); }
.reveal.in { opacity: 1; transform: none; }


/* ===== Ciclo "Como trabalhamos" (ol.steps.cycle): 5 passos nos vértices de um hexágono, hexágono ao centro e anel de setas ===== */
.prose { container-type: inline-size; }
@container (min-width: 680px) {
  .prose ol.steps.cycle { display: block; position: relative; height: 760px; margin-top: 16px; }
  /* cartões hexagonais (250×280): a cor de fundo do li é a moldura, ::after é o miolo */
  .prose ol.steps.cycle li { position: absolute; width: 250px; height: 280px; padding: 86px 30px 30px; text-align: center; font-size: 13px; line-height: 1.45; border: 0; border-radius: 0; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: var(--brand-2); isolation: isolate; }
  .prose ol.steps.cycle li::after { content: ""; position: absolute; inset: 3px; z-index: -1; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: var(--surface); }
  .prose ol.steps.cycle li::before { top: 56px; left: 0; right: 0; font-size: 20px; }
  .prose ol.steps.cycle li strong { font-size: 16px; }
  .prose ol.steps.cycle li:nth-child(1) { left: calc(50cqw - 125px); top: 0; }
  .prose ol.steps.cycle li:nth-child(2) { left: calc(100cqw - 250px); top: 185px; }
  .prose ol.steps.cycle li:nth-child(3) { left: calc(50cqw + 45px); top: 480px; }
  .prose ol.steps.cycle li:nth-child(4) { left: calc(50cqw - 295px); top: 480px; }
  .prose ol.steps.cycle li:nth-child(5) { left: 0; top: 185px; }
  .prose ol.steps.cycle::before { content: ""; position: absolute; left: calc(50cqw - 65px); top: 340px; width: 130px; height: 130px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%23ff7900'%3E%3Crect x='2' y='2' width='5.5' height='5.5' rx='1'/%3E%3Crect x='9.25' y='2' width='5.5' height='5.5' rx='1'/%3E%3Crect x='16.5' y='2' width='5.5' height='5.5' rx='1'/%3E%3Crect x='2' y='9.25' width='5.5' height='5.5' rx='1'/%3E%3Crect x='16.5' y='9.25' width='5.5' height='5.5' rx='1'/%3E%3Crect x='2' y='16.5' width='5.5' height='5.5' rx='1'/%3E%3Crect x='9.25' y='16.5' width='5.5' height='5.5' rx='1'/%3E%3Crect x='16.5' y='16.5' width='5.5' height='5.5' rx='1'/%3E%3C/g%3E%3Crect x='9.25' y='9.25' width='5.5' height='5.5' rx='1' fill='%23008C95'/%3E%3C/svg%3E") center / 52px no-repeat, #0b1416; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
  .prose ol.steps.cycle::after { content: ""; position: absolute; left: calc(50cqw - 100px); top: 305px; width: 200px; height: 200px; background: var(--accent); mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' fill='none' stroke='%23000' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M118.3 13.9A88 88 0 0 1 167.4 43.4M157.5 44.4L173.0 50.8L169.1 33.3M187.5 90.8A88 88 0 0 1 174.6 146.6M170.6 137.6L169.3 154.2L184.8 145.1M135.8 180.4A88 88 0 0 1 78.7 185.4M86.1 178.8L69.9 182.7L83.3 194.5M34.6 158.9A88 88 0 0 1 12.2 106.1M20.8 111.1L12.1 96.9L4.9 113.4M23.8 56.0A88 88 0 0 1 67.0 18.4M64.9 28.1L75.7 15.4L57.9 13.7'/%3E%3C/svg%3E") center / contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' fill='none' stroke='%23000' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M118.3 13.9A88 88 0 0 1 167.4 43.4M157.5 44.4L173.0 50.8L169.1 33.3M187.5 90.8A88 88 0 0 1 174.6 146.6M170.6 137.6L169.3 154.2L184.8 145.1M135.8 180.4A88 88 0 0 1 78.7 185.4M86.1 178.8L69.9 182.7L83.3 194.5M34.6 158.9A88 88 0 0 1 12.2 106.1M20.8 111.1L12.1 96.9L4.9 113.4M23.8 56.0A88 88 0 0 1 67.0 18.4M64.9 28.1L75.7 15.4L57.9 13.7'/%3E%3C/svg%3E") center / contain no-repeat; animation: ring-spin 60s linear infinite; }
}
@keyframes ring-spin { to { transform: rotate(360deg); } }
[data-theme="light"] .prose ol.steps.cycle::before { background-color: #143d41; }
[data-theme="light"] .prose ol.steps.cycle li { background: color-mix(in srgb, var(--brand-2) 45%, var(--line)); } [data-theme="light"] .prose ol.steps.cycle li::after { background: color-mix(in srgb, var(--brand-2) 20%, #ffffff); }

/* ===== Diagrama de camadas: h3 + ul.tags consecutivos viram faixas empilhadas ligadas por setas ===== */
.prose h3:has(+ ul.tags) { position: relative; margin: 0; padding: 16px 18px 6px 60px; line-height: 20px; font-size: 13px; letter-spacing: .12em; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; border-left: 4px solid var(--tier, var(--brand-2)); }
.prose h3:has(+ ul.tags)::before { content: ""; position: absolute; left: 18px; top: 12px; width: 26px; height: 26px; border-radius: 6px; background: var(--tier, var(--brand-2)); }
.prose h3:has(+ ul.tags)::after { content: ""; position: absolute; left: 18px; top: 12px; width: 26px; height: 26px; background: #fff; mask: var(--tier-icon) center / 18px no-repeat; -webkit-mask: var(--tier-icon) center / 18px no-repeat; }
.prose h3 + ul.tags { margin: 0 0 34px; padding: 10px 18px 16px 60px; background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); border-left: 4px solid var(--tier, var(--brand-2)); position: relative; }
.prose h3 + ul.tags:has(+ h3)::after { content: ""; position: absolute; left: 50%; bottom: -30px; width: 2px; height: 26px; background: var(--muted); }
.prose h3 + ul.tags:has(+ h3)::before { content: ""; position: absolute; left: calc(50% - 5px); bottom: -32px; width: 12px; height: 12px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
/* cor e ícone por camada (1.ª front-end, 2.ª back-end, 3.ª dados) */
.prose h3:nth-of-type(1):has(+ ul.tags), .prose h3:nth-of-type(1) + ul.tags { --tier: var(--brand-2); --tier-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='4' width='18' height='12' rx='2'/%3E%3Cpath d='M8 20h8M12 16v4'/%3E%3C/svg%3E"); }
.prose h3:nth-of-type(2):has(+ ul.tags), .prose h3:nth-of-type(2) + ul.tags { --tier: var(--accent); --tier-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M8 9l-4 3 4 3M16 9l4 3-4 3M14 5l-4 14'/%3E%3C/svg%3E"); }
.prose h3:nth-of-type(3):has(+ ul.tags), .prose h3:nth-of-type(3) + ul.tags { --tier: var(--deep); --tier-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cellipse cx='12' cy='6' rx='8' ry='3'/%3E%3Cpath d='M4 6v6c0 1.7 3.6 3 8 3s8-1.3 8-3V6M4 12v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6'/%3E%3C/svg%3E"); }
[data-theme="light"] .prose h3:has(+ ul.tags), [data-theme="light"] .prose h3 + ul.tags { background: #143d41; border-color: rgba(53,181,189,.45); --text: #ffffff; color: #ffffff; }
[data-theme="light"] .prose h3:nth-of-type(3):has(+ ul.tags), [data-theme="light"] .prose h3:nth-of-type(3) + ul.tags { --tier: #35b5bd; }
[data-theme="light"] .prose h3 + ul.tags li { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.3); color: #fff; }

/* ===== Diagrama de arquitetura animado (página Tecnologia) ===== */
.arch { margin: 32px 0 8px; padding: 12px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.arch svg { width: 100%; height: auto; display: block; }
.arch-link { stroke: var(--line); stroke-width: 3; stroke-dasharray: 8 8; animation: arch-dash 1.2s linear infinite; }
.arch-dot { fill: var(--accent); animation: arch-flow 2.4s ease-in-out infinite; animation-delay: var(--d, 0s); }
.arch-dot.back { fill: var(--brand-2); }
.arch-ring { fill: none; stroke: var(--brand-2); stroke-width: 1.5; opacity: .5; animation: arch-pulse 3s ease-in-out infinite; animation-delay: calc(var(--i) * .3s); transform-origin: center; transform-box: fill-box; }
.arch-fill { fill: var(--brand-2); }
.arch-node:nth-child(odd) .arch-fill { fill: var(--brand); }
.arch-icon { fill: none; stroke: #ffffff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.arch-label { font: 600 15px var(--font-body); fill: var(--text); }
@keyframes arch-dash { to { stroke-dashoffset: -16; } }
@keyframes arch-flow { 0% { transform: translateX(0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateX(var(--dist)); opacity: 0; } }
@keyframes arch-pulse { 0%, 100% { transform: scale(1); opacity: .5; } 50% { transform: scale(1.12); opacity: .15; } }
[data-theme="light"] .arch { background: #143d41; border-color: rgba(53,181,189,.45); }
[data-theme="light"] .arch-label { fill: #ffffff; } [data-theme="light"] .arch-link { stroke: rgba(255,255,255,.35); }
[data-theme="light"] .arch-fill { fill: #008C95; } [data-theme="light"] .arch-node:nth-child(odd) .arch-fill { fill: #35b5bd; } [data-theme="light"] .arch-ring { stroke: #35b5bd; }
@media (max-width: 700px) { .arch-label { font-size: 22px; } }

/* ===== WhatsApp ===== */
.wa { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.wa svg { color: #25d366; flex: none; }
.wa-float { position: fixed; right: 20px; bottom: 20px; z-index: 40; }
.wa-float .wa { background: #25d366; color: #0b1416; border-radius: 50%; width: 56px; height: 56px; padding: 0; justify-content: center; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.wa-float .wa span { display: none; } .wa-float .wa svg { width: 28px; height: 28px; }
.wa-float .wa svg { color: #0b1416; } .wa-float .wa:hover { text-decoration: none; filter: brightness(1.05); }


/* tema claro: campos em teal escuro com borda branca */
[data-theme="light"] .form-field input, [data-theme="light"] .form-field select, [data-theme="light"] .form-field textarea { background: #143d41; color: #ffffff; border: 1px solid rgba(255,255,255,.75); }
[data-theme="light"] .form-field input::placeholder, [data-theme="light"] .form-field textarea::placeholder { color: #9fb0b2; }
[data-theme="light"] .form-field select { color-scheme: dark; }
[data-theme="light"] .form-field select option { background: #143d41; color: #ffffff; }
[data-theme="light"] .form-field input:focus, [data-theme="light"] .form-field select:focus, [data-theme="light"] .form-field textarea:focus { border-color: var(--accent); }
[data-theme="light"] .form-field input[type="file"]::file-selector-button { background: #ffffff; color: #143d41; border: 0; }
[data-theme="light"] .prose strong { color: #ffffff; }
[data-theme="light"] .portal-nav { border-right-color: rgba(255,255,255,.18); }
[data-theme="light"] .portal-voltar { color: #cfe4e7; } [data-theme="light"] .portal-voltar:hover { background: #143d41; color: #fff; }
[data-theme="light"] .portal-orelha { border-color: rgba(255,255,255,.25); color: #cfe4e7; }
[data-theme="light"] .portal-nav-fundo { border-top-color: rgba(255,255,255,.25); }
[data-theme="light"] .portal-nav nav a, [data-theme="light"] .portal-nav-sair { color: #cfe4e7; }
[data-theme="light"] .portal-nav nav a:hover, [data-theme="light"] .portal-nav-sair:hover { background: #143d41; color: #fff; }
[data-theme="light"] .portal-nav nav a[aria-current="page"] { background: #143d41; color: #ffb15c; }
[data-theme="light"] .portal-me { border-bottom-color: rgba(255,255,255,.25); }
[data-theme="light"] .portal-idioma a { color: #cfe4e7; border-color: rgba(255,255,255,.35); }
[data-theme="light"] .portal-idioma a[aria-current="true"] { background: #143d41; color: #ffffff; border-color: var(--accent); }

/* ===== Formulários ===== */
.contact-layout form { max-width: 520px; }
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-field label { font-size: 14px; font-weight: 500; }
.form-field input, .form-field select, .form-field textarea { font: inherit; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.form-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .form-field select { height: 48px; padding: 0 14px; line-height: normal; }
.form-field input[type="file"] { height: auto; padding: 8px; }
.form-field input[type="file"]::file-selector-button { height: 30px; padding: 0 12px; margin-right: 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.form-field textarea { min-height: 140px; }
.login-wrap { max-width: 420px; }
.login-wrap .section { padding: 40px 0; }
.login-wrap .card { padding: 22px 24px; }
.login-wrap .form-field { margin-bottom: 14px; }
.login-wrap .form-field input { height: 44px; }
.login-wrap .btn { width: 100%; justify-content: center; }
.form-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .form-duo, .portal-form-2 { grid-template-columns: 1fr; } }
.form-error { color: var(--error); font-size: 13px; }
.form-field [aria-invalid="true"] { border-color: var(--error); }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.alert { padding: 14px 18px; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 24px; }
.alert { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.alert::before { content: ""; flex: none; width: 20px; height: 20px; margin-top: 1px; background: currentColor; mask: var(--alert-icon) center / contain no-repeat; -webkit-mask: var(--alert-icon) center / contain no-repeat; }
.alert-ok { border-color: var(--brand-2); border-left: 4px solid var(--brand-2); background: color-mix(in srgb, var(--brand-2) 16%, transparent); color: var(--text); --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E"); }
.alert-err { border-color: var(--error); border-left: 4px solid var(--error); background: color-mix(in srgb, var(--error) 16%, transparent); color: var(--text); --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v6M12 16.5v.5'/%3E%3C/svg%3E"); }
.alert-err strong, .alert-ok strong { font-weight: 600; }
[data-theme="light"] .alert-ok { background: color-mix(in srgb, var(--brand-2) 10%, #ffffff); }
[data-theme="light"] .alert-err { background: color-mix(in srgb, var(--error) 10%, #ffffff); }
.hp { position: absolute; left: -9999px; }

/* ===== View Transitions (filtro de soluções) ===== */
::view-transition-group(*) { animation-duration: .45s; animation-timing-function: cubic-bezier(.2,.8,.2,1); }
::view-transition-old(*):only-child { animation: vt-out .3s ease forwards; }
::view-transition-new(*):only-child { animation: vt-in .35s ease .1s both; }
@keyframes vt-out { to { opacity: 0; transform: scale(.92); } }
@keyframes vt-in { from { opacity: 0; transform: scale(.92); } }

/* ===== Portal da área reservada ===== */
.portal { padding: 0; }
.portal-wrap { max-width: none; display: block; padding: 0 0 0 248px; min-height: 100vh; transition: padding-left .25s ease; }
.nav-fechado .portal-wrap { padding-left: 0; }
.portal-nav { position: fixed; top: 0; left: 0; z-index: 60; width: 248px; height: 100vh; overflow-y: auto; scrollbar-gutter: stable both-edges; display: flex; flex-direction: column; gap: 4px; padding: 14px 12px 12px; background: var(--nav-bg); border-right: 1px solid var(--line); transition: transform .25s ease; }
.nav-fechado .portal-nav { transform: translateX(-100%); }
.portal-marca { justify-content: center; padding: 6px 8px 14px; min-height: 0; font-size: 17px; gap: 10px; }
.portal-marca .logo-anim { width: 24px; height: 24px; }
.portal-barra { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 6px 14px; }
.portal-barra .portal-idioma, .portal-barra .theme-switch { display: flex; height: 32px; padding: 0; gap: 0; border: 1px solid rgba(255,255,255,.28); border-radius: 8px; overflow: hidden; background: none; }
.portal-barra .portal-idioma a, .portal-barra .theme-switch button { display: inline-flex; align-items: center; justify-content: center; height: 30px; min-width: 34px; padding: 0 9px; border: 0; border-radius: 0; background: none; color: rgba(255,255,255,.7); font: 600 12px/1 var(--font-body); cursor: pointer; }
.portal-barra .portal-idioma a + a, .portal-barra .theme-switch button + button { border-left: 1px solid rgba(255,255,255,.28); }
.portal-barra .portal-idioma a:hover, .portal-barra .theme-switch button:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.portal-barra .portal-idioma a[aria-current="true"], .portal-barra .theme-switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.portal-nav-fundo { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.portal-nav-fundo form { display: flex; }
.portal-voltar { display: block; padding: 7px 14px; border-radius: 8px; font-size: 13px; text-align: center; color: var(--muted); }
.portal-voltar:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.portal-orelha { position: fixed; top: 50%; left: 248px; z-index: 61; width: 20px; height: 54px; margin-top: -27px; display: flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--line); border-left: 0; border-radius: 0 8px 8px 0; background: var(--nav-bg); color: var(--muted); cursor: pointer; transition: left .25s ease, color .2s; }
.portal-orelha:hover { color: var(--text); }
.portal-orelha svg { transition: transform .25s ease; }
.nav-fechado .portal-orelha { left: 0; }
.nav-fechado .portal-orelha svg { transform: rotate(180deg); }
.portal-me { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; font-size: 13px; padding: 4px 12px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.portal-me strong { font-size: 15px; }
.portal-idioma { display: flex; gap: 4px; padding: 0 12px 12px; }
.portal-idioma a { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--muted); }
.portal-idioma a[aria-current="true"] { background: var(--surface); color: var(--text); border-color: var(--accent); font-weight: 600; }
.portal-idioma a:hover { text-decoration: none; color: var(--text); }
.portal-nav nav { display: flex; flex-direction: column; gap: 2px; }
.portal-nav nav a, .portal-nav-sair { display: block; padding: 9px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 14px; background: none; border: 0; border-left: 3px solid transparent; text-align: left; font-family: inherit; cursor: pointer; width: 100%; }
.portal-nav nav a:hover, .portal-nav-sair:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.portal-nav nav a[aria-current="page"] { background: var(--surface); color: var(--accent); font-weight: 600; }   /* o nome a laranja, sem barra: a barra competia com a linha do grupo */
.portal-nav-sair { width: auto; padding: 8px 22px; border: 1px solid var(--line); border-radius: 8px; text-align: center; font-weight: 600; color: var(--muted); }
.portal-nav-sair:hover { background: none; border-color: var(--error); color: var(--error); }
.portal-main { padding: 24px 40px 56px; min-width: 0; }
[data-theme="light"] .portal-main { --surface: #143d41; --surface-2: #0f3034; --line: rgba(255,255,255,.22); --error: #ff9a92; }
.portal-h1 { font-size: 26px; margin: 0 0 20px; }
.portal-main .card { padding: 20px 22px; }
.portal-main .form-field { gap: 4px; margin-bottom: 12px; }
.portal-main .form-field label { font-size: 13px; font-weight: 500; color: var(--muted); }
.portal-main .form-field input, .portal-main .form-field select, .portal-main .form-field textarea { font-size: 14px; padding: 7px 10px; border-radius: 8px; }
.portal-main .form-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .portal-main .form-field select { height: 38px; padding: 0 10px; }
.portal-main .form-field input[type="file"] { height: auto; padding: 4px; }
.portal-main .form-field input[type="file"]::file-selector-button { height: 28px; font-size: 13px; padding: 0 10px; margin-right: 10px; }
.portal-main .form-field textarea { min-height: 76px; }
.portal-main .btn { min-height: 38px; padding: 9px 18px; font-size: 14px; }
.portal-main .btn-sm { min-height: 32px; padding: 6px 12px; font-size: 13px; }
.portal-form { max-width: 480px; }
/* Um formulario de dois campos nao deve ter 1800px - cansa a ler, e por isso que o
   limite existe. Mas os do financeiro tem sete, e a 480px caiem todos numa coluna
   com meio ecra vazio ao lado. Estes crescem ate caberem tres ou quatro. */
.portal-form.largo { max-width: 1040px; }
.portal-form-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 14px; }
.portal-form-2 > .form-field-full, .portal-form-2 > fieldset, .portal-form-2 > .portal-acoes, .portal-form-2 > .alert, .portal-form-2 > p { grid-column: 1 / -1; }
.portal-acoes { display: flex; gap: 10px; margin-top: 6px; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 0 0 6px; }
.form-check input[type="checkbox"] { width: 17px; height: 17px; min-height: 0; flex: none; }
.form-ajuda { font-size: 12px; color: var(--muted); margin: -2px 0 12px; }
.portal-vazio { margin: 6px 0 0; padding: 20px 0; color: var(--muted); font-size: 14px; }
.portal-dados { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 14px; }
.portal-dados dt { color: var(--muted); padding-top: 2px; } .portal-dados dd { margin: 0; }
.portal-sub { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.portal-intro { font-size: 18px; margin: 0 0 28px; }
/* tecto de três colunas: com auto-fit sem limite, quanto maior o ecrã mais apertada ficava
   cada carta — e os emails da lista truncavam */
.portal-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
@media (min-width: 1150px) { .portal-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.portal-card-larga { grid-column: span 2; }
.portal-cards .card { padding: 20px; gap: 10px; }
.portal-cards .card p { margin: 0; }
.portal-cards .portal-table { table-layout: fixed; }
.portal-cards .portal-table td { padding: 5px 6px; overflow-wrap: anywhere; }
.portal-cards .portal-table td:first-child { width: 88px; white-space: nowrap; }
.portal-cards .card-link { margin-top: 6px; }
.portal-lista { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.portal-lista li { display: flex; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.portal-lista li:last-child { border-bottom: 0; }
.portal-lista li span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-apagar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.portal-apagar:hover { color: var(--error); border-color: var(--error); }
.portal-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.portal-table th, .portal-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.portal-table th { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.portal-table tbody tr:hover { background: color-mix(in srgb, currentColor 7%, transparent); }
.acesso-pw { white-space: nowrap; } .acesso-pw code { font-family: ui-monospace, monospace; background: var(--surface); padding: 2px 6px; border-radius: 4px; }
.portal-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.portal-toolbar .portal-pill, .portal-toolbar .btn, .portal-toolbar label { display: inline-flex; align-items: center; height: 38px; }
.portal-toolbar label { gap: 8px; font-size: 14px; }
.portal-toolbar input:not([type="checkbox"]):not([type="radio"]), .portal-toolbar select { font: inherit; font-size: 14px; height: 38px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
[data-theme="light"] .portal-toolbar input:not([type="checkbox"]):not([type="radio"]), [data-theme="light"] .portal-toolbar select { color-scheme: dark; background: #143d41; color: #ffffff; border-color: rgba(255,255,255,.4); }
[data-theme="light"] .portal-toolbar input::placeholder { color: #9fb0b2; }
[data-theme="light"] .portal-toolbar select option { background: #143d41; color: #ffffff; }
.portal-pill { display: inline-flex; align-items: center; padding: 0 14px; min-height: 32px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; background: none; color: inherit; font-family: inherit; cursor: pointer; }
.portal-pill[aria-pressed="true"] { background: var(--brand-2); color: #fff; border-color: var(--brand-2); }
.portal-tag { display: inline-block; margin: 2px 4px 2px 0; padding: 1px 9px; border-radius: 999px; font-size: 12px; line-height: 1.75; white-space: nowrap; color: var(--muted); background: color-mix(in srgb, currentColor 14%, transparent); border: 1px solid color-mix(in srgb, currentColor 38%, transparent); }
.portal-tag.ok { color: var(--brand-text); } .portal-tag.err { color: var(--error); }
details.portal-detalhe pre { white-space: pre-wrap; font-size: 12px; background: var(--surface); padding: 10px; border-radius: 6px; max-height: 320px; overflow: auto; }
.quadro { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.quadro-col { background: color-mix(in srgb, var(--surface) 60%, transparent); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 230px); overflow-y: auto; }
.tarefa.feita { opacity: .72; }
.acomp { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow-y: auto; }
.acomp-i { border-left: 2px solid var(--line); padding: 8px 0 8px 12px; }
.acomp-i.acomp-nota { border-left-color: var(--brand-2); }
/* nota interna: marca diferente, para a equipa distinguir num relance o que o cliente nao le */
.acomp-i.acomp-interna { border-left-color: var(--error); }
/* select + botao na mesma linha, sem esticar o select a toda a largura */
.portal-linha { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.portal-linha select { height: 38px; width: auto; min-width: 160px; }
.acomp-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.acomp-cab form { margin-left: auto; }
.acomp-cab .portal-apagar { width: 26px; height: 26px; }
.acomp-txt { margin: 4px 0 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tarefa.feita .tarefa-titulo { font-weight: 500; }
.quadro-col h2 { font-size: 14px; letter-spacing: .08em; text-transform: uppercase; margin: 4px 4px 6px; color: var(--muted); }
.tarefa { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.tarefa.prio-alta { border-left-color: var(--accent); } .tarefa.prio-normal { border-left-color: var(--brand-2); } .tarefa.prio-baixa { border-left-color: var(--line); }
.tarefa-titulo { font-weight: 600; color: var(--text); }
.tarefa-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; align-items: center; }
.tarefa-atrasada { color: var(--error); font-weight: 600; }
.tarefa-acoes { display: flex; gap: 6px; } .tarefa-acoes .btn-sm { padding: 6px 10px; font-size: 13px; min-height: 32px; }
.calendario { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 3px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--surface-2); }
.cal-h { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: center; padding-bottom: 4px; }
.cal-d { min-height: 54px; border: 1px solid transparent; border-radius: 6px; padding: 3px 4px; font-size: 12px; background: var(--surface); }
.cal-d.vazio { background: none; }
.cal-d.fds { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.cal-d.ocupado { border-color: var(--brand-2); }
.cal-d.hoje { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-n { display: block; color: var(--text); font-weight: 600; font-size: 11px; opacity: .75; }
.cal-p { display: block; background: var(--brand-2); color: #fff; border-radius: 4px; padding: 0 4px; margin-top: 2px; font-size: 11px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-mais { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
@media (max-width: 900px) { .quadro { grid-template-columns: 1fr; } }

/* ===== Responsivo ===== */
@media (max-width: 900px) {
  .portal-wrap { padding-left: 0; } .portal-main { padding: 20px 16px 40px; }
  /* as vistas do portal fixam as colunas em style= (ex.: 2fr 1fr); em telemóvel empilham */
  .portal-cards { grid-template-columns: minmax(0, 1fr) !important; }
  .portal-card-larga { grid-column: auto; }
  /* tabelas largas rolam dentro da própria caixa, não empurram a página */
  .portal-main .portal-table { display: block; overflow-x: auto; }
  :root { --gutter: 20px; }
  .section { padding: 56px 0; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; } .section-head p { text-align: left; max-width: none; }
  .nav, .actions .btn, .actions .lang { display: none; }
  .burger { display: inline-flex; }
  .site-header.open .nav { display: flex; flex-direction: column; gap: 4px; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line); padding: 12px var(--gutter) 20px; }
  .site-header.open .nav a { padding: 12px 0; font-size: 17px; }
  .site-header.open .nav .nav-mobile { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
  .nav-mobile .pill { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 4px; }
  .nav-mobile .btn { grid-column: 1 / -1; justify-content: center; min-height: 48px; margin-top: 4px; }
  .nav-mobile .lang-longo { display: none; }
  .nav-mobile .lang-curto { display: inline; }
  .hero { grid-template-columns: 1fr; padding-top: 48px; padding-bottom: 56px; gap: 40px; } .hero-text, .hero-art { grid-column: auto; } .hero-art { justify-content: flex-start; }
  .chalk { max-width: 340px; } .chalk .motto { font-size: 26px; }
  .grid-3, .site-footer .wrap, .page-layout, .section-cards { grid-template-columns: 1fr; }
  .prose ol.steps, .prose ul.features, .prose ul.features ul { grid-template-columns: 1fr; }
  .page-aside { position: static; } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .strip { grid-template-columns: 1fr; padding: 32px 24px; } .strip > div:first-child, .strip > div:last-child { grid-column: auto; justify-content: flex-start; }
  .hero-cta a, .section-head a, a.back, summary.muted { display: inline-flex; align-items: center; min-height: 44px; }   /* alvos de toque ≥ 44px */
  a[href^="mailto:"], a[href^="tel:"], .wa { display: inline-flex; align-items: center; min-height: 44px; }
}
/* telemóvel: marca, seletor de temas e o botão do menu não cabiam em 375px (transbordava 18px) */
@media (max-width: 560px) {
  .site-header .wrap { gap: 10px; padding-left: 16px; padding-right: 16px; }
  .brand { font-size: 17px; gap: 8px; }
  .brand .logo-anim { width: 26px; height: 26px; }
  .actions { gap: 8px; }
  .theme-switch button { padding: 1px 3px; }
  .theme-switch button svg { width: 14px; height: 14px; }
  .burger { width: 40px; height: 40px; }
}
/* ecrãs muito estreitos (320px): fica só o símbolo da marca */
@media (max-width: 359px) { .brand span { display: none; } }
@media (min-width: 901px) { .nav .nav-mobile { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .logo-anim .sq { transition: none; }
  .chalk img, .chalk .motto { animation: none; opacity: 1; transform: none; }
  .arch-dot { display: none; } .arch-link, .arch-ring { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== Faixa da IA (páginas de serviço) =====
   Atravessa a largura toda de propósito: a mensagem é que a IA cruza o trabalho,
   não que é mais uma camada ao lado das outras. Assenta no .card para herdar o par
   fundo/texto que já está resolvido nos três temas. */
.faixa-ia { gap: 20px; }
.faixa-ia .faixa-ia-cab h2 { font-size: 26px; margin: 8px 0 0; color: var(--card-text); }
.faixa-ia-itens { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; align-items: start; }
.faixa-ia-item h3 { font-size: 17px; margin: 0 0 8px; }
.faixa-ia-item p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.faixa-ia-item .card-link { display: inline-block; margin-top: 10px; }
/* o caso real é o que dá crédito ao resto: leva um traço à esquerda para se ler primeiro */
.faixa-ia-item.destaque { border-left: 3px solid var(--accent); padding-left: 18px; }
.faixa-ia-item.destaque p { color: var(--text); }
/* dentro da coluna de texto não há largura para três: o caso real fica em cima, a toda a
   largura, e as duas notas do método por baixo, lado a lado */
.page-layout .faixa-ia-itens { grid-template-columns: 1fr 1fr; }
.page-layout .faixa-ia-item.destaque { grid-column: 1 / -1; }
@media (max-width: 900px) { .faixa-ia-itens, .page-layout .faixa-ia-itens { grid-template-columns: 1fr; gap: 20px; } }

/* ===== Endereço oficial do produto =====
   Fica debaixo do carrossel, numa zona só dele: antes vinha no fim do texto, colado ao
   último ponto da lista, e lia-se como mais um item. */
.solucao-oficial { margin: 4px 0 0; text-align: center; }   /* centrado sob as imagens, alinhado com o carrossel */
.solucao-oficial > a {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px; border: 1px solid color-mix(in srgb, currentColor 72%, transparent); border-radius: 999px;
  font-family: "Space Grotesk", var(--font); font-weight: 600; font-size: 16px;
  color: var(--accent-text); text-decoration: none; transition: background .2s, border-color .2s;
}
.solucao-oficial > a:hover { background: color-mix(in srgb, currentColor 12%, transparent); border-color: currentColor; }
/* laranja no escuro, como os outros links do texto; no claro o laranja perde-se sobre o teal */
[data-theme="light"] .solucao-oficial > a { color: var(--brand-text); }

/* Gaveta da direita ------------------------------------------------------------
   Serve para o que a pagina la puser; o primeiro uso e a ajuda. Em ecra largo
   empurra o conteudo (nao o tapa); estreito, sobrepoe-se com um veu. */
.portal-titulo { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.portal-titulo .portal-h1 { margin-bottom: 20px; }
.portal-ajuda { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 20px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; }
.portal-ajuda:hover { color: var(--text); border-color: var(--accent); }
.portal-ajuda[aria-expanded="true"] { color: var(--text); border-color: var(--accent); background: var(--surface); }

.portal-lado { position: fixed; top: 0; right: 0; z-index: 62; width: var(--lado-w, 340px); min-width: 280px; max-width: 75vw; height: 100vh; overflow-y: auto; padding: 16px 18px 28px; background: var(--nav-bg); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .25s ease; }
.lado-aberto .portal-lado { transform: none; }
.portal-lado-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.portal-lado-fechar { display: flex; padding: 5px; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; }
.portal-lado-fechar:hover { background: var(--surface); color: var(--text); }
.portal-lado-corpo { padding-top: 14px; font-size: 14px; }
.portal-lado-corpo p { line-height: 1.55; }
@media (min-width: 1200px) { .lado-aberto .portal-wrap { padding-right: var(--lado-w, 340px); } }
@media (max-width: 1199px) {
    /* o veu so existe quando a gaveta tapa o conteudo */
    .lado-aberto .portal-wrap::after { content: ""; position: fixed; inset: 0; z-index: 61; background: rgba(0,0,0,.45); }
}

/* Quadro do que a pessoa ve, dentro da gaveta. */
.acesso-lista { list-style: none; margin: 12px 0 0; padding: 0; }
.acesso-lista li { display: grid; grid-template-columns: 18px 1fr; gap: 1px 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.acesso-lista li:first-child { border-top: 0; }
.acesso-nota { grid-column: 2; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
/* a marca e o unico sinal, por isso nao pode ser so cor: muda de simbolo. */
.acesso-marca { grid-row: 1 / span 2; font-weight: 700; color: var(--accent); }
.acesso-marca::before { content: "✓"; }
.acesso-lista li.nao { opacity: .45; }
.acesso-lista li.nao .acesso-marca { color: var(--muted); }
.acesso-lista li.nao .acesso-marca::before { content: "—"; }
.acesso-rodape { margin-top: 14px; }

/* Quadro de quem ve o que, na gaveta. */
.quadro-acesso { width: 100%; table-layout: fixed; border-collapse: collapse; margin: 10px 0 8px; font-size: 13px; }
.quadro-acesso th:first-child, .quadro-acesso td:first-child { width: 46%; }
.quadro-acesso th { text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase; color: var(--muted); padding: 0 2px 6px; border-bottom: 1px solid var(--line); }
.quadro-acesso th:not(:first-child) { text-align: center; }
.quadro-acesso td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.quadro-acesso td:not(:first-child) { text-align: center; }
.quadro-acesso tbody tr:last-child td { border-bottom: 0; }
.quadro-acesso .sim { color: var(--accent); font-weight: 700; }
.quadro-acesso .nao { color: var(--muted); }
.lado-linha { margin: 22px 0 14px; border: 0; border-top: 1px solid var(--line); }
/* so para quem le por audio: a coluna sozinha nao diz se e sim ou nao */
.so-leitor { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Puxador: alarga a gaveta ate 75% do ecra. A barra e fina e a zona de agarrar
   e larga, para nao ser preciso pontaria. */
.portal-lado-puxador { display: none; position: fixed; top: 0; right: var(--lado-w, 340px); z-index: 63; width: 14px; height: 100vh; transform: translateX(50%); cursor: ew-resize; touch-action: none; }
.lado-aberto .portal-lado-puxador { display: block; }
.portal-lado-puxador::before { content: ""; position: absolute; top: 0; bottom: 0; left: 6px; width: 2px; background: transparent; transition: background .15s; }
.portal-lado-puxador:hover::before, .portal-lado-puxador:focus-visible::before, .a-puxar .portal-lado-puxador::before { background: var(--accent); }
.portal-lado-puxador:focus-visible { outline: none; }
/* enquanto se arrasta, o rato nao pode cair dentro do texto e comecar a seleccionar */
.a-puxar { cursor: ew-resize; user-select: none; }
.a-puxar .portal-lado, .a-puxar .portal-wrap, .a-puxar .portal-lado-puxador { transition: none; }
@media (max-width: 1199px) { .portal-lado-puxador { display: none !important; } }

/* Lista de quem trabalha no projeto: em colunas, para nao esticar o formulario. */
.escolher-pessoas { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 14px; margin-bottom: 6px; }

/* Acções de uma linha de tabela: lado a lado, nunca empilhadas. */
.portal-table td.acoes { white-space: nowrap; text-align: right; }
.portal-table td.acoes > * { display: inline-block; vertical-align: middle; margin-left: 6px; }

/* Resumo financeiro: tantos cartões por linha quantos couberem. */
.fin-resumo { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 14px 0 22px; }
.fin-card { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; gap: 2px; }
.fin-card strong { font-family: "Space Grotesk", sans-serif; font-size: 17px; }
.fin-card.ok strong { color: var(--accent); }
.fin-card.err { border-color: var(--danger, #c0392b); }
.fin-card.err strong { color: var(--danger, #c0392b); }
.fin-atraso td { background: color-mix(in srgb, var(--danger, #c0392b) 9%, transparent); }
.fin-aviso { color: var(--danger, #c0392b); }

/* Campos de data ---------------------------------------------------------------
   O campo nativo fica: traz teclado, localizacao e o calendario do telemovel, que
   nenhuma biblioteca iguala - e a CSP nao deixa entrar uma de fora. O que faltava
   era ve-lo: o icone vem escuro, e no tema escuro desaparecia dentro do campo. */
input[type="date"] { position: relative; cursor: pointer; font-variant-numeric: tabular-nums; }
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer; opacity: .55; padding: 2px; border-radius: 4px;
    transition: opacity .15s, background .15s;
}
/* com o painel proprio a abrir no clique, o icone nativo so confundia */
@media (pointer: fine) { input[type="date"]::-webkit-calendar-picker-indicator { display: none; } }
input[type="date"]:hover::-webkit-calendar-picker-indicator,
input[type="date"]:focus::-webkit-calendar-picker-indicator { opacity: 1; background: color-mix(in srgb, var(--accent) 22%, transparent); }
/* Os campos do portal sao escuros nos tres temas - e por isso que os select levam
   color-scheme: dark tambem no tema claro. As datas seguem a mesma regra: sem ela,
   no tema claro abria-se um calendario branco sobre um campo escuro, e o icone
   preto desaparecia dentro dele. */
.form-field input[type="date"], .portal-toolbar input[type="date"] { color-scheme: dark; }
.form-field input[type="date"]::-webkit-calendar-picker-indicator,
.portal-toolbar input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); }
/* a data por preencher nao deve gritar mais do que a preenchida */
input[type="date"]:invalid, input[type="date"]:not(:focus):placeholder-shown { color: var(--muted); }
input[type="date"]:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }


/* Flatpickr com as cores do portal. A folha dele e neutra; isto so troca as cores,
   para o calendario nao parecer de outro sitio. */
.flatpickr-calendar { background: var(--nav-bg); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0,0,0,.35); border-radius: 10px; }
.flatpickr-calendar.arrowTop::before, .flatpickr-calendar.arrowTop::after { border-bottom-color: var(--nav-bg); }
.flatpickr-calendar.arrowBottom::before, .flatpickr-calendar.arrowBottom::after { border-top-color: var(--nav-bg); }
.flatpickr-months, .flatpickr-weekdays, .flatpickr-weekdaycontainer { background: transparent; }
.flatpickr-month, .flatpickr-current-month, .flatpickr-weekday { color: var(--text); fill: var(--text); }
span.flatpickr-weekday, .flatpickr-weekday { color: var(--accent); font-weight: 600; }   /* o cinzento da biblioteca perdia-se no fundo escuro */
.flatpickr-monthDropdown-months { background: var(--nav-bg); color: var(--text); font-family: "Space Grotesk", sans-serif; }
.flatpickr-monthDropdown-month { background: var(--nav-bg); color: var(--text); }
.numInputWrapper span { border-color: var(--line); }
/* as setas do mes a laranja: a cor do texto perdia-se no fundo escuro */
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month { color: var(--accent); fill: var(--accent); }
.flatpickr-months .flatpickr-prev-month svg, .flatpickr-months .flatpickr-next-month svg { fill: var(--accent); width: 16px; height: 16px; }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg { fill: #fff; }
.flatpickr-day { color: var(--text); border-radius: 50%; }
.flatpickr-day:hover, .flatpickr-day:focus { background: var(--surface); border-color: transparent; }
.flatpickr-day.today { border-color: var(--accent); }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay, .flatpickr-day.flatpickr-disabled { color: var(--muted); opacity: .45; }
.flatpickr-day.flatpickr-disabled:hover { background: transparent; }
/* o campo visivel do flatpickr tem de ser igual aos outros do formulario */
.form-field input.form-control.input, .portal-toolbar input.form-control.input { font: inherit; }


/* Grupos do menu: cada um abre e fecha, e o que contém a página aberta nasce aberto. */
.portal-nav-grupo { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; margin: 8px 0 0; padding: 7px 12px; border: 0; border-radius: 8px; background: none; font-family: inherit; font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); cursor: pointer; text-align: left; }
.portal-nav-grupo:hover { color: var(--text); background: var(--surface); }
.portal-nav-grupo svg { flex: none; transition: transform .18s ease; }
.portal-nav-g.aberto > .portal-nav-grupo { color: var(--accent); }
.portal-nav-g.aberto > .portal-nav-grupo svg { transform: rotate(180deg); }

/* Aberto, o grupo lê-se como um bloco: fundo próprio, e os filhos presos ao
   cabeçalho por uma linha vertical. Sem isto, as entradas de dentro pareciam
   soltas e não se sabia a que grupo pertenciam. */
.portal-nav-g.aberto { background: color-mix(in srgb, var(--surface) 55%, transparent); border-radius: 10px; padding-bottom: 6px; margin-top: 8px; }
.portal-nav-g.aberto > .portal-nav-grupo { margin-top: 0; }
.portal-nav-itens { display: none; flex-direction: column; gap: 1px; margin: 2px 0 0 18px; padding-left: 8px; border-left: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.portal-nav-g.aberto .portal-nav-itens { display: flex; }
.portal-nav-itens > a { font-size: 13.5px; padding: 7px 10px; }

/* A barra lateral é escura nos três temas. No claro, as cores genéricas (--surface
   branco, --text escuro) davam um rectângulo branco com o texto invisível — o
   cabeçalho do grupo tem de usar as mesmas cores fixas que as entradas já usam. */
[data-theme="light"] .portal-nav-grupo { color: #9cc4c9; }
[data-theme="light"] .portal-nav-grupo:hover { background: #143d41; color: #fff; }
[data-theme="light"] .portal-nav-g.aberto { background: rgba(255,255,255,.06); }
[data-theme="light"] .portal-nav-g.aberto > .portal-nav-grupo { color: #ffb15c; }
[data-theme="light"] .portal-nav-itens { border-left-color: rgba(255,177,92,.5); }

/* Uma entrada sem grupo, depois de um grupo, precisa de se destacar dele: sem isto
   "A minha conta" lia-se como parte de Administracao. */
.portal-nav nav a.solta + a.solta { margin-top: 0; }
.portal-nav nav .portal-nav-g ~ a.solta { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; border-radius: 0 0 8px 8px; }

/* Formulários dentro da gaveta: ocupam a largura dela, e as colunas acompanham o
   puxador - estreita dá uma coluna, larga dá três. */
/* Os formulários vieram de páginas inteiras e trazem larguras de lá: um max-width
   escrito no próprio elemento (Acessos, Fase) e, na tarefa, uma grelha de 2/3 + 1/3
   que deixava um terço vazio quando não há horas nem notas. Dentro da gaveta mede-se
   pela gaveta - container-type - e não pelo ecrã, para acompanhar também o puxador. */
#lado-painel { container-type: inline-size; }
#lado-painel .portal-form, #lado-painel form.card { max-width: none !important; }
#lado-painel .portal-cards { grid-template-columns: minmax(0, 1fr) !important; }
@container (min-width: 900px) {
    #lado-painel .portal-cards { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) !important; }
}
#lado-painel .portal-form-2 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
#lado-painel .portal-h1 { display: none; }   /* o titulo ja esta no topo da gaveta */
#lado-painel .lado-a-carregar { padding: 18px 0; text-align: center; }
#lado-painel > div > .card { box-shadow: none; }

/* num ecra estreito a gaveta tapa o conteudo em vez de o empurrar: pode ocupar mais */
@media (max-width: 1199px) { .portal-lado { max-width: 92vw; } }


/* Tema claro: no portal, --surface e --text sao os DOIS brancos. Tudo o que usasse
   background: var(--surface) ficava branco sobre branco - o botao de fechar a
   gaveta, o dia sob o rato no calendario, os cartoes do resumo financeiro, o botao
   Ajuda quando aberto. Em vez de remendar um a um, os contentores escuros
   redefinem as variaveis dentro deles, como o .card-teal ja fazia: o que la for
   posto depois herda as cores certas sem ninguem se lembrar. */
[data-theme="light"] .portal-lado,
[data-theme="light"] .portal-nav,
[data-theme="light"] .flatpickr-calendar {
    --surface: #143d41; --text: #ffffff; --muted: #9cc4c9; --line: rgba(255,255,255,.18);
}
[data-theme="light"] .fin-card,
[data-theme="light"] .portal-ajuda {
    --surface: #143d41; --text: #ffffff; --muted: #9fb0b2;
}
[data-theme="light"] .fin-card { border-color: rgba(53,181,189,.45); }

/* Os meses no mesmo calendário: as cores do portal, e o mês escolhido a laranja. */
.flatpickr-monthSelect-months { margin: 6px 0 4px; }
.flatpickr-monthSelect-month { color: var(--text); border-radius: 8px; border: 1px solid transparent; }
.flatpickr-monthSelect-month:hover, .flatpickr-monthSelect-month:focus { background: var(--surface); border-color: transparent; }
.flatpickr-monthSelect-month.today { border-color: var(--accent); }
.flatpickr-monthSelect-month.selected, .flatpickr-monthSelect-month.selected:hover { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* Campos de data: levam "dd/mm/aaaa", nao precisam da largura toda. E num telemovel
   o campo nativo tem uma largura minima propria que nao cabe em meia coluna - o
   "Ate" das Ausencias saia do cartao. Largura natural pequena, e licenca para
   encolher dentro de uma grelha (min-width: 0, nos campos e em quem os contem).
   campo-data e o campo a vista que o flatpickr cria (ver calendario.js). */
input[type="date"], input[type="month"],
input.flatpickr-input, input.flatpickr-mobile, input.campo-data { width: 100%; max-width: 11.5rem; min-width: 0; }
.form-field > div, .portal-form-2 > .form-field, .form-duo > * { min-width: 0; }

/* Fases lidas do PDF: uma tabela de campos, compacta, que rola na gaveta estreita */
.fin-proposta { display: block; overflow-x: auto; }
.fin-proposta td { padding: 6px 4px; vertical-align: middle; }
.fin-proposta input:not([type="checkbox"]), .fin-proposta select { width: 100%; min-width: 4.5rem; padding: 6px 8px; }
.fin-proposta td:nth-child(3) input { min-width: 14rem; }

/* valores em dinheiro numa linha só: "1 984 770,00 CVE" partido a meio não se lê */
.portal-table td.numero { white-space: nowrap; }

/* Última nota dos projetos: o ícone abre a nota inteira na gaveta da direita */
.nota-abrir { background: none; border: 0; padding: 2px; color: var(--accent); cursor: pointer; vertical-align: middle; }
.nota-abrir:hover { color: var(--text); }
.nota-texto { white-space: pre-wrap; }

/* Pré-envio da fatura: o email como o cliente o recebe, e o PDF por baixo */
.envio-previa { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.envio-previa dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0 0 12px; }
.envio-previa dt { color: var(--muted); }
.envio-previa dd { margin: 0; overflow-wrap: anywhere; }
.envio-corpo { white-space: pre-wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.envio-pdf { width: 100%; height: 70vh; min-height: 420px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* legenda dos marcadores do playbook */
.modelos-marcadores { columns: 2 14rem; padding-left: 1.1rem; margin: 0 0 14px; font-size: 14px; }
.modelos-marcadores code { color: var(--accent); }

/* botão de um pedido demorado (ler PDF): roda até haver resposta */
.btn.a-trabalhar { display: inline-flex; align-items: center; gap: .5em; cursor: progress; }
.btn.a-trabalhar::before { content: ""; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ring-spin .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .btn.a-trabalhar::before { animation-duration: 2.4s; } }

/* ler PDF na lista de Projetos: a escolha do projeto só aparece com "atualizar" ligado */
.pdf-objetivo { gap: .5rem; }
.pdf-objetivo:not(:has(input:checked)) select { display: none; }

/* Financeiro: as ações de cada fase, compactas */
.fin-acoes { white-space: nowrap; }
.portal-main .fin-acoes .btn-sm { min-height: 26px; padding: 3px 8px; font-size: 12px; }

/* o título da página com o projeto a seguir (Financeiro · <projeto>) */
.portal-h1-extra { color: var(--accent-text); }
