/*
Theme Name: Tintas Hub
Theme URI: https://tintashub.com.br
Description: Tema oficial da plataforma Tintas Hub — conhecimento, conexão e negócios para o mercado de tintas e revestimentos. Requer o plugin Tintas Hub Core.
Author: Tintas Hub
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: tintas-hub
*/

/* ==========================================================================
   Tokens (paleta oficial)
   ========================================================================== */
:root {
  --navy: #0B1F33;
  --blue: #1267E5;
  --blue-dark: #0E52B8;
  --white: #FFFFFF;
  --bg: #F5F7FA;
  --ink: #202833;
  --muted: #5B6677;
  --line: #E3E8EF;
  --yellow: #FFC928;
  --coral: #F45151;
  --green: #27B879;
  --purple: #7957D5;
  --cyan: #16B8D4;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(11, 31, 51, .06), 0 8px 24px rgba(11, 31, 51, .06);
  --shadow-lg: 0 20px 50px rgba(11, 31, 51, .18);
  --container: 1200px;
  --header-h: 72px;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  padding-bottom: 72px; /* espaço para a navegação inferior no celular */
}
@media (min-width: 768px) { body { padding-bottom: 0; } }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.2; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.2em; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
.th-skip { position: absolute; left: -999px; top: 8px; z-index: 999; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 8px; }
.th-skip:focus { left: 8px; }
.th-muted { color: var(--muted); }
.th-kicker { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); margin-bottom: .4rem; }
.th-lead { font-size: 1.1rem; color: var(--muted); max-width: 70ch; }
.th-container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.th-main { min-height: 60vh; }

/* ==========================================================================
   Botões, badges, tags, alertas
   ========================================================================== */
.th-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .65rem 1.2rem; border-radius: 999px; border: 2px solid transparent;
  font-family: inherit; font-weight: 600; font-size: .95rem; line-height: 1; cursor: pointer; text-decoration: none; transition: .18s ease;
}
.th-btn:hover { text-decoration: none; transform: translateY(-1px); }
.th-btn--primary { background: var(--blue); color: #fff; }
.th-btn--primary:hover { background: var(--blue-dark); color: #fff; }
.th-btn--ghost { background: transparent; color: var(--blue); border-color: var(--blue); }
.th-btn--ghost:hover { background: rgba(18, 103, 229, .08); color: var(--blue-dark); }
.th-btn--light { background: #fff; color: var(--navy); }
.th-btn--light:hover { color: var(--navy); background: #eef3fb; }
.th-btn--outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.th-btn--outline-light:hover { color: #fff; background: rgba(255,255,255,.1); }
.th-btn--sm { min-height: 36px; padding: .45rem .9rem; font-size: .85rem; }
.th-btn--block { width: 100%; }

.th-badge, .th-tag {
  display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .65rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700; line-height: 1.5; background: var(--bg); color: var(--ink); border: 1px solid var(--line);
  margin: 0 .3rem .3rem 0; white-space: nowrap;
}
.th-tag { font-weight: 600; }
.th-badge--editorial { background: #EAF2FD; color: var(--blue-dark); border-color: #cfe2fb; }
.th-badge--revisado { background: #E7F7EF; color: #17805a; border-color: #bfe9d4; }
.th-badge--fabricante { background: #F1ECFC; color: #5b3ab3; border-color: #d9cbf6; }
.th-badge--patrocinado { background: #FFF6D6; color: #8a6400; border-color: #ffe49a; }
.th-badge--comunidade { background: #E3F7FB; color: #0b7f94; border-color: #b4e7f2; }
.th-badge--verified { background: var(--navy); color: #fff; border-color: var(--navy); }
.th-badge--cyan { background: #E3F7FB; color: #0b7f94; border-color: #b4e7f2; }
.th-badge--red { background: #FDECEC; color: #B42323; border-color: #f7c4c4; }
.th-badge--yellow { background: var(--yellow); color: var(--navy); border-color: var(--yellow); }

.th-alert { max-width: var(--container); margin: 16px auto 0; padding: 14px 18px; border-radius: var(--radius-sm); font-weight: 500; border: 1px solid; }
.th-alert--ok { background: #E7F7EF; border-color: #bfe9d4; color: #17603f; }
.th-alert--err { background: #FDECEC; border-color: #f7c4c4; color: #8a1f1f; }
.th-callout { background: #EEF5FF; border: 1px solid #cfe2fb; border-radius: var(--radius); padding: 18px 20px; margin: 1.5rem 0; }
.th-callout--warn { background: #FFF9E6; border-color: #ffe49a; }
.th-login-ok { border-left-color: var(--green); }

/* ==========================================================================
   Cabeçalho
   ========================================================================== */
.th-header {
  position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.97);
  backdrop-filter: saturate(160%) blur(8px); border-bottom: 1px solid var(--line);
}
.th-header__row { display: flex; align-items: center; gap: 18px; height: var(--header-h); }
.th-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); font-size: 1.25rem; font-weight: 500; letter-spacing: -.01em; flex-shrink: 0; }
.th-logo:hover { text-decoration: none; color: var(--navy); }
.th-logo strong { font-weight: 800; color: var(--blue); }
.th-logo__mark { flex-shrink: 0; }

.th-nav { flex: 1; min-width: 0; }
.th-nav__list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.th-nav__item { position: relative; }
.th-nav__btn, .th-nav__link {
  background: none; border: 0; font-family: inherit; font-weight: 600; font-size: .92rem; line-height: 1; color: var(--ink);
  padding: .7rem .65rem; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap;
}
.th-nav__btn::after { content: "▾"; font-size: .7em; opacity: .6; }
.th-nav__link::after { content: none; }
.th-nav__btn:hover, .th-nav__link:hover { background: var(--bg); color: var(--blue); text-decoration: none; }
.th-nav__auth { display: none; }

.th-mega {
  display: none; position: absolute; top: 100%; left: -20px; min-width: min(900px, 90vw);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 24px 0; z-index: 110;
}
.th-mega__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.th-mega__title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .6rem; }
.th-mega ul { list-style: none; margin: 0; padding: 0; }
.th-mega li a { display: block; padding: .4rem .5rem; border-radius: 8px; color: var(--ink); font-weight: 500; }
.th-mega li a:hover { background: var(--bg); color: var(--blue); text-decoration: none; }
.th-has-mega:hover .th-mega,
.th-has-mega:focus-within .th-mega,
.th-nav__btn[aria-expanded="true"] + .th-mega { display: block; }

.th-search { position: relative; display: flex; align-items: center; width: min(300px, 26vw); flex-shrink: 1; }
.th-search__input {
  width: 100%; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg);
  padding: 0 46px 0 18px; font-family: inherit; font-weight: 500; font-size: .92rem; color: var(--ink);
}
.th-search__input:focus { background: #fff; border-color: var(--blue); outline: none; box-shadow: 0 0 0 4px rgba(18,103,229,.12); }
.th-search__btn {
  position: absolute; right: 5px; top: 5px; width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: var(--blue); color: #fff; cursor: pointer; font-size: .9rem;
}
.th-auth { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.th-burger { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; margin-left: auto; }
.th-burger__bars, .th-burger__bars::before, .th-burger__bars::after {
  display: block; width: 22px; height: 2px; background: var(--navy); border-radius: 2px; position: relative; margin: 0 auto;
}
.th-burger__bars::before, .th-burger__bars::after { content: ""; position: absolute; left: 0; }
.th-burger__bars::before { top: -7px; }
.th-burger__bars::after { top: 7px; }

/* ==========================================================================
   Mensagens de página, seções e grids
   ========================================================================== */
.th-page-head { background: linear-gradient(180deg, #F5F9FF 0%, #fff 100%); border-bottom: 1px solid var(--line); padding: 28px 0 36px; }
.th-page-title { margin-top: .3rem; }
.th-section { padding: 56px 0; }
.th-section--alt { background: var(--bg); }
.th-section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.th-section__title { margin: 0; }
.th-link { font-weight: 700; white-space: nowrap; }

.th-grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
.th-grid--3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.th-grid--4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.th-grid--2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.th-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease;
}
.th-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(11,31,51,.12); }
.th-card__media { display: block; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #EAF2FD, #E3F7FB); overflow: hidden; }
.th-card__media img { width: 100%; height: 100%; object-fit: cover; }
.th-card__placeholder { display: flex; height: 100%; align-items: center; justify-content: center; font-size: 2.6rem; }
.th-card__body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.th-card__badges { margin-bottom: .4rem; }
.th-card__title { font-size: 1.05rem; margin: .2rem 0 .4rem; }
.th-card__title a { color: var(--navy); }
.th-card__title a:hover { color: var(--blue); }
.th-card__meta { font-size: .82rem; color: var(--muted); margin: 0 0 .5rem; }
.th-card__excerpt { font-size: .93rem; color: var(--ink); margin: 0; }
.th-card--compact .th-card__body { padding: 14px 16px; }

/* Atalhos da home */
.th-shortcuts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 900px) { .th-shortcuts { grid-template-columns: repeat(5, 1fr); } }
.th-shortcut {
  display: flex; flex-direction: column; gap: 6px; padding: 18px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--ink); box-shadow: var(--shadow); transition: .18s ease; height: 100%;
}
.th-shortcut:hover { border-color: var(--blue); transform: translateY(-2px); text-decoration: none; color: var(--ink); }
.th-shortcut__icon { font-size: 1.7rem; line-height: 1; }
.th-shortcut strong { color: var(--navy); font-size: 1rem; }
.th-shortcut span { color: var(--muted); font-size: .85rem; line-height: 1.4; }

/* Pilares */
.th-pillars { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.th-pillar { border-radius: var(--radius); padding: 22px; color: #fff; }
.th-pillar h3 { color: #fff; margin-bottom: .3rem; }
.th-pillar p { margin: 0; opacity: .92; font-size: .95rem; }
.th-pillar--1 { background: linear-gradient(135deg, #1267E5, #16B8D4); }
.th-pillar--2 { background: linear-gradient(135deg, #7957D5, #1267E5); }
.th-pillar--3 { background: linear-gradient(135deg, #27B879, #16B8D4); }

/* Lista de verificação e blocos */
.th-checklist { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.th-checklist li { position: relative; padding-left: 26px; margin-bottom: .45rem; }
.th-checklist li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--green); font-weight: 800; }
.th-tags { margin: .5rem 0 0; }

/* Estado vazio */
.th-empty { border: 1.5px dashed #cdd6e2; border-radius: var(--radius); padding: 28px; text-align: center; background: #fff; color: var(--muted); }
.th-empty p { margin: 0 0 .8rem; }

/* ==========================================================================
   Hero da home
   ========================================================================== */
.th-hero {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(1200px 500px at 90% -10%, rgba(22,184,212,.35), transparent 60%),
              radial-gradient(900px 500px at -10% 110%, rgba(18,103,229,.55), transparent 60%),
              linear-gradient(135deg, #0B1F33 0%, #0E3157 100%);
  padding: 80px 0 90px;
}
.th-hero::before, .th-hero::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
}
.th-hero::before { width: 420px; height: 420px; right: -120px; top: -120px; border: 60px solid rgba(255,201,40,.10); }
.th-hero::after { width: 260px; height: 260px; right: 18%; bottom: -120px; background: radial-gradient(circle, rgba(244,81,81,.35), rgba(122,87,213,.2) 60%, transparent 70%); }
.th-hero__inner { position: relative; z-index: 1; max-width: 860px; }
.th-hero .th-kicker { color: var(--yellow); }
.th-hero h1 { color: #fff; font-size: clamp(2.1rem, 5vw, 3.6rem); letter-spacing: -.02em; }
.th-hero__lead { color: rgba(255,255,255,.85); font-size: 1.1rem; max-width: 60ch; margin-bottom: 28px; }
.th-hero__search { display: flex; background: #fff; border-radius: 16px; padding: 8px; box-shadow: var(--shadow-lg); max-width: 760px; }
.th-hero__search input {
  flex: 1; min-width: 0; border: 0; background: transparent; font-family: inherit; font-weight: 500; font-size: 1.05rem; color: var(--ink); padding: 0 16px; height: 56px;
}
.th-hero__search input:focus { outline: none; }
.th-hero__search button { border: 0; background: var(--blue); color: #fff; font-weight: 700; border-radius: 12px; padding: 0 26px; cursor: pointer; font-family: inherit; min-height: 56px; }
.th-hero__search button:hover { background: var(--blue-dark); }
.th-hero__examples { margin-top: 12px; font-size: .9rem; color: rgba(255,255,255,.75); }
.th-hero__examples a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,.4); margin-right: 12px; white-space: nowrap; }
.th-hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* Acesso rápido "Tenho uma dúvida / Quero aprender..." */
.th-paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.th-path { display: block; padding: 22px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); }
.th-path:hover { text-decoration: none; border-color: var(--blue); color: var(--ink); }
.th-path strong { display: block; color: var(--navy); margin-bottom: .2rem; }
.th-path span { font-size: .92rem; color: var(--muted); }
.th-path__cta { display: inline-block; margin-top: .6rem; font-weight: 700; color: var(--blue); }

/* Para quem é */
.th-audience { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.th-audience__icon { font-size: 2rem; }
.th-audience ul { margin: .5rem 0 1rem; }
.th-audience .th-btn { margin-top: auto; }

/* Diagnóstico callout */
.th-diagnostic { background: linear-gradient(120deg, #0B1F33, #0E3157); color: #fff; border-radius: 20px; padding: 36px; display: grid; gap: 22px; align-items: center; grid-template-columns: 1fr; }
.th-diagnostic h2, .th-diagnostic h3 { color: #fff; }
.th-diagnostic p { color: rgba(255,255,255,.85); }
@media (min-width: 860px) { .th-diagnostic { grid-template-columns: 1.4fr 1fr; padding: 48px; } }

/* ==========================================================================
   Layouts de conteúdo
   ========================================================================== */
.th-layout { display: grid; gap: 36px; grid-template-columns: 1fr; padding: 40px 0 60px; }
@media (min-width: 960px) { .th-layout { grid-template-columns: minmax(0, 1fr) 340px; } }
.th-layout--full { grid-template-columns: 1fr; }
.th-aside { display: flex; flex-direction: column; gap: 20px; }
.th-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.th-panel h3 { font-size: 1rem; margin-bottom: .8rem; }
.th-panel ul { list-style: none; margin: 0; padding: 0; }
.th-panel li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.th-panel li:last-child { border-bottom: 0; }
.th-panel li a { color: var(--ink); font-weight: 500; }

.th-block { padding: 22px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
.th-block:last-child { border-bottom: 0; }
.th-block h2 { font-size: 1.3rem; }
.th-prose { font-size: 1.03rem; }
.th-prose p:last-child { margin-bottom: 0; }
.th-prose img { border-radius: var(--radius); margin: 1rem 0; }
.th-info { background: var(--bg); border-radius: var(--radius); padding: 22px; margin-top: 30px; }
.th-info dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: .93rem; }
.th-info dt { color: var(--muted); }
.th-info dd { margin: 0; font-weight: 600; }
.th-info ol { margin: .5rem 0 0; font-size: .9rem; }

.th-breadcrumbs { font-size: .85rem; margin-bottom: 14px; }
.th-breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; color: var(--muted); }
.th-breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: #a5b0bf; }
.th-breadcrumbs a { color: var(--muted); }

.th-card-cover { height: 180px; border-radius: var(--radius); background: linear-gradient(135deg, #0B1F33, #1267E5 70%, #16B8D4); }

/* Perfil de empresa e pintor */
.th-profile__cover { height: 220px; background: linear-gradient(135deg, #0B1F33, #1267E5 70%, #16B8D4); background-size: cover; background-position: center; }
.th-profile__head { position: relative; display: flex; gap: 22px; align-items: flex-end; flex-wrap: wrap; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.th-profile__logo {
  width: 120px; height: 120px; border-radius: 22px; background: #fff; border: 4px solid #fff; box-shadow: var(--shadow-lg);
  margin-top: -60px; display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 2.4rem; font-weight: 800; color: var(--blue); flex-shrink: 0;
}
.th-profile__logo img { width: 100%; height: 100%; object-fit: cover; }
.th-profile__info { flex: 1; min-width: 220px; }
.th-profile__info h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: .3rem 0 .2rem; }
.th-profile__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.th-profile__stats { font-size: .9rem; color: var(--muted); }
.th-inline-form { display: inline-block; margin: 0; }
.th-anchors { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Planos */
.th-plans { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: stretch; }
.th-plan { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 28px 24px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.th-plan--highlight { border: 2px solid var(--blue); box-shadow: 0 20px 50px rgba(18,103,229,.18); }
.th-plan .th-badge { position: absolute; top: -12px; left: 20px; }
.th-plan h2 { font-size: 1.25rem; margin-top: .4rem; }
.th-plan__price { font-size: 1.6rem; font-weight: 800; color: var(--navy); margin: .6rem 0 1rem; line-height: 1.2; }
.th-plan__price small { display: block; font-size: .85rem; font-weight: 500; color: var(--muted); }
.th-plan .th-btn { margin-top: auto; }
.th-plan .th-checklist { flex: 1; }

/* Formulários */
.th-form { display: grid; gap: 16px; }
.th-form__grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .th-form__grid { grid-template-columns: 1fr 1fr; } }
.th-field { display: flex; flex-direction: column; gap: 6px; }
.th-field--full { grid-column: 1 / -1; }
.th-field__label { font-weight: 600; font-size: .92rem; color: var(--navy); }
.th-field__hint { font-size: .8rem; color: var(--muted); }
.th-input, .th-select, .th-textarea {
  width: 100%; border: 1.5px solid #cfd8e3; border-radius: 10px; padding: 11px 14px; font-family: inherit; font-weight: 500; font-size: 1rem;
  background: #fff; color: var(--ink); min-height: 46px;
}
.th-textarea { min-height: 110px; resize: vertical; }
.th-input:focus, .th-select:focus, .th-textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(18,103,229,.14); }
.th-select--sm, .th-textarea--sm { min-height: 38px; font-size: .9rem; padding: 8px 10px; }
.th-textarea--sm { min-height: 60px; margin: 6px 0; }
.th-check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.th-check input { margin-top: 5px; width: 18px; height: 18px; flex-shrink: 0; }
.th-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.th-card-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 26px; }

/* Opções de atuação (onboarding) */
.th-options { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0 0 22px; padding: 0; border: 0; }
.th-option { position: relative; cursor: pointer; }
.th-option input { position: absolute; opacity: 0; pointer-events: none; }
.th-option span.th-option__box { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 16px 10px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font-weight: 600; color: var(--navy); height: 100%; }
.th-option__icon { font-size: 1.7rem; }
.th-option input:checked + span.th-option__box { border-color: var(--blue); background: #EEF5FF; box-shadow: 0 0 0 4px rgba(18,103,229,.12); }
.th-option input:focus-visible + span.th-option__box { outline: 3px solid var(--cyan); outline-offset: 2px; }
fieldset.th-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend.th-legend { font-weight: 700; font-size: 1.1rem; color: var(--navy); margin-bottom: 14px; padding: 0; }

/* Filtros */
.th-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 26px; }
.th-filters .th-field { min-width: 150px; flex: 1; }
.th-filters .th-field__label { font-size: .8rem; }
.th-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.th-chip { display: inline-flex; padding: .45rem .9rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: .9rem; }
.th-chip:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.th-chip--active { background: var(--navy); color: #fff; border-color: var(--navy); }
.th-chip--active:hover { color: #fff; }
.th-chip small { opacity: .7; margin-left: 4px; }

/* Busca */
.th-search-hero { background: var(--bg); padding: 30px 0; border-bottom: 1px solid var(--line); }
.th-search-hero form { display: flex; gap: 10px; max-width: 760px; }
.th-search-hero input { flex: 1; height: 52px; border-radius: 14px; border: 1.5px solid #cfd8e3; padding: 0 18px; font-family: inherit; font-weight: 500; font-size: 1.02rem; }
.th-search-hero input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(18,103,229,.14); }
.th-search-hero button { border: 0; background: var(--blue); color: #fff; border-radius: 14px; padding: 0 24px; font-weight: 700; cursor: pointer; font-family: inherit; }
.th-group { margin-bottom: 44px; }
.th-group__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.th-count { background: var(--bg); color: var(--muted); padding: .2rem .7rem; border-radius: 999px; font-size: .85rem; font-weight: 700; }

/* Comunidade */
.th-comments { list-style: none; padding: 0; margin: 0 0 28px; }
.th-comment { border-top: 1px solid var(--line); padding: 18px 0; }
.th-comment__head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.th-comment__head time { color: var(--muted); font-size: .85rem; }
.th-comment__text p:last-child { margin: 0; }
.th-comment .children { list-style: none; padding-left: 22px; }
.th-question-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: .9rem; margin: .5rem 0 1rem; }
.th-levels { display: grid; gap: 10px; }
.th-level { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .92rem; padding: 8px 0; border-bottom: 1px solid var(--line); }
.th-report { margin-top: 14px; font-size: .9rem; }
.th-report summary { cursor: pointer; color: var(--muted); }
.th-report form { margin-top: 10px; display: grid; gap: 8px; }

/* Painel */
.th-dash { display: grid; gap: 24px; padding: 32px 0 60px; grid-template-columns: 1fr; }
@media (min-width: 960px) { .th-dash { grid-template-columns: 240px minmax(0, 1fr); } }
.th-dash__nav { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; align-self: start; position: sticky; top: 90px; }
.th-dash__nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink); font-weight: 600; }
.th-dash__nav a:hover { background: var(--bg); color: var(--blue); text-decoration: none; }
.th-dash__section { scroll-margin-top: 100px; margin-bottom: 40px; }
.th-stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 30px; }
.th-stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.th-stat__value { font-size: 1.6rem; font-weight: 800; color: var(--navy); line-height: 1.1; }
.th-stat__label { font-size: .85rem; color: var(--muted); }

/* Tabelas */
.th-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.th-table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 720px; }
.th-table th, .th-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.th-table th { background: var(--bg); color: var(--navy); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.th-lead-form select, .th-lead-form textarea { display: block; width: 100%; max-width: 280px; margin-bottom: 6px; }
.th-history { margin-top: 8px; font-size: .85rem; }
.th-history ul { list-style: none; padding: 0; }
.th-history li { padding: 6px 0; border-bottom: 1px dashed var(--line); }

/* Login */
.th-login-box { max-width: 460px; margin: 40px auto; }

/* ==========================================================================
   Rodapé e navegação inferior (mobile)
   ========================================================================== */
.th-footer { background: var(--navy); color: rgba(255,255,255,.78); padding: 56px 0 28px; margin-top: 0; }
.th-footer a { color: rgba(255,255,255,.85); }
.th-footer a:hover { color: #fff; }
.th-footer h3 { color: #fff; font-size: .95rem; margin-bottom: 14px; }
.th-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .92rem; }
.th-footer__grid { display: grid; gap: 32px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .th-footer__grid { grid-template-columns: 1.6fr repeat(5, 1fr); } }
.th-footer__brand p { margin: 14px 0 0; font-size: .92rem; max-width: 36ch; }
.th-footer .th-logo { color: #fff; }
.th-footer .th-logo strong { color: var(--yellow); }
.th-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; }
.th-social { display: flex; gap: 10px; }
.th-social a { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,.1); }

.th-bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 120; background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); box-shadow: 0 -4px 18px rgba(11,31,51,.08); padding-bottom: env(safe-area-inset-bottom); }
.th-bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; font-size: .72rem; font-weight: 600; color: var(--muted); min-height: 60px; justify-content: center; }
.th-bottomnav a span.th-bottomnav__icon { font-size: 1.2rem; line-height: 1; }
.th-bottomnav a[aria-current="page"], .th-bottomnav a:hover { color: var(--blue); text-decoration: none; }
.th-bottomnav__publish span.th-bottomnav__icon { background: var(--blue); color: #fff; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-top: -18px; box-shadow: 0 6px 16px rgba(18,103,229,.4); }
@media (min-width: 768px) { .th-bottomnav { display: none; } }

/* ==========================================================================
   Responsividade
   ========================================================================== */
@media (max-width: 1180px) {
  .th-nav__btn, .th-nav__link { padding: .7rem .45rem; font-size: .88rem; }
  .th-search { width: 220px; }
}
@media (max-width: 1023px) {
  .th-burger { display: block; }
  .th-header__row { position: relative; }
  .th-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg); max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 8px 20px 24px;
  }
  .th-nav.is-open { display: block; }
  .th-nav__list { flex-direction: column; align-items: stretch; }
  .th-nav__btn, .th-nav__link { width: 100%; justify-content: space-between; font-size: 1rem; padding: 14px 4px; border-radius: 0; border-bottom: 1px solid var(--line); }
  .th-mega { position: static; box-shadow: none; border: 0; min-width: 0; padding: 4px 0 12px; left: 0; }
  .th-mega__grid { grid-template-columns: 1fr; gap: 14px; }
  .th-nav__auth { display: flex; gap: 10px; margin-top: 18px; }
  .th-nav__auth .th-btn { flex: 1; }
  .th-auth { display: none; }
  .th-search { display: none; }
}
@media (max-width: 767px) {
  :root { --header-h: 64px; }
  .th-logo { font-size: 1.1rem; }
  .th-section { padding: 40px 0; }
  .th-hero { padding: 48px 0 60px; }
  .th-hero__search { flex-direction: column; border-radius: 14px; }
  .th-hero__search input { height: 50px; }
  .th-hero__search button { min-height: 48px; }
  .th-profile__cover { height: 150px; }
  .th-profile__logo { width: 96px; height: 96px; margin-top: -48px; }
  .th-diagnostic { padding: 26px; }
  .th-card-form { padding: 16px; }
  .th-search-hero form { flex-direction: column; }
  .th-search-hero button { min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
