/* ─────────────────────────────────────────────────────────────────────────
   NGC Calculator Engine — generic styles for any blog calculator widget.

   Used by every calculator the article writer emits via the `calculator`
   field. One stylesheet, one engine — the spec drives field/result/callout
   rendering. Class prefix: .ngc-calc / .ngc-calc__*.

   Brand: deep-ocean navy → coastal teal gradient header, white logo via
   filter:invert, clean two-column body collapsing to one column under
   720px, soft cyan/green status callouts.
   ─────────────────────────────────────────────────────────────────────── */

.ngc-calc {
  /* Calculator chrome — NGC brand navy (per design call) */
  --gc-navy:      #19325B;   /* brand navy — header gradient start */
  --gc-teal:      #2563eb;   /* royal blue 600 — header gradient end + accents (var name kept for back-compat) */
  --gc-cyan:      #93c5fd;   /* blue 300 — soft accent */
  --gc-cyan-soft: #eff6ff;   /* blue 50  — info callout / pill background */
  --gc-cyan-line: #bfdbfe;   /* blue 200 — info callout border */

  --gc-border:    #e2e8f0;
  --gc-border-2:  #cbd5e1;
  --gc-bg:        #ffffff;
  --gc-bg-alt:    #f8fafc;
  --gc-bg-band:   #f1f5f9;
  --gc-text:      #0f172a;
  --gc-muted:     #64748b;
  --gc-muted-2:   #475569;

  --gc-success:   #15803d;
  --gc-success-bg:#f0fdf4;
  --gc-success-bd:#bbf7d0;

  --gc-shadow:    0 1px 2px rgba(15, 23, 42, 0.04),
                  0 8px 24px rgba(15, 23, 42, 0.07),
                  0 24px 48px rgba(30, 58, 138, 0.10);

  margin: 0 0 36px;
  padding: 0;
  background: var(--gc-bg);
  border: 1px solid var(--gc-border);
  border-radius: 16px;
  box-shadow: var(--gc-shadow);
  overflow: hidden;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  color: var(--gc-text);
  position: relative;
}

/* ── Header (2-column: content | logo) ─────────────────────────────── */
.ngc-calc__head {
  position: relative;
  padding: 10px 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(147, 197, 253, 0.32), transparent 55%),
    linear-gradient(135deg, var(--gc-navy) 0%, var(--gc-teal) 100%);
  color: #fff;
  overflow: hidden;
  display: flex;
  align-items: stretch;     /* both columns fill the row height */
  gap: 22px;
  min-height: 88px;          /* fall-back if content is short */
}
.ngc-calc__head::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, transparent 65%);
  pointer-events: none;
}

.ngc-calc__head-content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.ngc-calc__brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;       /* center vertically within stretched row */
  justify-content: center;
  text-decoration: none;
  /* Render the colored NGC logo white over the dark gradient. */
  filter: brightness(0) invert(1);
  opacity: 0.96;
  transition: opacity 150ms ease;
  position: relative;
  z-index: 1;
}
.ngc-calc__brand:hover { opacity: 1; }
.ngc-calc__brand img {
  display: block;
  height: auto;
  max-height: 110px;         /* desktop ceiling — matches a 2-3 line text block */
  width: auto;
  max-width: 220px;
}
@media (max-width: 720px) {
  .ngc-calc__head { gap: 14px; padding: 10px 18px; min-height: 72px; }
  .ngc-calc__brand img { max-height: 72px; max-width: 140px; }
}

.ngc-calc__eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.85;
  margin: 0 0 6px;
}

.ngc-calc__title {
  /* !important to override blog .prose h2 base styles */
  margin: 0 !important;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: #fff !important;
}

.ngc-calc__sub {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.92;
  max-width: 64ch;
}

/* ── Body grid ──────────────────────────────────────────────────────── */
.ngc-calc__body {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 0;
}
@media (max-width: 720px) {
  .ngc-calc__body { grid-template-columns: 1fr; }
}

.ngc-calc__inputs {
  padding: 24px 28px 26px;
  border-right: 1px solid var(--gc-border);
}
@media (max-width: 720px) {
  .ngc-calc__inputs {
    border-right: 0;
    border-bottom: 1px solid var(--gc-border);
    padding: 22px 22px 24px;
  }
}

.ngc-calc__field { margin-bottom: 18px; }
.ngc-calc__field:last-child { margin-bottom: 0; }

.ngc-calc__label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gc-muted-2);
  margin-bottom: 7px;
}
.ngc-calc__label-optional {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  font-size: 11px;
  color: var(--gc-muted);
  margin-left: 6px;
}

.ngc-calc__select,
.ngc-calc__input {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--gc-bg);
  border: 1px solid var(--gc-border-2);
  border-radius: 10px;
  padding: 11px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--gc-text);
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.ngc-calc__select:hover,
.ngc-calc__input:hover { border-color: #94a3b8; }
.ngc-calc__select:focus,
.ngc-calc__input:focus {
  outline: 0;
  border-color: var(--gc-teal);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.ngc-calc__select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23475569' d='M6 8 0 1l1.4-1L6 5.2 10.6 0 12 1z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.ngc-calc__money,
.ngc-calc__pct {
  position: relative;
}
.ngc-calc__money::before {
  content: "$";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gc-muted);
  font-weight: 700;
  pointer-events: none;
  font-size: 15px;
}
.ngc-calc__money .ngc-calc__input { padding-left: 26px; }
.ngc-calc__pct::after {
  content: "%";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gc-muted);
  font-weight: 700;
  pointer-events: none;
  font-size: 15px;
}
.ngc-calc__pct .ngc-calc__input { padding-right: 30px; }

.ngc-calc__hint {
  margin: 7px 0 0;
  font-size: 12.5px;
  color: var(--gc-muted);
  line-height: 1.5;
}
.ngc-calc__hint strong { color: var(--gc-text); font-weight: 600; }

.ngc-calc__rate-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  padding: 5px 12px;
  background: var(--gc-cyan-soft);
  border: 1px solid var(--gc-cyan-line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--gc-navy);
  font-weight: 500;
}
.ngc-calc__rate-pill strong { color: var(--gc-navy); font-weight: 700; font-variant-numeric: tabular-nums; }

.ngc-calc__field-notes {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--gc-muted-2);
  line-height: 1.55;
  padding: 10px 12px;
  background: var(--gc-bg-band);
  border-left: 3px solid var(--gc-teal);
  border-radius: 4px 6px 6px 4px;
}
.ngc-calc__field-notes:empty { display: none; }

/* ── Results ────────────────────────────────────────────────────────── */
.ngc-calc__results {
  padding: 24px 28px 26px;
  background: linear-gradient(180deg, var(--gc-bg-alt) 0%, #f5f9fb 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (max-width: 720px) {
  .ngc-calc__results { padding: 22px 22px 24px; }
}

.ngc-calc__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--gc-border);
  font-size: 14.5px;
}
.ngc-calc__row:last-of-type { border-bottom: 0; }
.ngc-calc__row[hidden] { display: none; }

.ngc-calc__row-label { color: var(--gc-muted-2); }
.ngc-calc__row-value {
  font-weight: 600;
  color: var(--gc-text);
  font-variant-numeric: tabular-nums;
}

.ngc-calc__row--highlight {
  margin-top: 12px;
  padding-top: 16px;
  border-top: 2px solid var(--gc-teal);
  border-bottom: 0;
}
.ngc-calc__row--highlight .ngc-calc__row-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gc-navy);
}
.ngc-calc__row--highlight .ngc-calc__row-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--gc-navy);
  letter-spacing: -0.015em;
}

.ngc-calc__callout {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
}
.ngc-calc__callout[hidden] { display: none; }
.ngc-calc__callout--info {
  background: var(--gc-cyan-soft);
  border: 1px solid var(--gc-cyan-line);
  color: var(--gc-navy);
}
.ngc-calc__callout--info strong { color: var(--gc-navy); font-weight: 700; }
.ngc-calc__callout--success {
  background: var(--gc-success-bg);
  border: 1px solid var(--gc-success-bd);
  color: var(--gc-success);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.ngc-calc__callout--success::before {
  content: "✓";
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  color: var(--gc-success);
  flex-shrink: 0;
}
.ngc-calc__callout--success strong { color: var(--gc-success); font-weight: 700; }

/* ── Footer ─────────────────────────────────────────────────────────── */
.ngc-calc__foot {
  padding: 14px 28px;
  background: var(--gc-bg-band);
  border-top: 1px solid var(--gc-border);
  font-size: 12px;
  color: var(--gc-muted);
  line-height: 1.55;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .ngc-calc__foot { padding: 14px 22px; }
}

.ngc-calc__disclaimer { flex: 1 1 280px; min-width: 0; }

.ngc-calc__credit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gc-navy);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 120ms ease;
}
.ngc-calc__credit:hover { opacity: 0.75; }
.ngc-calc__credit img { width: 18px; height: 18px; display: block; }

/* ── Noscript fallback ─────────────────────────────────────────────── */
.ngc-calc__noscript {
  margin: 0;
  padding: 12px 28px;
  background: #fff7ed;
  border-top: 1px solid #fed7aa;
  font-size: 12.5px;
  color: #9a3412;
  text-align: center;
}
@media (max-width: 720px) {
  .ngc-calc__noscript { padding: 12px 22px; }
}
