/* =============================================================================
   OneToolBox — Base compartilhada das ferramentas públicas
   Tokens: global_utils.css (:root --otb-*)
   ============================================================================= */

/* Fundo com lavagem bordô (páginas públicas usam body.brand-pilot) */
body.brand-pilot {
  background:
    radial-gradient(1200px 420px at 10% -10%, rgba(130, 30, 60, 0.12), transparent 60%),
    radial-gradient(900px 380px at 95% 8%, rgba(240, 180, 10, 0.10), transparent 55%),
    #F3EEF0;
}

/* ── Container da ferramenta ── */
.fer-page,
.cep-page,
.wrap,
.fer-cnpj.fer-cnpj__tool,
.container.app-grid {
  max-width: 1200px;
  margin: 18px auto 40px;
  padding: 0 16px;
}

/* ── Cabeçalho ── */
.page-head .crumbs {
  font-size: 13px;
  color: var(--otb-neutral);
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-head .crumbs a {
  color: var(--otb-brand);
  font-weight: 600;
  text-decoration: none;
}

.page-head .crumbs a:hover {
  text-decoration: underline;
}

.page-head h1 {
  margin: 6px 0 4px;
  font-size: 26px;
  color: var(--otb-brand);
  display: inline-block;
  padding-bottom: 10px;
}

.page-head h1::after {
  content: "";
  display: block;
  width: 72px;
  height: 5px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--otb-brand), var(--otb-accent));
}

.page-head .subtitle {
  margin: 0;
  color: var(--otb-text-muted);
  max-width: 62ch;
}

/* ── Grid principal ── */
.tool-shell {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 1.2fr;
  gap: 16px;
}

.tool-shell--duo {
  grid-template-columns: 1fr 1.4fr;
}

/* ── Painéis claros ── */
.pane,
.fer-cnpj__tool .types,
.fer-cnpj__tool .form,
.fer-cnpj__tool .preview,
.app-grid .types,
.app-grid .form,
.app-grid .preview {
  background: var(--otb-surface);
  border: 1px solid var(--otb-border);
  border-left: 4px solid var(--otb-brand);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(130, 30, 60, 0.08);
  padding: 14px;
  color: var(--otb-text);
  min-height: 420px;
}

.tool-shell--duo .pane {
  min-height: 360px;
}

.pane-title,
.types__title,
.form__title,
.preview__title,
.fer-cnpj__tool h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 14px;
  padding-bottom: 8px;
  color: var(--otb-brand);
  letter-spacing: 0.01em;
  border-bottom: 2px solid var(--otb-brand-mid);
}

/* ── Menu lateral ── */
.tool-menu,
.types__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-item,
.type-btn {
  appearance: none;
  width: 100%;
  border: 1px solid #D1D5DB;
  background: #F9FAFB;
  color: #374151;
  padding: 12px;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.08s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.tool-item:hover,
.type-btn:hover {
  transform: translateY(-1px);
  background: #F3F4F6;
}

.tool-item.is-active,
.type-btn.is-active {
  outline: none;
  border-color: var(--otb-brand);
  background: var(--otb-surface-brand);
  box-shadow: 0 0 0 2px var(--otb-focus-ring) inset;
}

/* ── Formulários ── */
.pane-form .field,
.field-row,
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.pane-form label,
.pane-form .form label,
.field label,
.fer-cnpj__tool label {
  font-size: 14px;
  color: var(--otb-brand);
  font-weight: 700;
}

.pane-form input,
.pane-form select,
.pane-form textarea,
.form input[type="text"],
.form input[type="tel"],
.form input[type="url"],
.form input[type="email"],
.form textarea,
.form select,
.fer-cnpj__tool input[type="text"],
.field input,
.field textarea,
.field select {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid #D1D5DB;
  color: #374151;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  outline: none;
}

.pane-form input:focus,
.pane-form select:focus,
.pane-form textarea:focus,
.form input:focus,
.form textarea:focus,
.form select:focus,
.fer-cnpj__tool input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--otb-brand);
  box-shadow: 0 0 0 3px var(--otb-focus-ring);
}

.hint {
  color: #6B7280;
  font-size: 12px;
}

.form__panel {
  display: none;
}

.form__panel.is-active {
  display: block;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* ── Botões ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1;
  border: 1px solid #D1D5DB;
  background: #F3F4F6;
  color: #374151;
  cursor: pointer;
  font-weight: 700;
}

.btn:hover {
  filter: brightness(0.96);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary,
.btn.primary,
.btn.btn-primary {
  background: var(--otb-brand);
  border-color: var(--otb-brand);
  color: #FFFFFF;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(130, 30, 60, 0.28);
}

.btn-primary:hover,
.btn.primary:hover,
.btn.btn-primary:hover {
  background: var(--otb-brand-hover);
  border-color: var(--otb-brand-hover);
}

.btn-secondary,
.btn.secondary,
.btn.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--otb-brand);
  color: var(--otb-brand);
}

.btn-secondary:hover,
.btn.secondary:hover,
.btn.btn-secondary:hover {
  background: var(--otb-brand-soft);
}

.btn-copy {
  background: #E5E7EB;
  color: #374151;
  white-space: nowrap;
}

/* ── Resultado ── */
#resultRoot,
.fer-cnpj__tool .result-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.placeholder,
.fer-cnpj__tool .result-panel .placeholder {
  background: #F9FAFB;
  color: #6B7280;
  border: 1px dashed #D1D5DB;
  padding: 18px;
  border-radius: 10px;
  font-size: 14px;
  text-align: center;
}

.spinner,
.fer-cnpj__tool .spinner {
  text-align: center;
  padding: 2rem 0;
  font-size: 14px;
  color: #374151;
}

.loading {
  padding: 14px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--otb-brand);
}

.error {
  background-color: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.9rem;
}

.card {
  background-color: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 10px 14px;
  line-height: 1.4;
  color: #374151;
}

.card h3,
.card h4 {
  color: var(--otb-brand);
  margin: 0 0 8px;
}

/* ── QR dentro de painéis ── */
.qr-target {
  display: grid;
  place-items: center;
  background: #F9FAFB;
  border: 1px dashed #D1D5DB;
  border-radius: 12px;
  min-height: 220px;
}

.qr-box {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px;
}

.result-card,
.result-row {
  margin-bottom: 12px;
}

.result-card {
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 14px;
  background: #F9FAFB;
}

.out-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.out-line input,
.out-line textarea {
  width: 100%;
}

.notice {
  margin-top: 6px;
  background: var(--otb-surface-brand);
  border: 1px solid var(--otb-brand-mid);
  color: var(--otb-text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}

.tips-card {
  margin-top: 12px;
  border: 1px solid var(--otb-border);
  border-top: 3px solid var(--otb-brand);
  border-radius: 12px;
  padding: 14px;
  background: linear-gradient(180deg, #FFF8F9 0%, #F7F0F2 100%);
}

.tips-card h3 {
  margin: 0 0 8px;
  color: var(--otb-brand);
  font-size: 15px;
}

.tips-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--otb-text-muted);
  font-size: 14px;
}

.tips-card li::marker {
  color: var(--otb-brand);
}

/* ── Seções "Como funciona" (todas as ferramentas) ── */
.cep-explain,
.conv-explain,
.qr-explain,
.whats-explain,
.fer-cnpj__explain {
  max-width: 1200px;
  margin: 32px auto 40px;
  padding: 24px 16px 28px;
  background-color: #F9FAFB;
  border-radius: 16px;
  border: 1px solid #E5E7EB;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  color: #333333;
}

.cep-explain__header,
.conv-explain__header,
.qr-explain__header,
.whats-explain__header,
.howto-row__header {
  max-width: 720px;
  margin-bottom: 18px;
}

.cep-explain__eyebrow,
.conv-explain__eyebrow,
.qr-explain__eyebrow,
.whats-explain__eyebrow,
.howto-row__eyebrow {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--otb-brand);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--otb-brand-soft);
  border: 1px solid var(--otb-brand-mid);
  margin-bottom: 6px;
}

.cep-explain__header h2,
.conv-explain__header h2,
.qr-explain__header h2,
.whats-explain__header h2,
.howto-row__header h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  color: var(--otb-brand);
  font-weight: 700;
}

.cep-explain__grid,
.conv-explain__grid,
.qr-explain__grid,
.whats-explain__grid,
.howto-row__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.whats-explain__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cep-explain__item,
.conv-explain__item,
.qr-explain__item,
.whats-explain__item,
.howto-item {
  background-color: var(--otb-surface);
  border-radius: 12px;
  border: 1px solid var(--otb-border);
  border-top: 4px solid var(--otb-brand);
  padding: 14px 14px 16px;
  box-shadow: 0 10px 22px rgba(130, 30, 60, 0.06);
}

.cep-explain__item:nth-child(2),
.conv-explain__item:nth-child(2),
.qr-explain__item:nth-child(2),
.whats-explain__item:nth-child(2),
.howto-item:nth-child(2) {
  border-top-color: var(--otb-accent);
}

.cep-explain__item:nth-child(3),
.conv-explain__item:nth-child(3),
.qr-explain__item:nth-child(3),
.howto-item:nth-child(3) {
  border-top-color: var(--otb-neutral);
}

.cep-explain__item h3,
.conv-explain__item h3,
.qr-explain__item h3,
.whats-explain__item h3,
.howto-item h3 {
  margin: 0 0 6px;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--otb-brand);
}

/* ── Blog / dicas ── */
.cep-blog,
.conv-blog,
.qr-blog,
.whats-blog {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 0 16px;
  color: #333333;
}

.cep-blog > h2,
.conv-blog > h2,
.qr-blog > h2,
.whats-blog > h2 {
  margin: 0 0 12px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--otb-brand);
}

.cep-blog__body,
.conv-blog__body,
.qr-blog__body,
.whats-blog__body {
  background-color: #FFFFFF;
  border-radius: 16px;
  border: 1px solid #E5E7EB;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
  padding: 16px;
}

.cep-blog__tag,
.conv-blog__tag,
.qr-blog__tag,
.whats-blog__tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--otb-brand);
  margin-bottom: 6px;
}

.fer-article__image,
.cep-article__image,
.converte-article__image,
.qr-article__image,
.cnpj-article__image {
  width: 100%;
  max-width: 650px;
  height: auto;
  max-height: 380px;
  object-fit: cover;
  object-position: center;
  display: block;
  margin: 0 auto 10px;
  border-radius: 12px;
}

/* ── FAQ Acordeão ── */
.fer-faq {
  max-width: 1200px;
  margin: 32px auto 40px;
  padding: 24px 16px 28px;
  background-color: #F9FAFB;
  border-radius: 16px;
  border: 1px solid #E5E7EB;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  color: #333333;
}

.fer-faq__header {
  max-width: 720px;
  margin-bottom: 18px;
}

.fer-faq__eyebrow {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--otb-brand);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--otb-brand-soft);
  border: 1px solid var(--otb-brand-mid);
  margin-bottom: 6px;
}

.fer-faq__header h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  color: var(--otb-brand);
  font-weight: 700;
}

.fer-faq__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fer-faq__item {
  background-color: #FFFFFF;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  overflow: hidden;
}

.fer-faq__question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  color: #374151;
  text-align: left;
}

.fer-faq__item.is-open {
  border-color: var(--otb-brand);
  background: var(--otb-surface-brand);
}

.fer-faq__question:hover {
  background-color: var(--otb-surface-brand);
  color: var(--otb-brand);
}

.fer-faq__arrow {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  color: var(--otb-brand);
}

.fer-faq__item.is-open .fer-faq__arrow {
  transform: rotate(180deg);
}

.fer-faq__answer {
  display: none;
  padding: 0 16px 14px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #4B5563;
}

.fer-faq__item.is-open .fer-faq__answer {
  display: block;
}

/* ── Ferramentas relacionadas (sidebar) ── */
.fer-related {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fer-related__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--otb-brand);
  margin: 0 0 4px;
}

.fer-related__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  text-decoration: none;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.fer-related__link:hover {
  border-color: var(--otb-brand);
  background-color: var(--otb-surface-brand);
}

/* ── Responsivo ── */
@media (max-width: 1024px) {
  .tool-shell,
  .tool-shell--duo,
  .fer-cnpj__tool .fer-cnpj__tool-grid,
  .app-grid {
    grid-template-columns: 1fr;
  }

  .pane,
  .fer-cnpj__tool .types,
  .fer-cnpj__tool .form,
  .fer-cnpj__tool .preview,
  .app-grid .types,
  .app-grid .form,
  .app-grid .preview {
    min-height: 0;
  }

  .cep-explain__grid,
  .conv-explain__grid,
  .qr-explain__grid,
  .whats-explain__grid,
  .howto-row__grid {
    grid-template-columns: 1fr;
  }
}
