﻿/* ============================================================
   DIVALORE BUSINESS — READABILITY SYSTEM
   Fase 10C.4
   Objetivo: nenhuma letra apagada, nenhum texto invisível.
   ============================================================ */

:root {
  --dv-font-main: Inter, "Segoe UI", Roboto, Arial, sans-serif;

  --dv-dark-950: #070604;
  --dv-dark-900: #0d0b08;
  --dv-dark-850: #15100b;
  --dv-dark-800: #1e170f;

  --dv-light-50: #fffdf8;
  --dv-light-100: #f8f4ea;
  --dv-light-150: #f2eadc;
  --dv-light-200: #e8dcc8;

  --dv-text-dark: #17130d;
  --dv-text-medium: #3f3628;
  --dv-text-muted: #665b49;

  --dv-text-light: #fffaf0;
  --dv-text-light-soft: #f3e7cf;
  --dv-text-light-muted: #d8c8aa;

  --dv-gold: #d5a94f;
  --dv-gold-strong: #f0c96a;
  --dv-gold-dark: #8a641f;

  --dv-danger: #8a1f1f;
  --dv-success: #145c3a;

  --dv-radius-sm: 12px;
  --dv-radius-md: 18px;
  --dv-radius-lg: 26px;
  --dv-radius-xl: 34px;

  --dv-shadow-soft: 0 18px 55px rgba(10, 8, 4, .12);
  --dv-shadow-dark: 0 26px 80px rgba(0, 0, 0, .38);

  --dv-container: 1180px;
}

/* Base */
html {
  font-size: 16px;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--dv-font-main);
  color: var(--dv-text-dark);
  background: var(--dv-light-100);
  line-height: 1.62;
  overflow-x: hidden;
}

/* Evita texto cortado por line-clamp e alturas agressivas */
h1, h2, h3, h4, h5, h6,
p, li, span, small, strong, em,
label, a, button, input, select, textarea {
  max-height: none !important;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: normal;
  text-wrap: pretty;
  text-shadow: none;
  letter-spacing: normal;
}

/* Remove clamps que escondem conteúdo */
* {
  -webkit-line-clamp: unset !important;
}

/* Tipografia responsiva */
h1 {
  font-size: clamp(2.25rem, 5vw, 4.85rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  margin-bottom: .85rem;
}

h3 {
  font-size: clamp(1.25rem, 1.8vw, 1.75rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
  margin-bottom: .65rem;
}

p, li, label, input, select, textarea {
  font-size: clamp(1rem, .35vw + .92rem, 1.075rem);
}

small, .small {
  font-size: .88rem;
  line-height: 1.5;
}

/* Classes aplicadas pelo JS conforme fundo */
.dv-bg-dark {
  color: var(--dv-text-light) !important;
}

.dv-bg-dark :where(h1, h2, h3, h4, h5, h6) {
  color: var(--dv-text-light) !important;
}

.dv-bg-dark :where(p, li, span, small, label, dd, dt) {
  color: var(--dv-text-light-soft) !important;
}

.dv-bg-dark :where(a:not(.dv-btn):not(.btn):not([class*="button"])) {
  color: var(--dv-gold-strong) !important;
}

.dv-bg-light {
  color: var(--dv-text-dark) !important;
}

.dv-bg-light :where(h1, h2, h3, h4, h5, h6) {
  color: var(--dv-text-dark) !important;
}

.dv-bg-light :where(p, li, span, small, label, dd, dt) {
  color: var(--dv-text-medium) !important;
}

.dv-bg-light :where(a:not(.dv-btn):not(.btn):not([class*="button"])) {
  color: var(--dv-gold-dark) !important;
}

/* Força texto corrigido quando JS detectar baixo contraste */
.dv-force-light,
.dv-force-light *:not(input):not(select):not(textarea):not(option) {
  color: var(--dv-text-light) !important;
}

.dv-force-dark,
.dv-force-dark *:not(input):not(select):not(textarea):not(option) {
  color: var(--dv-text-dark) !important;
}

.dv-low-contrast-fixed {
  outline: 0 !important;
}

/* Containers e seções */
main, section, article, aside, header, footer, nav {
  position: relative;
}

section,
.dv-section,
[class*="section"],
[class*="bloco"],
[class*="area"] {
  isolation: isolate;
}

/* Impede overlay/pseudo-elemento de cobrir texto */
section > *,
article > *,
header > *,
footer > *,
[class*="hero"] > *,
[class*="card"] > *,
[class*="panel"] > *,
[class*="box"] > * {
  position: relative;
  z-index: 2;
}

[class*="overlay"],
[class*="gradient"],
[class*="backdrop"],
[class*="shade"] {
  pointer-events: none;
}

/* Cards */
.card,
.dv-card,
.product-card,
.tool-card,
[class*="card"],
[class*="panel"],
[class*="box"] {
  min-height: auto;
  border-radius: var(--dv-radius-lg);
}

.dv-bg-light.card,
.dv-bg-light.dv-card,
.dv-bg-light.product-card,
.dv-bg-light.tool-card,
.dv-bg-light[class*="card"],
.dv-bg-light[class*="panel"],
.dv-bg-light[class*="box"] {
  background: rgba(255, 253, 248, .96) !important;
  border: 1px solid rgba(80, 62, 32, .14);
  box-shadow: var(--dv-shadow-soft);
}

.dv-bg-dark.card,
.dv-bg-dark.dv-card,
.dv-bg-dark.product-card,
.dv-bg-dark.tool-card,
.dv-bg-dark[class*="card"],
.dv-bg-dark[class*="panel"],
.dv-bg-dark[class*="box"] {
  background: linear-gradient(145deg, rgba(22, 17, 11, .96), rgba(9, 7, 4, .98)) !important;
  border: 1px solid rgba(213, 169, 79, .22);
  box-shadow: var(--dv-shadow-dark);
}

/* Botões: tamanho, contraste e toque */
a.btn,
button,
.btn,
.dv-btn,
[role="button"],
input[type="submit"],
input[type="button"],
a[class*="btn"],
a[class*="button"],
button[class*="btn"],
button[class*="button"] {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 46px;
  min-width: 44px;
  padding: .82rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 750;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}

a.btn:hover,
button:hover,
.btn:hover,
.dv-btn:hover,
[role="button"]:hover,
input[type="submit"]:hover,
a[class*="btn"]:hover,
a[class*="button"]:hover {
  transform: translateY(-1px);
}

a.btn:focus-visible,
button:focus-visible,
.btn:focus-visible,
.dv-btn:focus-visible,
[role="button"]:focus-visible,
input[type="submit"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(240, 201, 106, .75);
  outline-offset: 3px;
}

/* Botão principal */
.btn-primary,
.dv-btn-primary,
a[class*="primary"],
button[class*="primary"],
input[type="submit"] {
  background: linear-gradient(135deg, #f0c96a, #b8892e) !important;
  color: #130f08 !important;
  border-color: rgba(255, 255, 255, .14) !important;
  box-shadow: 0 16px 38px rgba(159, 110, 30, .28);
}

/* Botão secundário em fundo escuro */
.dv-bg-dark .btn-secondary,
.dv-bg-dark a[class*="secondary"],
.dv-bg-dark a[class*="outline"],
.dv-bg-dark .btn-outline {
  background: rgba(255, 255, 255, .07) !important;
  color: var(--dv-text-light) !important;
  border-color: rgba(255, 255, 255, .22) !important;
}

/* Botão secundário em fundo claro */
.dv-bg-light .btn-secondary,
.dv-bg-light a[class*="secondary"],
.dv-bg-light a[class*="outline"],
.dv-bg-light .btn-outline {
  background: #ffffff !important;
  color: var(--dv-text-dark) !important;
  border-color: rgba(80, 62, 32, .22) !important;
}

/* Inputs e formulários sempre legíveis */
input,
select,
textarea {
  width: 100%;
  color: var(--dv-text-dark) !important;
  background: #fffdf8 !important;
  border: 1px solid rgba(80, 62, 32, .24) !important;
  border-radius: 14px;
  min-height: 46px;
  padding: .82rem .95rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

input::placeholder,
textarea::placeholder {
  color: #7a6d59 !important;
  opacity: 1;
}

select option {
  color: var(--dv-text-dark);
  background: #ffffff;
}

/* Badges e tags */
.badge,
.tag,
.pill,
[class*="badge"],
[class*="tag"],
[class*="pill"] {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: .32rem .72rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.15;
}

.dv-bg-dark .badge,
.dv-bg-dark .tag,
.dv-bg-dark .pill,
.dv-bg-dark [class*="badge"],
.dv-bg-dark [class*="tag"],
.dv-bg-dark [class*="pill"] {
  color: #fff8e7 !important;
  background: rgba(240, 201, 106, .14) !important;
  border: 1px solid rgba(240, 201, 106, .28);
}

.dv-bg-light .badge,
.dv-bg-light .tag,
.dv-bg-light .pill,
.dv-bg-light [class*="badge"],
.dv-bg-light [class*="tag"],
.dv-bg-light [class*="pill"] {
  color: #3d2b09 !important;
  background: rgba(213, 169, 79, .18) !important;
  border: 1px solid rgba(138, 100, 31, .18);
}

/* Header e navegação */
header,
.site-header,
.dv-header,
nav {
  z-index: 50;
}

header a,
nav a {
  text-decoration: none;
}

/* Rodapé */
footer {
  background: #090704 !important;
  color: var(--dv-text-light) !important;
}

footer :where(h1,h2,h3,h4,h5,h6,p,li,span,small,a) {
  color: var(--dv-text-light-soft) !important;
}

footer a {
  color: var(--dv-gold-strong) !important;
}

/* Tabelas */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  color: inherit;
  padding: .85rem;
  border-bottom: 1px solid rgba(127, 105, 62, .18);
  vertical-align: top;
}

/* Imagens não podem esmagar texto */
img, picture, video, svg {
  max-width: 100%;
  height: auto;
}

/* Espaçamento geral melhorado */
main > section,
section.dv-section,
section[class*="section"] {
  padding-top: clamp(2.4rem, 6vw, 5.4rem);
  padding-bottom: clamp(2.4rem, 6vw, 5.4rem);
}

/* Mobile */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: clamp(2rem, 11vw, 3.15rem);
    line-height: 1.05;
  }

  h2 {
    font-size: clamp(1.55rem, 7vw, 2.35rem);
  }

  a.btn,
  button,
  .btn,
  .dv-btn,
  [role="button"],
  input[type="submit"],
  a[class*="btn"],
  a[class*="button"] {
    width: 100%;
    min-height: 48px;
  }

  nav,
  header {
    overflow: visible;
  }
}
