/* Cores e fontes vindas dos dois sites:
   base e verde = site de programação; dourado = site de contabilidade e direito */
:root {
  --bg: #F5F6F4;
  --surface: #FFFFFF;
  --ink: #171A18;
  --muted: #646B67;
  --line: #DADFDC;

  --dev: #1F6B62;
  --dev-soft: rgba(31, 107, 98, 0.1);
  --law: #9A6B22;
  --law-soft: rgba(154, 107, 34, 0.12);
  --dev-line: rgba(31, 107, 98, 0.45);
  --law-line: rgba(154, 107, 34, 0.45);
  --tr: #3D4C9B;
  --tr-soft: rgba(61, 76, 155, 0.1);
  --tr-line: rgba(61, 76, 155, 0.45);

  --accent: var(--dev);
  --accent-soft: var(--dev-soft);

  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Helvetica Neue", Arial, system-ui, sans-serif;

  --col: 36rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101311; --surface: #171B19; --ink: #E6EAE7; --muted: #9AA39E; --line: #2A302D;
    --dev: #72C4B7; --dev-soft: rgba(114, 196, 183, 0.12);
    --law: #D8AC5E; --law-soft: rgba(216, 172, 94, 0.14);
    --dev-line: rgba(114, 196, 183, 0.45); --law-line: rgba(216, 172, 94, 0.45);
    --tr: #9FAAEB; --tr-soft: rgba(159, 170, 235, 0.13); --tr-line: rgba(159, 170, 235, 0.45);
  }
}
:root[data-theme="dark"] {
  --bg: #101311; --surface: #171B19; --ink: #E6EAE7; --muted: #9AA39E; --line: #2A302D;
  --dev: #72C4B7; --dev-soft: rgba(114, 196, 183, 0.12);
  --law: #D8AC5E; --law-soft: rgba(216, 172, 94, 0.14);
  --dev-line: rgba(114, 196, 183, 0.45); --law-line: rgba(216, 172, 94, 0.45);
  --tr: #9FAAEB; --tr-soft: rgba(159, 170, 235, 0.13); --tr-line: rgba(159, 170, 235, 0.45);
}

*, *::before, *::after { box-sizing: inherit; }
html { height: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100%;
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s ease, color .35s ease;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: var(--col); margin: 0 auto; padding: 0 1.5rem; }

/* Topo: só idioma e tema */
.site-header .wrap { display: flex; justify-content: flex-end; align-items: center; gap: .5rem; height: 4.25rem; }

.lang {
  position: relative; display: inline-flex;
  padding: 3px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface);
  transition: background-color .35s ease, border-color .35s ease;
}
.lang button {
  position: relative; z-index: 1; display: grid; place-items: center;
  border: 0; background: none; cursor: pointer;
  padding: .4rem .55rem; border-radius: 999px;
}
.flag {
  display: block; width: 22px; height: 16px; border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.12);
  filter: saturate(.35); opacity: .6;
  transition: filter .3s, opacity .3s, transform .3s var(--ease);
}
.lang button:hover .flag { opacity: .9; }
.lang button[aria-pressed="true"] .flag { filter: none; opacity: 1; transform: scale(1.05); }
.lang .pill {
  position: absolute; top: 3px; bottom: 3px; left: 3px;
  border-radius: 999px; background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
  transition: transform .35s var(--ease), width .35s var(--ease);
}

.theme-toggle {
  position: relative; display: grid; place-items: center;
  width: 2.35rem; height: 2.35rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer;
  transition: background-color .35s ease, border-color .2s, color .35s ease;
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle svg { width: 18px; height: 18px; transition: transform .5s var(--ease), opacity .3s; }
.theme-toggle .moon { position: absolute; opacity: 0; transform: rotate(-90deg) scale(.5); }
[data-mode="dark"] .theme-toggle .sun { opacity: 0; transform: rotate(90deg) scale(.5); }
[data-mode="dark"] .theme-toggle .moon { opacity: 1; transform: rotate(0) scale(1); }

/* Título */
main { flex: 1; }
.hero { padding: 4.5rem 0 2.5rem; padding: clamp(3rem, 12vh, 7rem) 0 2.5rem; }
.hero h1 {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-size: clamp(3rem, 14vw, 5.5rem);
  font-weight: 600; line-height: .95; letter-spacing: -0.045em;
  margin: 0 0 1.25rem;
}
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero h1 .line span { display: inline-block; -webkit-animation: rise 1s var(--ease) both; animation: rise 1s var(--ease) both; }
.hero h1 .line:nth-child(2) span { animation-delay: .12s; }
@-webkit-keyframes rise { from { -webkit-transform: translateY(105%); transform: translateY(105%); } }
@keyframes rise { from { transform: translateY(105%); } }
.role { margin: 0; color: var(--muted); font-size: 1.05rem; max-width: 26rem; }

/* Acordeões: cada serviço carrega a cor do site de origem */
.services { padding: 1rem 0 4rem; }
.service { --accent: var(--dev); --accent-soft: var(--dev-soft); --accent-line: var(--dev-line); }
.service.law { --accent: var(--law); --accent-soft: var(--law-soft); --accent-line: var(--law-line); }
.service.tr { --accent: var(--tr); --accent-soft: var(--tr-soft); --accent-line: var(--tr-line); }

.service {
  margin: 0 0 .75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color .3s, background-color .35s ease, box-shadow .35s var(--ease);
}
.service:hover { border-color: var(--accent-line); }
.service[open] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.service summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 1rem;
  padding: 1.15rem 1.15rem 1.15rem 1.35rem;
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.15rem; line-height: 1.25; letter-spacing: -0.01em;
  border-radius: 14px;
}
.service summary::-webkit-details-marker { display: none; }
.service summary::before {
  content: ""; flex: none; width: .55rem; height: .55rem; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.service summary span { flex: 1; }
.service summary::after {
  content: ""; flex: none; width: 2rem; height: 2rem; border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line);
  background:
    linear-gradient(var(--ink), var(--ink)) center / 11px 1.6px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 1.6px 11px no-repeat;
  transition: transform .35s var(--ease), background-color .3s;
}
.service[open] summary::after { transform: rotate(45deg); background-color: var(--accent-soft); }

.service .body { padding: 0 1.35rem 1.35rem; }
.service[open] .body { animation: open .4s var(--ease); }
@keyframes open { from { opacity: 0; transform: translateY(-6px); } }
.service .body p { margin: 0 0 1rem; color: var(--muted); }
.service ul { list-style: none; margin: 0 0 1.25rem; padding: 0; border-top: 1px solid var(--line); }
.service li { padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: .98rem; }

.btn {
  display: inline-flex; align-items: center;
  padding: .7rem 1.1rem; border-radius: 10px;
  text-decoration: none; font-weight: 500; font-size: .95rem;
  background: var(--ink); color: var(--bg); border: 1px solid var(--ink);
  transition: transform .2s var(--ease), background-color .35s ease, color .35s ease;
}
.btn:hover { transform: translateY(-1px); }

/* Página 404 */
.not-found { padding: 5rem 0 4rem; padding: clamp(3rem, 14vh, 8rem) 0 4rem; }
.not-found .code {
  font-family: var(--font-display); font-weight: 700;
  font-size: 7rem;
  font-size: clamp(6rem, 32vw, 11rem); line-height: .85; letter-spacing: -0.06em;
  margin: 0 0 1.5rem; color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
  -webkit-text-fill-color: transparent;
}
.not-found h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 2rem;
  font-size: clamp(1.75rem, 6vw, 2.4rem); letter-spacing: -0.03em; line-height: 1.1;
  margin: 0 0 .75rem;
}
.not-found p { color: var(--muted); margin: 0 0 2rem; max-width: 28rem; }

footer { padding: 2rem 0 2.5rem; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }

/* Botões dentro dos acordeões: página completa + contato direto */
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); }

/* Links entre as páginas, no rodapé */
.site-pages { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; margin: 0 0 .9rem; }
.site-pages a { color: var(--muted); text-decoration: none; transition: color .2s; }
.site-pages a:hover, .site-pages a[aria-current="page"] { color: var(--ink); }

/* Troca de idioma */
[data-i18n] { transition: opacity .18s ease, filter .18s ease; }
.is-swapping [data-i18n] { opacity: 0; filter: blur(3px); }

/* Navegadores sem "gap" em flexbox (iOS 14.4 ou anterior): espaçamento por margem */
@supports not (inset: 0) {
  .site-header .wrap > * + * { margin-left: .5rem; }
  .service summary::before { margin-right: 1rem; }
  .service summary::after { margin-left: 1rem; }
  .btn-row > * { margin: 0 .6rem .6rem 0; }
  .site-pages a { margin: 0 1.25rem .35rem 0; }
}
/* Sem suporte a text-stroke: número 404 preenchido em vez de invisível */
@supports not (-webkit-text-stroke: 1px black) {
  .not-found .code { color: var(--line); -webkit-text-fill-color: currentColor; }
}

@media (prefers-reduced-motion: reduce) {
  .hero h1 .line span { -webkit-animation: none; animation: none; }
  .service[open] .body { animation: none; }
  [data-i18n], .service summary::after, .lang .pill { transition: none; }
}

/* Serviços de tradução: idiomas dentro do acordeão */
.service .sub { margin: 0 0 .4rem; font-size: .9rem; font-weight: 600; color: var(--ink); }
.service .tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.1rem; padding: 0; list-style: none; border: 0; }
.service .tags li { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem .3rem .45rem; border: 0; border-radius: 999px; font-size: .9rem; background: var(--accent-soft); color: var(--accent); }
.tflag { display: block; width: 20px; height: 14px; flex: none; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.tflag + .tflag { margin-left: -.15rem; }
.tflag.glyph { display: grid; place-items: center; width: 20px; height: 14px; font-size: 10px; font-weight: 700; line-height: 1; color: var(--muted); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); font-family: system-ui, sans-serif; }
.tflag.glyph.wide { width: 30px; font-size: 7.5px; letter-spacing: .04em; font-family: Georgia, "Times New Roman", serif; }
.service .tags.muted li { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
@supports not (inset: 0) { .service .tags li { margin: 0 .4rem .4rem 0; } }
