/*
 * Centro de ajuda: o tema «Campo» (as cores de um campo de padel, diferente do backoffice para não se confundir):
 * azul do campo, amarelo da bola, fundo azul-gelo e a letra Lexend. O painel lateral do «?» no backoffice
 * (.help-drawer) usa as mesmas regras, mas com as variáveis trocadas pelas cores e a letra do site.
 */
:root {
  --h-ink: #1f2d34;
  --h-ink-2: #2c3b42;
  --h-muted: #4f6470;
  --h-court: #0e3a6b;
  --h-court-2: #1d5fa8;
  --h-court-soft: #e7f0fa;
  --h-ball: #e8d44d;
  --h-bg: #f3f6fa;
  --h-card: #ffffff;
  --h-line: #d6e2ee;
  --h-line-2: #e6edf4;
  --h-warn-bg: #fff4e5;
  --h-warn-line: #ffd29a;
  --h-warn-ink: #4a3200;
  --h-warn-title: #6b4300;
  --h-font: Lexend, "Segoe UI", system-ui, -apple-system, sans-serif;
}

.help-body { margin: 0; background: var(--h-bg); color: var(--h-ink); font-family: var(--h-font); font-size: 16px; line-height: 1.6; }
.help-body a { color: var(--h-court-2); }
.help-body a:hover { color: var(--h-court); }
.help-body :focus-visible { outline: 3px solid var(--h-ball); outline-offset: 2px; }
.help-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Barra de cima */
.help-top { background: var(--h-court); color: #fff; padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left)); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.help-brand { display: flex; align-items: center; gap: 10px; color: #fff !important; text-decoration: none; font-weight: 700; font-size: 18px; }
.help-ball { width: 34px; height: 34px; border-radius: 50%; background: var(--h-ball); color: var(--h-court); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex: none; }
.help-search { flex: 1 1 320px; max-width: 640px; display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 8px; padding: 0 12px; height: 44px; }
.help-search input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; font-size: 15px; color: var(--h-ink); height: 40px; background: transparent; }
.help-search button { border: 0; background: var(--h-court-2); color: #fff; font: inherit; font-size: 14px; font-weight: 600; border-radius: 6px; height: 32px; padding: 0 12px; cursor: pointer; }
.help-top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14px; }
.help-top-right a { color: #cfe0f2; text-decoration: none; }
.help-top-right a:hover { color: #fff; }
.help-lang { display: flex; align-items: center; gap: 6px; }
.help-lang select { font: inherit; font-size: 14px; height: 34px; border-radius: 6px; border: 0; padding: 0 8px; color: var(--h-ink); }

/* Avisos da língua */
.help-notice { background: var(--h-warn-bg); border-bottom: 1px solid var(--h-warn-line); color: var(--h-warn-ink); padding: 10px max(16px, env(safe-area-inset-left)); font-size: 14px; }

/* Grelha da página: árvore, conteúdo, «Nesta página» */
.help-wrap { max-width: 1360px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left)); display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.help-tree { flex: 1 1 240px; max-width: 280px; background: var(--h-card); border: 1px solid var(--h-line); border-radius: 10px; padding: 12px 8px; font-size: 14px; }
.help-tree-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--h-muted); padding: 4px 10px 8px; }
.help-tree details { margin: 0; }
.help-tree summary { list-style: none; cursor: pointer; padding: 7px 10px; border-radius: 6px; font-weight: 600; color: var(--h-ink); display: flex; align-items: center; gap: 6px; }
.help-tree summary::-webkit-details-marker { display: none; }
.help-tree summary::before { content: "›"; display: inline-block; width: 10px; color: var(--h-muted); transition: transform .15s; }
.help-tree details[open] > summary::before { transform: rotate(90deg); }
.help-tree summary:hover { background: var(--h-bg); }
.help-tree ul { list-style: none; margin: 0 0 6px 18px; padding: 0; border-left: 2px solid var(--h-line); }
.help-tree li a { display: block; padding: 5px 12px; color: #3d4f57; text-decoration: none; }
.help-tree li a:hover { color: var(--h-court); background: var(--h-bg); }
.help-tree li a[aria-current="page"] { color: var(--h-ink); font-weight: 600; border-left: 3px solid var(--h-court-2); margin-left: -2px; background: var(--h-court-soft); }

.help-main { flex: 999 1 560px; min-width: 0; background: var(--h-card); border: 1px solid var(--h-line); border-radius: 10px; padding: 28px clamp(18px, 4vw, 40px) 24px; }
.help-crumbs { font-size: 13px; color: var(--h-muted); display: flex; flex-wrap: wrap; gap: 6px; }
.help-crumbs a { color: var(--h-muted); }
.help-main h1 { margin: 8px 0 14px; font-size: clamp(26px, 3vw, 34px); font-weight: 700; line-height: 1.2; text-wrap: balance; }
.help-where { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; background: var(--h-bg); border-radius: 8px; padding: 10px 14px; font-size: 14px; }
.help-where-label { font-weight: 700; color: var(--h-muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.help-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--h-court-2); color: #fff !important; text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 14px; border-radius: 6px; border: 0; cursor: pointer; min-height: 36px; box-sizing: border-box; }
.help-btn:hover { background: var(--h-court); }
.help-where .help-btn { margin-left: auto; }
.help-summary { font-size: 18px; line-height: 1.6; color: var(--h-ink-2); margin: 20px 0 6px; max-width: 72ch; }
.help-review { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--h-warn-title); background: var(--h-warn-bg); border: 1px solid var(--h-warn-line); border-radius: 4px; padding: 2px 8px; }

/* O texto da página (Markdown) */
.help-content { max-width: 74ch; font-size: 16px; color: var(--h-ink-2); }
.help-content h2 { font-size: 22px; font-weight: 700; color: var(--h-ink); margin: 30px 0 10px; scroll-margin-top: 16px; }
.help-content h3 { font-size: 18px; font-weight: 600; color: var(--h-ink); margin: 22px 0 8px; }
.help-content p { margin: 0 0 12px; }
.help-content ul, .help-content ol { margin: 0 0 14px; padding-left: 24px; }
.help-content li { margin: 4px 0; }
.help-content li p { margin: 0; }
.help-content ol { list-style: none; padding-left: 0; counter-reset: passo; }
.help-content ol > li { counter-increment: passo; position: relative; padding-left: 42px; margin: 10px 0; }
.help-content ol > li::before { content: counter(passo); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--h-court-soft); color: var(--h-court); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.help-content img { max-width: 100%; height: auto; border: 1px solid var(--h-line); border-radius: 8px; margin: 6px 0 14px; }
.help-content code { background: var(--h-bg); border-radius: 4px; padding: 1px 5px; font-size: .92em; }
.help-content table { border-collapse: collapse; margin: 0 0 14px; display: block; overflow-x: auto; }
.help-content th, .help-content td { border: 1px solid var(--h-line); padding: 6px 10px; text-align: left; }
.help-attention { background: var(--h-warn-bg); border: 1px solid var(--h-warn-line); border-radius: 8px; padding: 4px 18px 6px; margin: 24px 0 8px; color: var(--h-warn-ink); }
.help-attention h2 { font-size: 16px; color: var(--h-warn-title); margin: 10px 0 6px; }
.help-attention h2::before { content: "⚠ "; }

/* Relacionadas */
.help-related { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.help-card { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--h-line); border-radius: 8px; padding: 14px 16px; text-decoration: none; color: var(--h-ink) !important; background: var(--h-card); }
.help-card:hover { border-color: var(--h-court-2); box-shadow: 0 2px 8px rgba(14, 58, 107, .08); }
.help-card strong { font-weight: 700; }
.help-card span { font-size: 13px; color: var(--h-muted); }

/* Rodapé da página */
.help-foot { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--h-line-2); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; font-size: 13px; color: var(--h-muted); }
.help-vote { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.help-vote button { display: inline-flex; align-items: center; gap: 6px; height: 40px; min-width: 44px; padding: 0 12px; border: 1px solid var(--h-line); border-radius: 6px; background: var(--h-card); font: inherit; color: var(--h-ink); cursor: pointer; }
.help-vote button:hover { border-color: var(--h-court-2); }
.help-vote button[disabled] { opacity: .55; cursor: default; }

.help-toc { flex: 1 1 170px; max-width: 200px; font-size: 13px; position: sticky; top: 16px; }
.help-toc-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--h-muted); margin-bottom: 8px; }
.help-toc nav { display: flex; flex-direction: column; gap: 6px; border-left: 2px solid var(--h-line); padding-left: 12px; }
.help-toc a { color: #3d4f57; text-decoration: none; }
.help-toc a:hover { color: var(--h-court); }

/* Início */
.help-hero { background: var(--h-court); color: #fff; padding: 36px max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left)); border-bottom: 4px solid var(--h-ball); }
.help-hero-in { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.help-hero h1 { margin: 0; font-size: clamp(26px, 4vw, 36px); font-weight: 700; line-height: 1.2; }
.help-hero .help-search { max-width: none; height: 54px; }
.help-hero .help-search input { font-size: 17px; }
.help-popular { font-size: 14px; color: #cfe0f2; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.help-popular a { color: #fff; }
.help-home { max-width: 1240px; margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 28px; }
.help-home h2 { font-size: 22px; font-weight: 700; margin: 0 0 12px; }
.help-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.help-areas .help-card { min-height: 110px; padding: 18px; }
.help-areas .help-card strong { font-size: 17px; }
.help-areas .help-card em { margin-top: auto; font-style: normal; font-size: 12px; font-weight: 600; color: var(--h-court-2); }
.help-panel { background: var(--h-card); border: 1px solid var(--h-line); border-radius: 10px; padding: 20px 22px; }
.help-news h3 { font-size: 15px; margin: 14px 0 6px; color: var(--h-court); }

/* Pesquisa */
.help-results { list-style: none; margin: 16px 0 0; padding: 0; }
.help-results li { padding: 14px 0; border-top: 1px solid var(--h-line-2); }
.help-results a { font-weight: 600; font-size: 17px; }
.help-results small { display: block; color: var(--h-muted); font-size: 12px; margin: 2px 0 4px; }
.help-results p { margin: 0; font-size: 14px; color: var(--h-ink-2); }

/* Painel lateral do «?» no backoffice: com as cores e a letra do site (o tema «Campo» é só do Centro de ajuda) */
.help-drawer {
  --h-ink: #212529;
  --h-ink-2: #343a40;
  --h-muted: #6c757d;
  --h-court: var(--primary, #007bff);
  --h-court-2: var(--primary, #007bff);
  --h-line: #dee2e6;
  --h-line-2: #e9ecef;
  --h-font: inherit;
}
.help-trigger { border: 0; background: transparent; color: #6c757d; font-size: 1.15rem; line-height: 1; cursor: pointer; padding: 0 8px; vertical-align: middle; }
.help-trigger:hover, .help-trigger[aria-expanded="true"] { color: var(--primary, #007bff); }
.help-drawer-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .25); z-index: 1060; }
.help-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: #fff; box-shadow: -8px 0 24px rgba(0, 0, 0, .18); z-index: 1061; display: flex; flex-direction: column; font-family: inherit; color: var(--h-ink); transform: translateX(105%); transition: transform .18s ease; }
.help-drawer.open { transform: none; }
.help-drawer-head { background: #fff; color: var(--h-ink); padding: 12px 18px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--h-line); font-size: 1.1rem; }
.help-drawer-head .help-drawer-icon { color: var(--primary, #007bff); font-size: 1.3rem; }
.help-drawer-close { margin-left: auto; width: 40px; height: 40px; border: 0; border-radius: 6px; background: transparent; color: var(--h-muted); font-size: 24px; cursor: pointer; }
.help-drawer-close:hover { background: #f1f3f5; color: var(--h-ink); }
.help-drawer .help-btn:hover { filter: brightness(.9); }
.help-drawer-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.help-drawer-body h2.help-drawer-title { margin: 0 0 10px; font-size: 22px; font-weight: 700; }
.help-drawer-body .help-content { font-size: 15px; }
.help-drawer-body .help-content h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--h-muted); margin: 20px 0 8px; }
.help-drawer-body .help-attention h2 { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--h-warn-title); }
.help-drawer-foot { padding: 12px 22px; border-top: 1px solid var(--h-line); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.help-drawer-foot .help-vote { margin-left: auto; }
@media (prefers-reduced-motion: reduce) { .help-drawer { transition: none; } }
@media (max-width: 760px) { .help-toc { display: none; } .help-tree { max-width: none; } }
