/* ========================================================================
   TecTupi — Guia de padrões (/visual-padrao) e diretiva técnica
   (/tema-diretiva) · template styleguide
   ======================================================================== */

.sg-source {
  display: inline-block;
  margin-top: 24px;
  font-family: var(--f-sub);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--on-hero-mut);
}

.sg-list { margin-top: 44px; }

.sg-swatch,
.sg-font,
.sg-demo,
.sg-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.sg-chip {
  display: block;
  height: 84px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
}

.sg-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.sg-meta b {
  font-family: var(--f-display);
  font-size: 1.02rem;
  color: var(--head);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.sg-token {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--f-sub);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--verde);
}

[data-theme="dark"] .sg-token { color: var(--verde-bri); }

.sg-swatch p,
.sg-font p,
.sg-demo p {
  margin-top: 12px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
}

.sg-spec {
  display: block;
  font-family: var(--f-sub);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.sg-spec code { display: block; margin-top: 8px; width: fit-content; }

.sg-sample {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--head);
  margin: 12px 0 10px;
}

/* ---- escala tipográfica ---- */
.sg-scale {
  margin-top: 40px;
  display: grid;
  gap: 14px;
}

.sg-scale-row {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 26px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 22px;
}

.sg-scale-demo > * { margin: 0; }

.sg-hint {
  display: block;
  margin-top: 8px;
  font-family: var(--f-sub);
  font-size: 13px;
  color: var(--muted);
}

/* ---- botões e ícones ---- */
.sg-demo .btn { margin-bottom: 4px; }

.sg-sub {
  margin-top: 54px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sg-icons { margin-top: 22px; gap: 16px; }

.sg-icon {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.sg-icon .ic { margin-bottom: 0; }

/* ---- demos ---- */
.sg-demo-box {
  margin-top: 30px;
  background: var(--surface);
  border: 1px dashed var(--line-2);
  border-radius: 20px;
  padding: clamp(22px, 4vw, 36px);
}

.sg-demo-box .section-head { margin: 0; }

.sg-plan { display: grid; place-items: center; }

.sg-plan .pricing-card { width: 100%; max-width: 340px; }

/* ---- tabela de componentes ---- */
.sg-table {
  width: 100%;
  margin-top: 34px;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.sg-table th,
.sg-table td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  vertical-align: top;
}

.sg-table th {
  font-family: var(--f-sub);
  font-size: 12.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
}

.sg-table tr:last-child td { border-bottom: 0; }

/* ---- voz e regras ---- */
.sg-slogan {
  margin-top: 46px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--head);
}

.sg-formulas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.sg-formula {
  font-family: var(--f-cta);
  font-weight: 600;
  font-size: 15px;
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--verde);
  background: color-mix(in srgb, var(--verde) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--verde) 26%, transparent);
}

[data-theme="dark"] .sg-formula {
  color: var(--verde-bri);
  background: color-mix(in srgb, var(--verde-bri) 14%, transparent);
}

.sg-rules {
  margin-top: 18px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.sg-rules li {
  position: relative;
  padding-left: 22px;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink);
}

.sg-rules li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--accent);
}

.sg-rules--wide { margin-bottom: 36px; }

.sg-rules code { white-space: normal; }

.sg-panel .kicker { margin-bottom: 4px; }

.sg-panel .sg-hint { margin-top: 18px; }

@media (max-width: 860px) {
  .sg-scale-row { grid-template-columns: 1fr; gap: 10px; }
  .sg-table thead { display: none; }
  .sg-table tr { display: block; border-bottom: 1px solid var(--line); }
  .sg-table td { display: block; border-bottom: 0; padding-top: 6px; padding-bottom: 6px; }
}

/* ---- gate de acesso (/tema-diretiva sem sessão) ---- */
.sg-gate {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(28px, 5vw, 48px);
  box-shadow: var(--shadow);
}

.sg-gate h2 { margin: 0 0 12px; }

.sg-gate p {
  color: var(--muted);
  line-height: 1.65;
}

.sg-gate-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.sg-gate .sg-hint { margin-top: 18px; }

/* ---- logotipo: versões, proteção, tamanho, usos ---- */
.sg-logo-grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.sg-logo-grid--2 { grid-template-columns: repeat(2, 1fr); }

.sg-logo-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}

.sg-logo-tile img { width: 92px; height: auto; }
.sg-logo-tile .sg-hint { margin-top: 0; }

.sg-logo-tile--dark { background: var(--verde); border-color: var(--verde); }
.sg-logo-tile--dark img { filter: brightness(0) invert(1); }
.sg-logo-tile--mono img { filter: grayscale(1) contrast(1.1); }

.sg-logo-cap {
  font-family: var(--f-sub);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.sg-logo-tile--dark .sg-logo-cap { color: rgba(255, 255, 255, .85); }

.sg-protect-box {
  border: 2px dashed color-mix(in srgb, var(--verde) 55%, transparent);
  border-radius: 14px;
  padding: 26px;
  display: grid;
  place-items: center;
}

.sg-protect-box img { width: 72px; }

.sg-min-demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.sg-min-demo img { width: 24px; }

.sg-ruler {
  display: block;
  width: 64px;
  border-top: 2px solid var(--accent);
  position: relative;
}

.sg-ruler::before,
.sg-ruler::after {
  content: "";
  position: absolute;
  top: -6px;
  height: 12px;
  border-left: 2px solid var(--accent);
}

.sg-ruler::before { left: 0; }
.sg-ruler::after { right: 0; }

.sg-misuse {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.sg-misuse-tile {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.sg-misuse-tile p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.sg-misuse-demo img { width: 64px; }

.sg-misuse-tile--distor .sg-misuse-demo img { transform: scaleX(1.4) scaleY(.7); }
.sg-misuse-tile--cor .sg-misuse-demo img { filter: hue-rotate(250deg) saturate(4); }
.sg-misuse-tile--sombra .sg-misuse-demo img { filter: drop-shadow(7px 9px 3px rgba(0, 0, 0, .6)); }
.sg-misuse-tile--giro .sg-misuse-demo img { transform: rotate(-16deg); }

.sg-no {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #d64545;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
}

/* ---- identidade: combinações aprovadas ---- */
.sg-combos {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.sg-combo {
  border: 1px solid var(--line);
  border-radius: 18px;
  min-height: 150px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  box-shadow: var(--shadow);
}

.sg-combo-logo { width: 76px; }
.sg-combo-logo.mode-dark { filter: brightness(0) invert(1); }
.sg-combo-logo.mode-mono { filter: grayscale(1) contrast(1.1); }

.sg-combo:has(.mode-dark) .sg-logo-cap { color: rgba(255, 255, 255, .85); }

/* ---- diagramas da marca ---- */
.sg-patterns {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.sg-pattern {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.sg-pattern h3 {
  margin: 18px 0 8px;
  font-family: var(--f-display);
  font-size: 1.1rem;
  color: var(--head);
}

.sg-pattern > p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
}

.sg-pattern-demo {
  background: var(--surface-2);
  border: 1px dashed var(--line-2);
  border-radius: 14px;
  padding: 22px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.sg-anat { display: grid; gap: 10px; }

.sg-anat-part {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px 12px 44px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sg-anat-part p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.sg-num {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--verde);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.sg-cols {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 5px;
}

.sg-cols span {
  height: 64px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--verde) 22%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--verde) 35%, transparent);
}

.sg-type-demo h4 {
  margin: 4px 0;
  font-family: var(--f-display);
  font-size: 1.5rem;
  color: var(--head);
}

.sg-type-demo p { margin: 2px 0; font-size: 14px; }
.sg-type-demo .lead { font-size: 1rem; }

.sg-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  text-align: center;
}

.sg-stat b {
  display: block;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  color: var(--verde);
}

.sg-stat span { font-size: 13.5px; color: var(--muted); }

/* ---- parceiros e clientes ---- */
.sg-partners {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.sg-partner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  min-height: 104px;
  display: grid;
  place-items: center;
  padding: 18px;
  box-shadow: var(--shadow);
}

.sg-partner img {
  max-width: 100%;
  max-height: 52px;
  object-fit: contain;
}

.sg-partner-ph {
  font-family: var(--f-sub);
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- responsivo ---- */
@media (max-width: 1024px) {
  .sg-misuse,
  .sg-combos,
  .sg-partners { grid-template-columns: repeat(2, 1fr); }
  .sg-patterns { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .sg-logo-grid,
  .sg-logo-grid--2 { grid-template-columns: 1fr; }
  .sg-misuse,
  .sg-combos,
  .sg-partners { grid-template-columns: 1fr; }
  .sg-stats { grid-template-columns: 1fr; }
}
