/* Contbit Referral — herda variáveis do site quando existirem */
.ref-widget {
  --ref-accent: var(--gold, #e6bc55);
  --ref-accent2: var(--gold2, #f4d27a);
  --ref-bg: var(--panel, rgba(255, 255, 255, 0.04));
  --ref-bd: var(--bd, rgba(255, 255, 255, 0.1));
  --ref-txt: var(--txt, #fff);
  --ref-muted: var(--muted2, rgba(255, 255, 255, 0.65));
  --ref-input-bg: var(--panel2, rgba(0, 0, 0, 0.25));
  --ref-radius: 16px;
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 28px;
  border-radius: calc(var(--ref-radius) + 4px);
  border: 1px solid var(--ref-bd);
  background: var(--ref-bg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  /* Nunca esconder o gerador de link (evita .reveal com opacity:0) */
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
.ref-widget[data-theme="contbit"] {
  --ref-accent: #e6bc55;
  --ref-accent2: #f4d27a;
  background: linear-gradient(160deg, rgba(230, 188, 85, 0.08), rgba(255, 255, 255, 0.02));
  border-color: rgba(230, 188, 85, 0.22);
}
.ref-widget[data-theme="abitante"] {
  --ref-accent: #38bdf8;
  --ref-accent2: #22d3ee;
  --ref-bg: rgba(18, 24, 46, 0.55);
  --ref-bd: rgba(120, 160, 255, 0.18);
  --ref-muted: #9aa7c7;
  background: linear-gradient(160deg, rgba(56, 189, 248, 0.1), rgba(18, 24, 46, 0.4));
}
.ref-widget[data-theme="elisao"] {
  --ref-accent: #149063;
  --ref-accent2: #0d6b47;
  --ref-bg: #ffffff;
  --ref-bd: #cfd8e0;
  --ref-txt: #0b1b26;
  --ref-muted: #3d4f5c;
  --ref-input-bg: #ffffff;
  color: #0b1b26 !important;
  background: #ffffff;
  border: 1px solid #cfd8e0;
  box-shadow: 0 12px 40px rgba(10, 37, 64, 0.1);
}
/* Contraste forte no tema claro da Elisão Fiscal */
.ref-widget[data-theme="elisao"] .ref-title,
.ref-widget[data-theme="elisao"] .ref-lead,
.ref-widget[data-theme="elisao"] .ref-hint,
.ref-widget[data-theme="elisao"] .ref-preview,
.ref-widget[data-theme="elisao"] .ref-field label,
.ref-widget[data-theme="elisao"] .ref-result > label,
.ref-widget[data-theme="elisao"] .ref-opt {
  color: #0b1b26;
}
.ref-widget[data-theme="elisao"] .ref-lead,
.ref-widget[data-theme="elisao"] .ref-hint,
.ref-widget[data-theme="elisao"] .ref-preview,
.ref-widget[data-theme="elisao"] .ref-field label,
.ref-widget[data-theme="elisao"] .ref-result > label,
.ref-widget[data-theme="elisao"] .ref-opt {
  color: #3d4f5c;
}
.ref-widget[data-theme="elisao"] .ref-comm,
.ref-widget[data-theme="elisao"] .ref-hint em {
  color: #0d6b47;
}
.ref-widget[data-theme="elisao"] input {
  color: #0b1b26 !important;
  background: #fff !important;
  border: 1px solid #c5d0d8 !important;
}
.ref-widget[data-theme="elisao"] input::placeholder {
  color: #6b7c88;
  opacity: 1;
}
.ref-widget[data-theme="elisao"] .ref-btn-primary {
  background: #149063;
  color: #ffffff !important;
}
.ref-widget[data-theme="elisao"] .ref-btn-ghost {
  color: #0b1b26;
  border-color: #c5d0d8;
  background: #f5f8f9;
}
.ref-widget[data-theme="elisao"] code {
  color: #0a2540;
  background: #e8eef2;
  padding: 0.12em 0.4em;
  border-radius: 4px;
  font-size: 0.92em;
}

.ref-title {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: inherit;
}
.ref-lead {
  margin: 0 0 22px;
  color: var(--ref-muted);
  font-size: 0.98rem;
  line-height: 1.55;
}
.ref-comm {
  color: var(--ref-accent2);
  font-weight: 700;
}
.ref-opt {
  font-weight: 400;
  opacity: 0.75;
  font-size: 0.85em;
}

.ref-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--ref-accent) 35%, transparent);
  background: color-mix(in srgb, var(--ref-accent) 12%, transparent);
  font-size: 0.92rem;
  color: inherit;
}
.ref-banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ref-accent);
  box-shadow: 0 0 10px var(--ref-accent);
  flex: none;
}

.ref-form,
.ref-result {
  display: grid;
  gap: 14px;
}
.ref-field label,
.ref-result > label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ref-muted);
}
.ref-field input,
.ref-link-row input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--ref-bd);
  background: var(--ref-input-bg);
  color: inherit;
  font: inherit;
  font-size: 0.98rem;
}
.ref-field input:focus,
.ref-link-row input:focus {
  outline: 2px solid var(--ref-accent);
  outline-offset: 2px;
}
.ref-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
.ref-actions-2 {
  margin-top: 2px;
}
.ref-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.ref-btn:hover {
  transform: translateY(-1px);
}
.ref-btn-primary {
  background: var(--ref-accent);
  color: #1a1408;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--ref-accent) 35%, transparent);
}
.ref-widget[data-theme="abitante"] .ref-btn-primary,
.ref-widget[data-theme="elisao"] .ref-btn-primary {
  color: #04101f;
}
.ref-widget[data-theme="elisao"] .ref-btn-primary {
  color: #fff;
}
.ref-btn-ghost {
  background: transparent;
  border: 1px solid var(--ref-bd);
  color: inherit;
}
.ref-btn-wa {
  background: #25d366;
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.28);
}
.ref-link-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
@media (max-width: 560px) {
  .ref-link-row {
    grid-template-columns: 1fr;
  }
  .ref-widget {
    padding: 24px 18px;
  }
}
.ref-hint {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--ref-muted);
  line-height: 1.45;
}
.ref-hint em {
  font-style: normal;
  color: var(--ref-accent2);
  font-weight: 600;
}
.ref-preview {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed color-mix(in srgb, var(--ref-accent) 40%, transparent);
  background: color-mix(in srgb, var(--ref-accent) 8%, transparent);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ref-muted);
  word-break: break-word;
}
.ref-error {
  margin: 0;
  color: #ff6b6b;
  font-size: 0.9rem;
  font-weight: 600;
}
.ref-widget.ref-done {
  border-color: color-mix(in srgb, var(--ref-accent) 45%, transparent);
}
.ref-form[hidden],
.ref-result[hidden],
.ref-banner[hidden],
.ref-error[hidden] {
  display: none !important;
}
.ref-result:not([hidden]) {
  display: grid;
}
.ref-form:not([hidden]) {
  display: grid;
}

/* Seção wrapper usada nos sites */
.ref-section {
  padding: 72px 0;
}
.ref-section .ref-section-head {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 28px;
}
.ref-section .ref-section-head .eyebrow,
.ref-section .ref-section-head .tag {
  margin-bottom: 10px;
}

/*
 * Elisão Fiscal: .lede do site é cinza-claro (#C9D6DF) para o hero escuro.
 * Na seção de indicação (fundo paper) isso fica ilegível — forçamos contraste.
 */
#indicar.ref-section {
  background: #f5f8f9 !important;
  color: #0b1b26;
}
#indicar.ref-section h2 {
  color: #0a2540 !important;
}
#indicar.ref-section .lede,
#indicar.ref-section p.lede {
  color: #3d4f5c !important;
}
#indicar.ref-section .eyebrow {
  color: #149063 !important;
}
#indicar.ref-section .lede strong {
  color: #0a2540 !important;
}
#indicar.ref-section code {
  color: #0a2540;
  background: #e8eef2;
  padding: 0.12em 0.4em;
  border-radius: 4px;
}
