:root {
  --bg: #070b1a; --ink: #eef2ff; --mute: #b8c2e4; --line: #26315f;
  --accent: #22d3ee; --accent2: #8b5cf6; --on-accent: #fff; --panel: #0f1736;
  --grad: linear-gradient(135deg, #22d3ee, #4f6bff 50%, #9b5cf6);
  color-scheme: dark;
  box-sizing: border-box;
}
html { scroll-padding-top: 64px; scroll-behavior: smooth; background: var(--bg); }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: transparent; color: var(--ink); font: 400 18px/1.6 "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none; background: radial-gradient(60vw 50vh at 88% -6%, rgba(99,102,241,.42), transparent 65%), radial-gradient(50vw 45vh at -6% 22%, rgba(34,211,238,.22), transparent 65%), radial-gradient(55vw 50vh at 104% 78%, rgba(139,92,246,.24), transparent 65%), radial-gradient(48vw 42vh at -4% 102%, rgba(59,130,246,.2), transparent 65%); }
::selection { background: #4f6bff; color: #fff; }

h1, h2, h3 { font-family: Jost, "Century Gothic", "Avenir Next", sans-serif; font-weight: 600; line-height: 1.08; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.4rem; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
header { position: sticky; top: 0; z-index: 10; background: rgba(7,11,26,.72); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; max-width: 1160px; margin: 0 auto; }
.logo { display: block; height: auto; width: min(300px, 52vw); }
nav { display: flex; gap: 28px; align-items: center; font-weight: 500; font-size: 16px; }
nav a { text-decoration: none; white-space: nowrap; }
nav a:hover { text-decoration: underline; text-underline-offset: 5px; }
nav a[aria-current="page"] { color: #fff; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 7px; }
.bar nav .btn { white-space: nowrap; }

.btn { display: inline-block; background: linear-gradient(135deg, #3b82f6, #7c3aed); color: #fff; border-radius: 12px; box-shadow: 0 8px 28px -8px rgba(99,102,241,.8); font: 600 17px/1 Jost, sans-serif; padding: 16px 26px; text-decoration: none; border: 0; cursor: pointer; }
.btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn.ghost { background: rgba(255,255,255,.05); border: 1px solid #3a4780; box-shadow: none; color: var(--ink); }
nav .btn { padding: 12px 18px; font-size: 16px; }

/* Menu Mobile (Burger) */
.burger { display: none; flex: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid #3a4780; background: rgba(255,255,255,.06); cursor: pointer; padding: 0; align-items: center; justify-content: center; flex-direction: column; gap: 5px; }
.burger span { display: block; width: 20px; height: 2px; border-radius: 2px; background: #fff; transition: transform .25s ease, opacity .2s ease; }
header.open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
header.open .burger span:nth-child(2) { opacity: 0; }
header.open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.menu { display: none; }
@media (max-width: 1040px) {
  nav a:not(.btn):not(.login) { display: none; }
  .burger { display: inline-flex; }
  .bar { gap: 10px; padding: 12px 20px; }
  .bar nav { margin-left: auto; }
  .menu { position: absolute; top: 100%; left: 0; right: 0; background: rgba(7,11,26,.97); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); padding: 6px 20px 22px; box-shadow: 0 30px 50px -20px rgba(0,0,0,.6); }
  header.open .menu { display: block; }
  .menu a:not(.btn) { display: block; padding: 17px 4px; font: 500 19px "Instrument Sans", system-ui, sans-serif; text-decoration: none; border-bottom: 1px solid var(--line); }
  .menu .btn { display: block; text-align: center; margin-top: 18px; }
  .menu a[aria-current="page"] { color: var(--accent); }
  .menu .login { border: 0; border-radius: 0; padding: 17px 4px; font: 500 19px "Instrument Sans", system-ui, sans-serif; border-bottom: 1px solid var(--line); display: flex; gap: 12px; }
  .menu .login:hover { background: none; }
  .menu .login svg { width: 20px; height: 20px; }
}
@media (max-width: 760px) { .menu { background: #070b1a; } .bar nav .btn { padding: 12px 16px; } }
@media (min-width: 1041px) and (max-width: 1240px) { nav { gap: 18px; font-size: 16px; } }

/* Botão Voltar ao Topo */
.totop { position: fixed; right: 22px; bottom: 22px; z-index: 20; width: 54px; height: 54px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; color: #fff; display: grid; place-items: center; background: rgba(14,20,48,.72); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 12px 32px -8px rgba(79,107,255,.65), inset 0 0 0 1px rgba(255,255,255,.14); opacity: 0; visibility: hidden; transform: translateY(14px) scale(.9); transition: opacity .3s ease, transform .3s ease, visibility .3s, box-shadow .25s ease; }
.totop.show { opacity: 1; visibility: visible; transform: none; }
.totop:hover { transform: translateY(-3px); box-shadow: 0 16px 38px -8px rgba(124,92,246,.85), inset 0 0 0 1px rgba(255,255,255,.28); }
.totop .ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.totop .ring circle { fill: none; stroke-width: 3; }
.totop .trk { stroke: rgba(255,255,255,.12); }
.totop .prg { stroke: url(#tg); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .15s linear; }
.totop .arr { position: relative; transition: transform .25s ease; }
.totop:hover .arr { transform: translateY(-2px); }
@media (max-width: 760px) { .totop { right: 16px; bottom: 16px; width: 50px; height: 50px; } }
@media (prefers-reduced-motion: reduce) { .totop, .burger span { transition: none; } html { scroll-behavior: auto; } }

footer { background: rgba(5,8,20,.65); border-top: 1px solid var(--line); padding: 28px 0; font-size: 15px; color: var(--mute); }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

[hidden] { display: none !important; }

/* =========================================
   FORMULÁRIOS COMPARTILHADOS (Botões e Inputs)
   ========================================= */

/* Botão de Envio (Sign in, Send, etc) */
.fbtn {
  font: 600 18px Jost, sans-serif; color: #fff; border: 0; cursor: pointer;
  padding: 16px 26px; border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #7c3aed);
  box-shadow: 0 8px 28px -8px rgba(99,102,241,.8);
  width: 100%; display: block;
}
.fbtn:hover { filter: brightness(1.12); }
.fbtn:disabled { opacity: .6; cursor: wait; }

/* Inputs e Textareas Escuros (Usados no Portal e no Admin) */
.ops-in {
  display: block; width: 100%;
  font: 400 15px "Instrument Sans", system-ui, sans-serif;
  color: var(--ink); background: #0f1736;
  border: 1px solid #2c3874; border-radius: 10px;
  padding: 10px 12px;
}
textarea.ops-in { resize: vertical; min-height: 72px; }
.ops-in:focus { outline: 3px solid var(--accent); outline-offset: 1px; }

/* Área de Anexos e Chips de Arquivos */
.ops-attbox { margin-top: 10px; }
.ops-attrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ops-attbtn {
  background: rgba(255,255,255,.06); border: 1px dashed #3a4780;
  border-radius: 10px; color: var(--ink);
  font: 600 14px "Instrument Sans", system-ui, sans-serif;
  padding: 8px 14px; cursor: pointer;
}
.ops-attbtn:hover { background: rgba(79,107,255,.18); }
.ops-attbtn:focus-visible, .ops-chipx:focus-visible, .ops-fbtn:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.ops-atthint { font-size: 13px; color: var(--mute); }
.ops-attlist { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ops-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.07); border: 1px solid var(--line);
  border-radius: 20px; padding: 4px 6px 4px 12px;
  font-size: 13px; color: var(--ink); max-width: 100%;
}
.ops-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ops-chipx {
  background: none; border: 0; color: #fca5a5;
  font: 600 12px "Instrument Sans", sans-serif;
  cursor: pointer; padding: 4px 8px; border-radius: 12px;
}
.ops-chipx:hover { background: rgba(252,165,165,.15); }
.ops-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ops-fbtn {
  background: rgba(79,107,255,.16); border: 1px solid #3a4780;
  border-radius: 10px; color: var(--ink);
  font: 500 13px "Instrument Sans", system-ui, sans-serif;
  padding: 6px 12px; cursor: pointer; text-align: left;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.ops-fbtn:hover { background: rgba(79,107,255,.3); }

/* Correções Globais Mobile */
@media (max-width: 640px) {
  body { overflow-x: hidden; } /* Impede rolagem horizontal na página toda */
  h1 { font-size: 2.4rem; }
  section { padding: 64px 0; }
  .wrap { padding: 0 16px; }
  
  /* Ajuste do Header no Celular */
  .bar { padding: 12px 16px; }
  .logo { width: 180px; }
  
  /* Ajuste dos botões no topo */
  .bar nav { gap: 8px; }
  .bar nav .btn { padding: 10px 14px; font-size: 14px; }
}

/* Refinamento do Menu Hamburger e Header no Mobile */
@media (max-width: 1040px) {
  /* Impede que o header quebre para a linha de baixo */
  .bar { 
    flex-wrap: nowrap; 
    padding: 10px 16px; 
  }

  /* Garante que o botão do menu não seja esmagado pelo layout */
  .burger {
    display: inline-flex;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    flex-shrink: 0; /* O segredo está aqui: impede que ele encolha */
    border-radius: 10px;
    margin-left: 8px;
  }

  /* Deixa as listras internas proporcionalmente mais elegantes */
  .burger span {
    width: 18px;
    height: 2px;
  }

  /* Ajusta os botões ao lado do menu (como "Sign in" ou "Back to site") */
  .bar nav {
    gap: 10px;
  }
  
  .bar nav .btn {
    padding: 10px 14px;
    font-size: 14px;
    white-space: nowrap;
  }
}

/* Em celulares muito pequenos (como iPhone SE) */
@media (max-width: 480px) {
  .logo {
    width: 140px; /* Reduz a logo para dar mais espaço */
  }
  
  .burger {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
  }
  
  /* Se o botão "Back to site" ou "Sign out" estiver atrapalhando, 
     podemos esconder o texto e deixar só o menu, mas depende do seu HTML */
  .bar nav .btn.back {
    display: none; /* Oculta o "Back to site" no celular, já que a logo faz isso */
  }
}