/* ============================================
   TBT Real Estate Calculators
   The Business Toolkit — thebusinesstoolkit.com
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Jost:wght@300;400;500&display=swap');

:root {
  --tbt-gold:        #D4AF37;
  --tbt-gold-dim:    rgba(212, 175, 55, 0.15);
  --tbt-gold-line:   rgba(212, 175, 55, 0.4);
  --tbt-bg:          #111010;
  --tbt-surface:     #191714;
  --tbt-border:      #2a2520;
  --tbt-text:        #e8e0d0;
  --tbt-muted:       #6a6050;
  --tbt-result-bg:   #16130f;
  --tbt-radius:      2px;
  --tbt-font-serif:  'Cormorant Garamond', 'Garamond', Georgia, serif;
  --tbt-font-sans:   'Jost', 'Helvetica Neue', sans-serif;
}

/* ---- Wrapper ---- */
.tbt-calc {
  background: var(--tbt-bg);
  border: 1px solid var(--tbt-border);
  padding: 48px 44px;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  font-family: var(--tbt-font-sans);
  font-weight: 300;
  color: var(--tbt-text);
  box-sizing: border-box;
}

.tbt-calc *, .tbt-calc *::before, .tbt-calc *::after {
  box-sizing: border-box;
}

/* Top gold line */
.tbt-calc::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--tbt-gold), transparent);
}

/* Ambient glow */
.tbt-calc::after {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(212,175,55,0.05) 0%, transparent 70%);
  pointer-events: none;
}

/* ---- Header ---- */
.tbt-calc__header {
  margin-bottom: 40px;
}

.tbt-calc__eyebrow {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--tbt-gold);
  margin: 0 0 14px;
  padding: 0;
}

.tbt-calc__title {
  font-family: var(--tbt-font-serif);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 300;
  color: var(--tbt-text);
  line-height: 1.1;
  margin: 0 0 10px;
  padding: 0;
  border: none;
}

.tbt-calc__title em {
  font-style: italic;
  color: var(--tbt-gold);
}

.tbt-calc__desc {
  font-size: 13px;
  color: var(--tbt-muted);
  letter-spacing: 0.04em;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

.tbt-calc__rule {
  width: 40px;
  height: 1px;
  background: var(--tbt-gold);
  opacity: 0.5;
  margin: 24px 0 0;
}

/* ---- Grid ---- */
.tbt-calc__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 40px;
  margin-bottom: 36px;
}

/* ---- Fields ---- */
.tbt-calc__field label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tbt-muted);
  margin-bottom: 10px;
}

.tbt-calc__input-wrap {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--tbt-border);
  transition: border-color 0.2s;
  padding-bottom: 2px;
}

.tbt-calc__input-wrap:focus-within {
  border-color: var(--tbt-gold);
}

.tbt-calc__prefix {
  font-size: 15px;
  color: var(--tbt-muted);
  padding-right: 6px;
  user-select: none;
  line-height: 1;
}

.tbt-calc__suffix {
  font-size: 12px;
  color: var(--tbt-muted);
  padding-left: 4px;
  white-space: nowrap;
}

.tbt-calc__input-wrap input[type="number"],
.tbt-calc__input-wrap select {
  background: transparent;
  border: none;
  color: var(--tbt-text);
  font-family: var(--tbt-font-sans);
  font-size: 20px;
  font-weight: 300;
  width: 100%;
  padding: 6px 0;
  outline: none;
  -moz-appearance: textfield;
  line-height: 1.2;
}

.tbt-calc__input-wrap input[type="number"]::-webkit-outer-spin-button,
.tbt-calc__input-wrap input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.tbt-calc__input-wrap select {
  -webkit-appearance: none;
  cursor: pointer;
}

/* ---- Range Sliders ---- */
.tbt-calc__range {
  -webkit-appearance: none;
  width: 100%;
  height: 1px;
  background: var(--tbt-border);
  outline: none;
  cursor: pointer;
  margin-top: 12px;
  display: block;
}

.tbt-calc__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--tbt-gold);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.tbt-calc__range::-webkit-slider-thumb:hover {
  transform: scale(1.4);
  box-shadow: 0 0 0 4px var(--tbt-gold-dim);
}

.tbt-calc__range::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: none;
  border-radius: 50%;
  background: var(--tbt-gold);
  cursor: pointer;
}

/* ---- Button ---- */
.tbt-calc__btn {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid var(--tbt-gold);
  color: var(--tbt-gold);
  font-family: var(--tbt-font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 17px 24px;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
  margin-bottom: 36px;
  border-radius: var(--tbt-radius);
}

.tbt-calc__btn:hover {
  background: var(--tbt-gold);
  color: #0e0e0e;
}

/* ---- Results Panel ---- */
.tbt-calc__results {
  background: var(--tbt-result-bg);
  border: 1px solid var(--tbt-border);
  padding: 32px 36px;
  display: none;
}

.tbt-calc__results.tbt-visible {
  display: block;
  animation: tbtFadeUp 0.4s ease forwards;
}

@keyframes tbtFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tbt-calc__results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.tbt-calc__result-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tbt-muted);
  margin: 0 0 10px;
  padding: 0;
}

.tbt-calc__result-value {
  font-family: var(--tbt-font-serif);
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 300;
  color: var(--tbt-text);
  line-height: 1;
  margin: 0;
  padding: 0;
}

.tbt-calc__result-value.tbt-gold {
  color: var(--tbt-gold);
}

/* ---- Breakdown Bars ---- */
.tbt-calc__breakdown {
  border-top: 1px solid var(--tbt-border);
  padding-top: 24px;
  margin-bottom: 24px;
}

.tbt-calc__breakdown-title {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tbt-muted);
  margin: 0 0 18px;
  padding: 0;
}

.tbt-calc__bar-wrap {
  margin-bottom: 14px;
}

.tbt-calc__bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--tbt-muted);
  margin-bottom: 7px;
  letter-spacing: 0.03em;
}

.tbt-calc__bar-label span:last-child {
  color: var(--tbt-text);
  font-weight: 400;
}

.tbt-calc__bar-track {
  height: 2px;
  background: var(--tbt-border);
  position: relative;
  overflow: hidden;
}

.tbt-calc__bar-fill {
  height: 100%;
  background: var(--tbt-gold);
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.tbt-calc__bar-fill--dim {
  background: rgba(212, 175, 55, 0.45);
}

.tbt-calc__bar-fill--light {
  background: rgba(212, 175, 55, 0.2);
}

/* ---- DTI Note ---- */
.tbt-calc__dti-note {
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  border-left: 2px solid var(--tbt-gold);
  color: var(--tbt-muted);
  margin-bottom: 20px;
  line-height: 1.6;
  display: none;
}

.tbt-calc__dti-note.tbt-visible {
  display: block;
}

/* ---- Disclaimer ---- */
.tbt-calc__disclaimer {
  font-size: 11px;
  color: var(--tbt-muted);
  line-height: 1.6;
  letter-spacing: 0.03em;
  margin: 0;
  padding: 0;
  opacity: 0.7;
}

/* ---- Credit ---- */
.tbt-calc__credit {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tbt-muted);
  text-align: right;
  margin: 24px 0 0;
  padding: 0;
  opacity: 0.5;
}

.tbt-calc__credit a {
  color: var(--tbt-muted);
  text-decoration: none;
}

.tbt-calc__credit a:hover {
  color: var(--tbt-gold);
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .tbt-calc {
    padding: 32px 24px;
  }

  .tbt-calc__grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .tbt-calc__results-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .tbt-calc__results {
    padding: 24px 20px;
  }
}
