/*
 * Golden Fund Calculators — plugin styles
 *
 * Every rule is scoped to .gf-calc-root so nothing leaks
 * into the host theme.  No Bootstrap is loaded.
 */

/* ── Minimal 12-col float grid ─────────────────────────────── */
.gf-calc-root *,
.gf-calc-root *::before,
.gf-calc-root *::after {
  box-sizing: border-box;
}

.gf-calc-root .row {
  margin-right: -15px;
  margin-left: -15px;
}
.gf-calc-root .row::after {
  content: "";
  display: table;
  clear: both;
}
.gf-calc-root .row + .row {
  margin-top: 10px;
}

/* all col-* are full-width on small screens */
.gf-calc-root [class*="col-"] {
  position: relative;
  padding-right: 15px;
  padding-left: 15px;
  float: left;
  width: 100%;
}

@media (min-width: 768px) {
  .gf-calc-root {
    max-width: 100%;
  }

  .gf-calc-root .col-sm-9 {
    width: 75%;
  }
  .gf-calc-root .col-md-3 {
    width: 25%;
  }
  .gf-calc-root .col-md-4 {
    width: 33.3333%;
  }
  .gf-calc-root .col-md-6 {
    width: 50%;
  }
  .gf-calc-root .col-md-10 {
    width: 83.3333%;
  }
  .gf-calc-root .col-md-12 {
    width: 100%;
  }

  .gf-calc-root .col-md-offset-1 {
    margin-left: 8.3333%;
  }
  .gf-calc-root .col-md-offset-4 {
    margin-left: 33.3333%;
  }
  .gf-calc-root .col-md-offset-6 {
    margin-left: 50%;
  }
}

@media (min-width: 992px) {
  .gf-calc-root {
    max-width: 70%;
  }
}

/* ── Form controls ─────────────────────────────────────────── */

.gf-calc-root .form-control {
  display: block;
  width: 100%;
  padding: 6px 10px;
  font-size: 14px;
  line-height: 1.5;
  color: inherit;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.gf-calc-root .form-control:focus {
  outline: none;
  border-color: #66afe9;
  box-shadow:
    inset 0 1px 1px rgba(0, 0, 0, 0.075),
    0 0 6px rgba(102, 175, 233, 0.6);
}

/* ── Input group ($ prefix) ────────────────────────────────── */

.gf-calc-root .input-group {
  display: flex;
  align-items: stretch;
  width: 100%;
}
.gf-calc-root .input-group .form-control {
  flex: 1;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.gf-calc-root .input-group-addon {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  font-size: 14px;
  color: #555;
  background-color: #eee;
  border: 1px solid #ccc;
  border-right: none;
  border-radius: 4px 0 0 4px;
  white-space: nowrap;
}

/* ── Calculate button ──────────────────────────────────────── */

.gf-calc-root .btn {
  display: inline-block;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 4px;
  text-decoration: none;
}
.gf-calc-root .btn-primary {
  color: #fff;
  background-color: #b2a97e;
  border-color: #9b9370;
}
.gf-calc-root .btn-primary:hover,
.gf-calc-root .btn-primary:focus {
  color: #fff;
  background-color: #9b9370;
  border-color: #857e60;
  text-decoration: none;
}

/* ── Section spacing ───────────────────────────────────────── */

.gf-calc-root .ret-calc-top-section {
  padding-bottom: 20px;
  margin-bottom: 20px;
}
.gf-calc-root .results-section {
  margin-top: 30px;
}

/* ── Field label ───────────────────────────────────────────── */

.gf-calc-root .ret-calc-field-label {
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.4;
}

/* ── Chart title ───────────────────────────────────────────── */

.gf-calc-root .ret-calc-chart-title {
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  margin-bottom: 12px;
  color: #0f7bb6;
  text-transform: uppercase;
}

/* ── Pie chart container ───────────────────────────────────── */

.gf-calc-root .ret-calc-pie-chart {
  width: 100%;
  margin: 10px 0 0;
  /* allow d3pie labels that extend slightly past the SVG canvas to show */
  overflow: visible;
}
.gf-calc-root .ret-calc-pie-chart svg {
  display: block;
  /* SVG defaults to overflow:hidden which clips outer labels — fix that */
  overflow: visible !important;
  /* never scale the SVG with CSS: d3pie places labels at absolute coords,
     CSS scaling shrinks the canvas but leaves labels at wrong positions  */
}

/* ── Big dollar display (balloon numbers) ──────────────────── */

.gf-calc-root .per-paycheck-amt,
.gf-calc-root .tax-credits-total {
  font-size: clamp(38px, 8vw, 60px);
  font-weight: 800;
  color: #b2a97e;
  line-height: 1.1;
  text-align: center;
}
.gf-calc-root .per-paycheck-extra,
.gf-calc-root .tax-credits-msg {
  color: #b2a97e;
  font-size: clamp(15px, 3vw, 20px);
  line-height: 1.3;
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* ── Optional message box ──────────────────────────────────── */

.gf-calc-root .ret-calc-msg-box {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 15px;
}

/* ── Validation message ──────────────────────────────────────  */

.gf-calc-root .gf-calc-validation {
  display: none;
  margin-top: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: #922;
  background-color: #fff5f5;
  border-left: 3px solid #c0392b;
  border-radius: 0 4px 4px 0;
}
.gf-calc-root .gf-calc-validation.is-visible {
  display: block;
}

/* ── Mobile overrides ──────────────────────────────────────── */

@media (max-width: 767px) {
  .gf-calc-root {
    max-width: 100%;
  }

  .gf-calc-root [class*="col-"] {
    float: none;
    width: 100% !important;
    margin-left: 0 !important;
  }

  .gf-calc-root .col-md-3 {
    margin-top: 25px;
  }

  .gf-calc-root .per-paycheck-extra,
  .gf-calc-root .tax-credits-msg {
    margin-top: 15px;
  }

  .gf-calc-root .btn {
    width: 100%;
    margin-top: 10px;
  }

  .gf-calc-root .ret-calc-field-label {
    margin-top: 10px;
    margin-bottom: 4px;
  }
}
