/* =============================================================
   Salary Calculator — salary-calculator.css
   Mobile-first. Scoped to .sc-wrap
   ============================================================= */

.sc-wrap *, .sc-wrap *::before, .sc-wrap *::after {
  box-sizing: border-box; margin: 0; padding: 0;
}
.sc-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px; color: #1e293b;
  max-width: 1000px; margin: 0 auto;
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 16px; overflow: hidden;
}

/* ── Header ───────────────────────────────────────────────── */
.sc-header {
  padding: 20px 24px 18px;
  background: #f8fafc; border-bottom: 1px solid #e2e8f0;
}
.sc-title    { font-size: 21px; font-weight: 700; color: #1e3a5f; margin-bottom: 3px; }
.sc-subtitle { font-size: 13px; color: #64748b; }

/* ── Body ─────────────────────────────────────────────────── */
.sc-body { display: flex; flex-direction: column; }
@media (min-width: 720px) {
  .sc-body { flex-direction: row; align-items: flex-start; }
  .sc-inputs  { width: 46%; border-right: 1px solid #e2e8f0; }
  .sc-results { width: 54%; position: sticky; top: 0; }
}

/* ── Inputs ───────────────────────────────────────────────── */
.sc-inputs { padding: 20px; display: flex; flex-direction: column; gap: 14px; }

.sc-field { display: flex; flex-direction: column; gap: 5px; }
.sc-label { font-size: 12.5px; font-weight: 600; color: #334155; }

/* Toggle */
.sc-toggle-group { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sc-toggle {
  padding: 10px; border: 1.5px solid #cbd5e1; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  background: #f8fafc; color: #475569; transition: all .15s;
}
.sc-toggle.active { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.sc-toggle:hover:not(.active) { border-color: #4f46e5; color: #4f46e5; }

/* Select */
.sc-select {
  width: 100%; padding: 10px 32px 10px 12px; height: 44px;
  border: 1.5px solid #cbd5e1; border-radius: 8px;
  font-size: 13.5px; color: #1e293b; background: #f8fafc;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23718096' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  transition: border-color .18s; outline: none;
}
.sc-select:focus { border-color: #4f46e5; background-color: #fff; }

/* Input prefix/suffix */
.sc-prefix-wrap, .sc-suffix-wrap {
  display: flex; align-items: center;
  border: 1.5px solid #cbd5e1; border-radius: 8px;
  overflow: hidden; background: #f8fafc; transition: border-color .18s;
}
.sc-prefix-wrap:focus-within,
.sc-suffix-wrap:focus-within { border-color: #4f46e5; background: #fff; }
.sc-prefix, .sc-suffix {
  padding: 0 10px; font-size: 14px; font-weight: 600;
  color: #64748b; background: #f1f5f9; height: 44px;
  display: flex; align-items: center; flex-shrink: 0;
}
.sc-prefix { border-right: 1px solid #e2e8f0; }
.sc-suffix  { border-left:  1px solid #e2e8f0; }
.sc-input {
  flex: 1; border: none; background: transparent;
  padding: 0 12px; height: 44px; font-size: 14px;
  color: #1e293b; outline: none; min-width: 0;
  -moz-appearance: textfield;
}
.sc-input::-webkit-outer-spin-button,
.sc-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.sc-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Divider */
.sc-divider {
  display: flex; align-items: center; gap: 8px;
  color: #94a3b8; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
}
.sc-divider::before, .sc-divider::after { content:''; flex:1; height:1px; background:#e2e8f0; }

/* What-if row */
.sc-whatif-row {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; font-size: 13px; color: #475569;
}
.sc-whatif-label { white-space: nowrap; }
.sc-whatif-input { width: 90px; flex-shrink: 0; }
.sc-whatif-input .sc-input { height: 38px; }
.sc-whatif-input .sc-suffix { height: 38px; }
.sc-whatif-result {
  font-size: 13px; font-weight: 600; color: #e24b4a;
  background: #fef2f2; border-radius: 6px;
  padding: 4px 10px; white-space: nowrap;
}

/* ── Results ──────────────────────────────────────────────── */
.sc-results {
  padding: 20px; display: flex; flex-direction: column;
  gap: 14px; background: #f8fafc;
}

/* Hero */
.sc-hero {
  background: #4f46e5; border-radius: 12px;
  padding: 20px; text-align: center; color: #fff;
}
.sc-hero-label  { font-size: 11px; font-weight: 700; opacity: .75; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.sc-hero-amount { font-size: 46px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.sc-hero-gross  { font-size: 13px; opacity: .7; margin-top: 6px; }

/* Breakdown card */
.sc-breakdown-card, .sc-compare-card {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 12px; padding: 16px;
}
.sc-bk-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #94a3b8; margin-bottom: 10px;
}

/* Stacked bar */
.sc-bar-chart {
  display: flex; height: 10px; border-radius: 6px;
  overflow: hidden; margin-bottom: 8px; background: #f1f5f9;
}
.sc-bar-seg { height: 100%; transition: width .4s ease; }

.sc-bar-legend {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  font-size: 11px; color: #64748b; margin-bottom: 12px;
}
.sc-bar-legend span { display: flex; align-items: center; gap: 4px; }
.sc-bar-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

.sc-bk-row {
  display: flex; justify-content: space-between;
  align-items: center; padding: 6px 0;
  font-size: 13px; color: #475569;
  border-bottom: 1px solid #f8fafc;
}
.sc-bk-row:last-child { border-bottom: none; }
.sc-bk-gross-row { font-weight: 600; color: #1e293b; font-size: 14px; }
.sc-bk-net-row   {
  font-size: 15px; font-weight: 700; color: #4f46e5;
  border-top: 1.5px solid #e2e8f0; margin-top: 4px;
  padding-top: 10px; border-bottom: none;
}
.sc-neg  { color: #e24b4a; font-weight: 500; }
.sc-deduct-row { font-size: 12.5px; }

/* Summary grid */
.sc-summary-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.sc-summary-card {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 10px; padding: 12px 14px;
}
.sc-summary-lbl {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: #94a3b8; margin-bottom: 4px;
}
.sc-summary-val { font-size: 15px; font-weight: 700; color: #1e3a5f; }
.sc-summary-val.sc-red   { color: #e24b4a; }
.sc-summary-val.sc-green { color: #0f766e; }

/* Compare card */
.sc-compare-row {
  display: flex; justify-content: space-between;
  font-size: 13px; padding: 6px 0;
  border-bottom: 1px solid #f8fafc; color: #475569;
}
.sc-compare-row:last-of-type { border-bottom: none; }
.sc-compare-diff {
  margin-top: 8px; font-size: 13px; font-weight: 600;
  color: #0f766e; background: #f0fdf4;
  border-radius: 6px; padding: 6px 10px;
  text-align: center; display: none;
}
.sc-green { color: #0f766e; font-weight: 600; }

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  .sc-header  { padding: 16px; }
  .sc-inputs, .sc-results { padding: 16px; }
  .sc-title   { font-size: 19px; }
  .sc-hero-amount { font-size: 38px; }
  .sc-summary-grid { grid-template-columns: 1fr 1fr; }
  .sc-row-2 { grid-template-columns: 1fr; }
}
