/*
  Secure Supplies Group — Fuel Intelligence calculators.
  Scoped under .ssg-calculators so the dashboard cannot collide with site-wide
  styles. Inherits the palette, radii, shadows and Inter type stack from
  assets/css/styles.css and falls back to literal values if used standalone.
*/
.ssg-calculators {
  --ssg-navy: var(--navy, #062d61);
  --ssg-navy-2: var(--navy-2, #073f86);
  --ssg-navy-3: var(--navy-3, #0c5fb4);
  --ssg-line: rgba(255, 255, 255, .14);
  --ssg-line-strong: rgba(140, 190, 250, .30);
  --ssg-sky: #7fb6f5;
  --ssg-dim: #b9cfe9;
  --ssg-dim-2: #a9c4e2;
  --ssg-radius: calc(var(--radius, 22px) + 6px);
  --ssg-radius-card: 20px;

  position: relative;
  isolation: isolate;
  overflow: clip;
  padding: 40px;
  border-radius: var(--ssg-radius);
  color: #fff;
  background:
    radial-gradient(circle at 88% 8%, rgba(36, 119, 212, .30), transparent 38%),
    radial-gradient(circle at 4% 92%, rgba(12, 95, 180, .22), transparent 42%),
    linear-gradient(135deg, #071225 0%, #0a336d 62%, #03070d 100%);
  box-shadow: var(--shadow, 0 22px 55px rgba(7, 20, 44, .16));
}
.ssg-calculators::after {
  content: "";
  position: absolute;
  right: -130px;
  top: -110px;
  width: 420px;
  height: 420px;
  border: 60px solid rgba(255, 255, 255, .05);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

/* ---------- shared type ---------- */
.ssg-calculators .ssg-kicker {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
  color: var(--ssg-sky);
  font-size: .76rem;
  letter-spacing: .14em;
  font-weight: 800;
  text-transform: uppercase;
}
.ssg-calculators .ssg-kicker::before {
  content: "";
  width: 26px;
  height: 2px;
  background: currentColor;
  border-radius: 4px;
}
.ssg-calculators h1 {
  margin: 0 0 14px;
  font-size: clamp(1.95rem, 4.4vw, 3.45rem);
  line-height: 1.04;
  letter-spacing: -.035em;
  color: #fff;
}
.ssg-calculators h2 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2.6vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: -.03em;
  color: #fff;
}
.ssg-calculators h3 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: -.01em;
  color: var(--ssg-navy);
}
.ssg-calculators .ssg-lede {
  margin: 0;
  max-width: 620px;
  color: #d7e6f9;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
}

/* ---------- hero ---------- */
.ssg-calculators .ssg-calc-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--ssg-line);
}
.ssg-calculators .ssg-calc-hero > div { min-width: 0; }
.ssg-calculators .ssg-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- buttons ---------- */
.ssg-calculators .ssg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 850;
  font-size: .92rem;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.ssg-calculators .ssg-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft, 0 14px 34px rgba(7, 20, 44, .10));
}
.ssg-calculators .ssg-btn-primary { background: linear-gradient(135deg, var(--ssg-navy-3) 0%, #2b8cf0 100%); color: #fff; }
.ssg-calculators .ssg-btn-outline { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .35); color: #fff; }
.ssg-calculators .ssg-btn-white { background: #fff; color: var(--ssg-navy); justify-self: start; }
.ssg-calculators .ssg-btn-muted {
  background: #eef4fb;
  border-color: #cbd9ea;
  color: var(--ssg-navy);
  justify-self: start;
}

/* ---------- tabs ---------- */
.ssg-calculators .ssg-calc-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 26px 0;
  padding: 10px;
  border: 1px solid var(--ssg-line);
  border-radius: var(--ssg-radius-card);
  background: rgba(255, 255, 255, .05);
}
.ssg-calculators .ssg-tab {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  color: #d7e6f9;
  font-weight: 800;
  font-size: .9rem;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.ssg-calculators .ssg-tab:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.ssg-calculators .ssg-tab.is-active {
  background: #fff;
  border-color: #fff;
  color: var(--ssg-navy);
  box-shadow: 0 10px 26px rgba(3, 12, 28, .35);
}

/* ---------- panels ---------- */
.ssg-calculators .ssg-calc-panel { display: none; }
.ssg-calculators .ssg-calc-panel.is-active { display: grid; gap: 22px; }
.ssg-calculators .ssg-calc-heading { display: flex; align-items: flex-start; gap: 16px; }
.ssg-calculators .ssg-calc-heading > div { min-width: 0; }
.ssg-calculators .ssg-calc-heading p:last-child { margin: 0; color: var(--ssg-dim); font-size: .96rem; }
.ssg-calculators .ssg-step {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 16px;
  background: rgba(255, 255, 255, .07);
  color: var(--ssg-sky);
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: .04em;
}
.ssg-calculators .ssg-calc-layout, .ssg-calculators .ssg-ghg-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

/* ---------- input cards ---------- */
.ssg-calculators .ssg-input-card {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
  padding: 22px;
  border: 1px solid #cbd9ea;
  border-radius: var(--ssg-radius-card);
  background: #fff;
  color: var(--ink, #111827);
  box-shadow: var(--shadow, 0 22px 55px rgba(7, 20, 44, .16));
}
.ssg-calculators .ssg-field { display: grid; gap: 6px; min-width: 0; }
.ssg-calculators .ssg-field > span {
  font-weight: 800;
  font-size: .82rem;
  color: #263142;
}
.ssg-calculators .ssg-field input, .ssg-calculators .ssg-field select {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #cbd8e8;
  border-radius: 12px;
  background: #fff;
  color: #172337;
  font-size: .95rem;
}
.ssg-calculators .ssg-field input:focus,
.ssg-calculators .ssg-field select:focus {
  outline: 3px solid rgba(12, 95, 180, .18);
  border-color: var(--ssg-navy-3);
}
.ssg-calculators .ssg-field input[aria-invalid="true"] {
  border-color: #b42318;
  background: #fff6f5;
}
.ssg-calculators .ssg-assumptions {
  display: grid;
  gap: 4px;
  padding: 13px 15px;
  border: 1px dashed #c6d9ee;
  border-radius: 14px;
  background: #f2f7fd;
  color: #45536a;
  font-size: .83rem;
}
.ssg-calculators .ssg-assumptions strong {
  color: var(--ssg-navy);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* ---------- output cards ---------- */
.ssg-calculators .ssg-output-card {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--ssg-line-strong);
  border-radius: var(--ssg-radius-card);
  background: linear-gradient(150deg, rgba(12, 95, 180, .24) 0%, rgba(255, 255, 255, .04) 100%);
}
.ssg-calculators .ssg-output-blue {
  border-color: rgba(255, 255, 255, .2);
  background: linear-gradient(140deg, var(--ssg-navy-3) 0%, #062d61 70%, #03080f 100%);
}
.ssg-calculators .ssg-result-label {
  margin: 0;
  color: var(--ssg-sky);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.ssg-calculators .ssg-output-divider { height: 1px; background: var(--ssg-line); }
.ssg-calculators .ssg-stat-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.ssg-calculators .ssg-stat-row span { color: var(--ssg-dim-2); font-weight: 750; font-size: .87rem; }
.ssg-calculators .ssg-stat-row strong {
  color: #fff;
  font-size: 1.06rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.ssg-calculators .ssg-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px;
}
.ssg-calculators .ssg-result-grid > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  background: rgba(255, 255, 255, .07);
}
.ssg-calculators .ssg-result-grid > div span { color: var(--ssg-dim-2); font-weight: 750; font-size: .78rem; }
.ssg-calculators .ssg-result-grid > div strong {
  color: #fff;
  font-size: clamp(1.1rem, 2.2vw, 1.55rem);
  line-height: 1.15;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.ssg-calculators .ssg-big-result {
  display: grid;
  gap: 4px;
  padding: 15px 16px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 16px;
  background: rgba(255, 255, 255, .09);
}
.ssg-calculators .ssg-big-result span { color: #d7e6f9; font-weight: 750; font-size: .84rem; }
.ssg-calculators .ssg-big-result strong {
  color: #fff;
  font-size: clamp(1.5rem, 3.4vw, 2.15rem);
  line-height: 1.1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.ssg-calculators .ssg-hero-number { display: grid; gap: 6px; }
.ssg-calculators .ssg-hero-number strong {
  color: #fff;
  font-size: clamp(2rem, 6.4vw, 3.2rem);
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.ssg-calculators .ssg-hero-number span { color: #d7e6f9; font-weight: 800; font-size: 1rem; }
.ssg-calculators .ssg-ghg-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.ssg-calculators .ssg-ghg-results > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
}
.ssg-calculators .ssg-ghg-results > div span { color: var(--ssg-dim-2); font-weight: 750; font-size: .74rem; }
.ssg-calculators .ssg-ghg-results > div strong {
  color: #fff;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.ssg-calculators .ssg-note { margin: 0; color: #9fbada; font-size: .8rem; line-height: 1.5; }

/* ---------- footer band ---------- */
.ssg-calculators .ssg-calc-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--ssg-line);
}
.ssg-calculators .ssg-calc-footer > div { min-width: 0; display: grid; gap: 4px; }
.ssg-calculators .ssg-calc-footer strong { font-size: 1.12rem; letter-spacing: -.02em; }
.ssg-calculators .ssg-calc-footer span { color: var(--ssg-dim); font-size: .9rem; }

/* ---------- keyboard focus ---------- */
.ssg-calculators a:focus-visible,
.ssg-calculators button:focus-visible {
  outline: 3px solid var(--ssg-sky);
  outline-offset: 3px;
}
.ssg-calculators .ssg-tab.is-active:focus-visible { outline-color: var(--ssg-navy-3); }

@media (prefers-reduced-motion: reduce) {
  .ssg-calculators .ssg-btn, .ssg-calculators .ssg-tab { transition: none; }
  .ssg-calculators .ssg-btn:hover { transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .ssg-calculators { padding: 32px; }
  .ssg-calculators .ssg-calc-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ssg-calculators .ssg-calc-layout, .ssg-calculators .ssg-ghg-inputs { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 700px) {
  .ssg-calculators { padding: 24px 20px; border-radius: 22px; }
  .ssg-calculators::after { display: none; }
  .ssg-calculators .ssg-calc-hero { align-items: flex-start; padding-bottom: 22px; }
  .ssg-calculators .ssg-hero-actions { width: 100%; }
  .ssg-calculators .ssg-hero-actions .ssg-btn { flex: 1 1 200px; }
  .ssg-calculators .ssg-calc-tabs { margin: 20px 0; padding: 8px; gap: 8px; }
  .ssg-calculators .ssg-input-card, .ssg-calculators .ssg-output-card { padding: 18px; }
  /* 16px keeps iOS Safari from zooming the viewport on input focus. */
  .ssg-calculators .ssg-field input, .ssg-calculators .ssg-field select { font-size: 16px; }
  .ssg-calculators .ssg-btn { width: 100%; }
  .ssg-calculators .ssg-calc-footer .ssg-btn { width: 100%; }
}

@media (max-width: 430px) {
  .ssg-calculators { padding: 20px 15px; }
  .ssg-calculators .ssg-calc-tabs { grid-template-columns: minmax(0, 1fr); }
  .ssg-calculators .ssg-calc-heading { gap: 12px; }
  .ssg-calculators .ssg-step { width: 42px; height: 42px; border-radius: 13px; font-size: .88rem; }
  .ssg-calculators .ssg-result-grid, .ssg-calculators .ssg-ghg-results { grid-template-columns: minmax(0, 1fr); }
  .ssg-calculators .ssg-stat-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  /* Keep long formatted figures on one line inside a 320px card. */
  .ssg-calculators .ssg-big-result { padding: 13px 14px; }
  .ssg-calculators .ssg-big-result strong { font-size: 1.25rem; }
  .ssg-calculators .ssg-hero-number strong { font-size: 1.8rem; }
}
