/* =========================================================
   THAIGUIDE - MODULE BUDGET
   Fichier conseillé : /assets/css/thaiguide-budget-module.css
   ========================================================= */

.tg-budget-module{
  position: relative;
  overflow: hidden;
}

.tg-budget-module::before{
  content: "";
  display: block;
  width: 68px;
  height: 4px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, #eab308 0%, #f59e0b 100%);
  opacity: .9;
}

.tg-budget-head{
  margin-bottom: 22px;
}

.tg-budget-head h3{
  margin-bottom: 10px;
  color: var(--text);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.25;
}

.tg-budget-intro{
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 72ch;
}

.tg-budget-layout{
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, .88fr);
  gap: 24px;
  align-items: center;
}

.tg-budget-controls,
.tg-budget-visual-wrap{
  min-width: 0;
}

.tg-budget-controls{
  background: linear-gradient(180deg, rgba(255,255,255,.72) 0%, rgba(255,255,255,.92) 100%);
  border: 1px solid rgba(146, 64, 14, .10);
  border-radius: 18px;
  padding: 22px 20px;
  box-shadow: 0 10px 24px rgba(0,0,0,.04);
}

.tg-budget-label{
  display: block;
  margin-bottom: 14px;
  font-size: .98rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

.tg-budget-range{
  width: 100%;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}

.tg-budget-range:focus{
  outline: none;
}

.tg-budget-range::-webkit-slider-runnable-track{
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 35%, #34d399 68%, #0f766e 100%);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .06);
}

.tg-budget-range::-moz-range-track{
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 35%, #34d399 68%, #0f766e 100%);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .06);
}

.tg-budget-range::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 6px 18px rgba(15, 118, 110, .28);
  cursor: pointer;
}

.tg-budget-range::-moz-range-thumb{
  width: 24px;
  height: 24px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 6px 18px rgba(15, 118, 110, .28);
  cursor: pointer;
}

.tg-budget-range:focus::-webkit-slider-thumb{
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .16), 0 6px 18px rgba(15, 118, 110, .28);
}

.tg-budget-range:focus::-moz-range-thumb{
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .16), 0 6px 18px rgba(15, 118, 110, .28);
}

.tg-budget-values{
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  font-size: .92rem;
  color: var(--muted);
}

.tg-budget-values strong{
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.tg-budget-help{
  margin: 16px 0 0;
  color: var(--muted);
  font-size: .94rem;
  line-height: 1.65;
}

.tg-budget-actions{
  margin-top: 18px;
}

.tg-budget-actions .btn{
  min-width: 240px;
}

.tg-budget-visual-wrap{
  display: grid;
  gap: 18px;
  justify-items: center;
}

.tg-budget-ring{
  --tg-ring-color: #cbd5e1;
  --tg-ring-bg: #eef2f7;
  width: clamp(220px, 26vw, 280px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(circle at center, #ffffff 0 55%, transparent 56%),
    conic-gradient(var(--tg-ring-color) 0 300deg, var(--tg-ring-bg) 300deg 360deg);
  box-shadow:
    inset 0 0 0 10px rgba(255,255,255,.55),
    0 18px 36px rgba(15, 23, 42, .08);
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

.tg-budget-ring:hover{
  transform: translateY(-1px);
}

.tg-budget-ring-inner{
  width: 66%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fffdf7 100%);
  border: 1px solid rgba(15, 23, 42, .06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

.tg-budget-ring-amount{
  display: block;
  color: var(--text);
  font-size: clamp(1.35rem, 3.2vw, 1.9rem);
  font-weight: 800;
  line-height: 1.05;
}

.tg-budget-ring-label{
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.2;
}

.tg-budget-ring--neutral{
  --tg-ring-color: #cbd5e1;
  --tg-ring-bg: #edf2f7;
}

.tg-budget-ring--tight{
  --tg-ring-color: #ef4444;
  --tg-ring-bg: #fee2e2;
}

.tg-budget-ring--possible{
  --tg-ring-color: #f59e0b;
  --tg-ring-bg: #fef3c7;
}

.tg-budget-ring--coherent{
  --tg-ring-color: #10b981;
  --tg-ring-bg: #d1fae5;
}

.tg-budget-ring--comfort{
  --tg-ring-color: #0f766e;
  --tg-ring-bg: #ccfbf1;
}

.tg-budget-result{
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.tg-budget-status{
  margin: 0 0 8px;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.3;
}

.tg-budget-message{
  margin: 0;
  color: var(--muted);
  font-size: .98rem;
  line-height: 1.7;
}

.tg-budget-legend{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.tg-budget-legend-item{
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
}

.tg-budget-legend-item.is-tight{
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.tg-budget-legend-item.is-possible{
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}

.tg-budget-legend-item.is-coherent{
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}

.tg-budget-legend-item.is-comfort{
  background: #ccfbf1;
  color: #0f766e;
  border-color: #99f6e4;
}

.tg-budget-note{
  margin-top: 18px;
}

.tg-budget-note strong{
  color: var(--warning-text);
}

/* Etat texte en couleur */

.tg-budget-module[data-budget-state="tight"] .tg-budget-status{
  color: #b91c1c;
}

.tg-budget-module[data-budget-state="possible"] .tg-budget-status{
  color: #b45309;
}

.tg-budget-module[data-budget-state="coherent"] .tg-budget-status{
  color: #15803d;
}

.tg-budget-module[data-budget-state="comfort"] .tg-budget-status{
  color: #0f766e;
}

/* Variante si utilisé hors carte premium */

.tg-budget-module:not(.wplc3-install-card){
  background: linear-gradient(180deg, #fffaf2 0%, #ffffff 100%);
  border: 1px solid rgba(146, 64, 14, .12);
  border-top: 4px solid #eab308;
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}

/* Responsive */

@media (max-width: 980px){
  .tg-budget-layout{
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .tg-budget-visual-wrap{
    justify-items: stretch;
  }

  .tg-budget-result{
    max-width: none;
  }
}

@media (max-width: 768px){
  .tg-budget-module::before{
    margin-bottom: 14px;
  }

  .tg-budget-controls{
    padding: 18px 16px;
  }

  .tg-budget-values{
    grid-template-columns: 1fr;
    text-align: center;
  }

  .tg-budget-values strong{
    order: -1;
  }

  .tg-budget-actions .btn{
    width: 100%;
    min-width: 0;
  }

  .tg-budget-legend{
    gap: 8px;
  }

  .tg-budget-legend-item{
    min-height: 32px;
    font-size: .8rem;
    padding: 6px 10px;
  }
}

@media (max-width: 480px){
  .tg-budget-head h3{
    font-size: 1.1rem;
  }

  .tg-budget-intro,
  .tg-budget-message,
  .tg-budget-help{
    font-size: .94rem;
  }

  .tg-budget-ring{
    width: min(100%, 240px);
  }

  .tg-budget-ring-amount{
    font-size: 1.45rem;
  }
}