/* ==========================================================================
   SPERE Power – Program Value Calculator
   Stylesheet v1.0.0
   ========================================================================== */

.spx-calculator,
.spx-calculator * {
  box-sizing: border-box;
}

.spx-calculator {
  /* SPERE Power brand palette */
  --spx-green:       #6abf2e;
  --spx-green-dark:  #4a9020;
  --spx-bg:          #111111;
  --spx-surface:     #1a1a1a;
  --spx-panel:       #1e1e1e;
  --spx-line:        #2e2e2e;
  --spx-ink:         #f0f0f0;
  --spx-muted:       #9aa0a6;
  --spx-input-bg:    #252525;
  --spx-input-text:  #e8e8e8;
  --spx-row-alt:     #191919;
  color: var(--spx-ink);
  font-family: Arial, Helvetica, sans-serif;
  max-width: 980px;
  margin: 0 auto;
}

.spx-shell {
  background: var(--spx-bg);
  border: 1px solid var(--spx-line);
  border-radius: 8px;
  overflow: hidden;
}

/* ── Header ─────────────────────────────────────────────── */

.spx-header {
  align-items: stretch;
  background: linear-gradient(135deg, #0d1a0a 0%, #1a2e0d 60%, #243d10 100%);
  border-bottom: 2px solid var(--spx-green);
  color: #ffffff;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 28px;
}

.spx-eyebrow {
  color: var(--spx-green);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.spx-header h2 {
  color: #ffffff;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  margin: 0;
}

.spx-header > div > p {
  color: #b8c8b0;
  font-size: 16px;
  line-height: 1.55;
  margin: 10px 0 0;
  max-width: 680px;
}

.spx-header-stat {
  align-self: center;
  background: rgba(106, 191, 46, 0.12);
  border: 1px solid rgba(106, 191, 46, 0.35);
  border-radius: 8px;
  min-width: 210px;
  padding: 16px;
  text-align: right;
}

.spx-header-stat span {
  color: #b8c8b0;
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.spx-header-stat strong {
  color: var(--spx-green);
  display: block;
  font-size: 28px;
  line-height: 1.2;
  margin-top: 8px;
}

/* ── Grid layout ─────────────────────────────────────────── */

.spx-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  padding: 18px;
}

.spx-panel,
.spx-notes {
  background: var(--spx-panel);
  border: 1px solid var(--spx-line);
  border-radius: 8px;
}

.spx-input-panel {
  padding: 18px;
}

.spx-panel h3,
.spx-notes h3 {
  color: var(--spx-ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 16px;
}

/* ── Form fields ─────────────────────────────────────────── */

.spx-two {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.spx-field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.spx-field:last-child {
  margin-bottom: 0;
}

.spx-field span {
  color: var(--spx-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.spx-field input,
.spx-field select {
  -webkit-appearance: none;
  appearance: none;
  background: var(--spx-input-bg);
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  color: var(--spx-input-text);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.35;
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

.spx-field select {
  background-image:
    linear-gradient(45deg,  transparent 50%, var(--spx-green) 50%),
    linear-gradient(135deg, var(--spx-green) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 19px,
    calc(100% - 12px) 19px;
  background-repeat: no-repeat;
  background-size: 6px 6px, 6px 6px;
  padding-right: 34px;
}

.spx-field input:focus,
.spx-field select:focus {
  border-color: var(--spx-green);
  box-shadow: 0 0 0 3px rgba(106, 191, 46, 0.2);
  outline: none;
}

/* ── Summary cards ───────────────────────────────────────── */

.spx-summary {
  display: grid;
  gap: 12px;
}

.spx-card {
  background: var(--spx-surface);
  border: 1px solid var(--spx-line);
  border-radius: 8px;
  padding: 18px;
}

.spx-card-primary {
  background: rgba(106, 191, 46, 0.08);
  border-color: rgba(106, 191, 46, 0.30);
}

.spx-card span {
  color: var(--spx-muted);
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.spx-card strong {
  color: var(--spx-ink);
  display: block;
  font-size: 28px;
  line-height: 1.15;
  margin-top: 8px;
}

.spx-card-primary strong {
  color: var(--spx-green);
}

/* ── Results table ───────────────────────────────────────── */

.spx-results {
  display: grid;
  gap: 0;
  margin: 0 18px 18px;
  overflow: hidden;
}

.spx-section {
  border-bottom: 1px solid var(--spx-line);
}

.spx-section:last-child {
  border-bottom: 0;
}

.spx-section h3 {
  background: #1c2a14;
  border-bottom: 1px solid var(--spx-line);
  color: var(--spx-green) !important;
  font-size: 13px !important;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: 0 !important;
  padding: 11px 14px;
  text-transform: uppercase;
}

.spx-row {
  align-items: center;
  border-bottom: 1px solid var(--spx-line);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
  padding: 10px 14px;
}

.spx-row:last-child {
  border-bottom: 0;
}

.spx-row:nth-child(even) {
  background: var(--spx-row-alt);
}

.spx-row span {
  color: var(--spx-ink);
  font-size: 15px;
  line-height: 1.35;
}

.spx-row strong {
  color: var(--spx-ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  text-align: right;
  white-space: nowrap;
}

.spx-final-section .spx-row {
  background: #1a2e0d;
}

.spx-final-section .spx-row strong {
  font-size: 18px;
  font-weight: 800;
}

/* ── Value states ────────────────────────────────────────── */

.spx-negative {
  color: #f05050 !important;
}

.spx-positive {
  color: var(--spx-green) !important;
}

/* ── Notes ───────────────────────────────────────────────── */

.spx-notes {
  margin: 0 18px 18px;
  padding: 16px 18px;
}

.spx-notes h3 {
  color: var(--spx-muted) !important;
  font-size: 12px !important;
  letter-spacing: 0.07em;
  margin: 0 0 10px !important;
  text-transform: uppercase;
}

.spx-notes p {
  color: var(--spx-muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 8px;
}

.spx-notes p:last-child {
  margin-bottom: 0;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 760px) {
  .spx-header {
    display: grid;
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .spx-header-stat {
    text-align: left;
    width: 100%;
  }

  .spx-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .spx-two {
    grid-template-columns: 1fr;
  }

  .spx-results,
  .spx-notes {
    margin-left: 14px;
    margin-right: 14px;
  }

  .spx-row {
    gap: 4px;
    grid-template-columns: 1fr;
  }

  .spx-row strong {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .spx-header h2 {
    font-size: 24px;
  }

  .spx-card strong,
  .spx-header-stat strong {
    font-size: 24px;
  }
}
