/* Página de entrada do fluxograma gratuito: a mesa escura da Clarafy, com o papel do quadro a aparecer
   no "Como funciona". Carrega antes do JavaScript (o texto tem de se ler sem ele). */
:root {
  --mesa: #080a0c;
  --mesa-2: #0e1114;
  --linha: rgba(255, 255, 255, 0.08);
  --texto: #eef0f2;
  --apagado: #8b929c;
  --lima: #a2ff00;
  --papel: #f7f6f2;
  --tinta: #15181d;
}
.inicio, .inicio * { box-sizing: border-box; }
html, body { margin: 0; }
html:not(.fg-abrir) body { background: var(--mesa); }
html.fg-abrir #inicio { display: none; }
#inicio[hidden] { display: none; }

.inicio {
  color: var(--texto);
  font-family: Geist, Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background-image:
    linear-gradient(var(--mesa) 0 0),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 100% 0, 64px 64px, 64px 64px;
  padding: 0 max(16px, env(safe-area-inset-left)) 96px max(16px, env(safe-area-inset-right));
}
.inicio > * { max-width: 1040px; margin-left: auto; margin-right: auto; }

.topo { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.marca img { display: block; height: 24px; width: auto; }
.topo-entrar {
  font: inherit; font-size: 14px; color: var(--texto); background: transparent;
  border: 1px solid var(--linha); border-radius: 999px; padding: 8px 14px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.topo-entrar:hover { border-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.04); }

.abertura { padding: clamp(40px, 9vh, 96px) 0 28px; }
.etiqueta { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 22px; color: var(--apagado); font-size: 13px; }
.ponto { width: 7px; height: 7px; border-radius: 50%; background: var(--lima); box-shadow: 0 0 0 4px rgba(162, 255, 0, 0.12); }
.inicio h1 {
  margin: 0; font-weight: 600; letter-spacing: -0.035em; line-height: 1.02;
  font-size: clamp(40px, 7.2vw, 78px); text-wrap: balance;
}
.inicio .l { display: block; }
.inicio p, .inicio dd, .inicio li { text-wrap: pretty; }
.entrada { margin: 22px 0 0; max-width: 34em; color: #b8bec6; font-size: clamp(16px, 1.6vw, 18px); line-height: 1.55; }

.setores { padding: 26px 0 8px; }
.setores-titulo { margin: 0 0 14px; font-size: 13px; font-weight: 500; color: var(--apagado); letter-spacing: 0.01em; }
.grelha { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 10px; }
.grelha button {
  width: 100%; height: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit;
  background: var(--mesa-2); border: 1px solid var(--linha); border-radius: 12px;
  padding: 15px 16px 16px; display: flex; flex-direction: column; gap: 4px;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.grelha button b { font-size: 15px; font-weight: 600; }
.grelha button span { font-size: 13px; color: var(--apagado); }
.grelha button:hover { border-color: rgba(162, 255, 0, 0.45); background: #11151a; transform: translateY(-1px); }
.grelha button:focus-visible { outline: 2px solid var(--lima); outline-offset: 2px; }
.grelha button:active { transform: translateY(0); }
.grelha .em-branco { background: transparent; border-style: dashed; }
.aviso { color: var(--apagado); font-size: 14px; }

/* Como funciona: três caixas do quadro, no papel, ligadas por setas. */
.como { margin-top: 72px; }
.inicio .como h2, .inicio .faq h2 { font-size: 13px; font-weight: 500; color: var(--apagado); margin: 0 0 14px; letter-spacing: 0.01em; }
.como ol {
  list-style: none; margin: 0; padding: 28px clamp(16px, 3vw, 32px);
  background-color: var(--papel); color: var(--tinta); border-radius: 14px;
  background-image: radial-gradient(#d6d3ca 1.2px, transparent 1.3px); background-size: 24px 24px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 56px;
}
.como li {
  position: relative; background: #fff; border: 1.5px solid #c9ced6; border-radius: 10px;
  padding: 16px 16px 18px; font-size: 14px; line-height: 1.5; color: #4a505c;
}
.como li b { display: block; color: var(--tinta); font-size: 15px; margin-bottom: 4px; }
.como li:last-child { border-color: #d64933; box-shadow: 0 0 0 3px rgba(214, 73, 51, 0.12); }
.como li:not(:last-child)::after {
  content: ""; position: absolute; top: 50%; right: -46px; width: 36px; height: 2px; background: #3c424d;
}
.como li:not(:last-child)::before {
  content: ""; position: absolute; top: calc(50% - 5px); right: -48px;
  border-left: 8px solid #3c424d; border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}

.fases { margin-top: 72px; }
.inicio .fases h2 { font-size: 13px; font-weight: 500; color: var(--apagado); margin: 0 0 14px; letter-spacing: 0.01em; }
.fases-entrada { margin: 0 0 22px; max-width: 40em; color: #b8bec6; font-size: 16px; line-height: 1.6; }
.fases ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.fases li { display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 18px; border-radius: 12px; background: var(--mesa-2); border: 1px solid var(--linha); box-shadow: inset 0 3px 0 var(--fase); font-size: 14px; line-height: 1.55; color: var(--apagado); }
.fases li b { color: var(--fase); font-size: 15px; font-weight: 600; }
.faq { margin-top: 72px; }
.faq dl { margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 48px; }
.faq dt { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.faq dd { margin: 0; color: var(--apagado); font-size: 14.5px; line-height: 1.6; max-width: 38em; }

.rodape {
  margin-top: 72px; padding-top: 22px; border-top: 1px solid var(--linha);
  display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center;
  font-size: 12.5px; color: var(--apagado);
}
.rodape p { margin: 0; max-width: 46em; line-height: 1.55; }
.rodape a { color: #c9ced4; }
.credito { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--apagado) !important; font-size: 12px; }
.credito img { display: block; }
.credito:hover { color: var(--texto) !important; }

@media (max-width: 760px) {
  .como ol { grid-template-columns: 1fr; gap: 40px; }
  .como li:not(:last-child)::after { top: auto; bottom: -32px; right: auto; left: 50%; width: 2px; height: 24px; }
  .como li:not(:last-child)::before {
    top: auto; bottom: -36px; right: auto; left: calc(50% - 5px);
    border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid #3c424d; border-bottom: 0;
  }
  .faq dl { grid-template-columns: 1fr; }
  .fases ul { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) { .fases ul { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .grelha button { transition: none; } }

/* "Fazer a sério connosco": sempre à vista, na entrada e no quadro, por baixo das janelas (z 50). */
.a-serio {
  position: fixed; z-index: 45; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px 10px 14px; border-radius: 999px;
  background: #a2ff00; color: #0b0d0f; text-decoration: none; font-family: Geist, Inter, system-ui, sans-serif;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s, box-shadow 0.15s;
}
.a-serio:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.08); }
.a-serio:focus-visible { outline: 2px solid #0b0d0f; outline-offset: 3px; }
.a-serio-icone { flex-shrink: 0; }
.a-serio-txt { display: flex; flex-direction: column; line-height: 1.15; }
.a-serio-txt b { font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em; }
.a-serio-txt small { font-size: 11.5px; opacity: 0.72; margin-top: 2px; }
html:has(.q-apresentar) .a-serio { display: none; }
@media (max-width: 480px) {
  .a-serio { padding: 9px 15px 9px 12px; }
  .a-serio-txt small { display: none; }
}
/* Com o quadro aberto num ecrã estreito, sobe para cima dos botões do zoom. */
@media (max-width: 640px) { html.fg-abrir .a-serio { bottom: calc(68px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .a-serio { transition: none; } }
