/* =============================================
   SELF-EMPLOYMENT PAGE STYLES
   ============================================= */

/* Hero */
.hero-section {
  padding: 3rem 0 2rem;
  text-align: center;
}

.hero-section h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  margin: 0 0 1rem;
  line-height: 1.2;
}

.year-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.5em;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  vertical-align: middle;
  position: relative;
  top: -0.15em;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Calculator Layout */
.calc-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 2rem;
  align-items: start;
}

.calc-inputs {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: sticky;
  top: 5rem;
}

.calc-results {
  min-width: 0;
}

.panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}

/* Input Groups */
.input-group {
  margin-bottom: 1rem;
}

.input-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.input-group .optional {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.input-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.input-prefix-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s;
}

.input-prefix-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-prefix {
  padding: 0.65rem 0.75rem;
  background: var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
}

.input-prefix-wrap input {
  flex: 1;
  border: none;
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  min-width: 0;
}

.input-group select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s;
}

.input-group select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.input-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

.radio-row {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.3rem;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text);
}

.radio-label input {
  accent-color: var(--accent);
}

/* Button */
.btn-block {
  width: 100%;
  margin-top: 0.5rem;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #fff;
}

/* Result Banner */
.result-banner {
  text-align: center;
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  color: #fff;
}

.result-banner.refund {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.banner-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.9;
  margin-bottom: 0.3rem;
}

.banner-amount {
  font-size: 2.4rem;
  font-weight: 800;
}

/* Metric Grid */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.metric-card.accent {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.04);
}

[data-theme="dark"] .metric-card.accent {
  background: rgba(96, 165, 250, 0.08);
}

.metric-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.metric-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}

.metric-card.accent .metric-value {
  color: var(--accent);
}

.metric-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Breakdown Waterfall */
.breakdown-section {
  margin-bottom: 2rem;
}

.breakdown-section h3,
.quarterly-section h3,
.chart-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.breakdown-waterfall {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.waterfall-row {
  display: grid;
  grid-template-columns: 180px 1fr 100px;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.9rem;
}

.wf-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.wf-bar-track {
  height: 24px;
  background: var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.wf-bar-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width 0.5s ease;
  min-width: 2px;
}

.wf-bar-fill.fill-green {
  background: #22c55e;
}
.wf-bar-fill.fill-blue {
  background: var(--accent);
}
.wf-bar-fill.fill-orange {
  background: #f97316;
}
.wf-bar-fill.fill-red {
  background: #ef4444;
}
.wf-bar-fill.fill-purple {
  background: #8b5cf6;
}

.wf-value {
  text-align: right;
  font-weight: 700;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.88rem;
}

.waterfall-row.deduction .wf-value {
  color: #22c55e;
}

/* Quarterly Grid */
.quarterly-section {
  margin-bottom: 2rem;
}

.quarterly-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: -0.5rem 0 1rem;
}

.quarterly-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.q-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.q-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.q-card-quarter {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0.2rem 0;
  color: var(--accent);
}

.q-card-amount {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0.3rem 0;
}

.q-card-due {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Donut Chart */
.chart-section {
  margin-bottom: 1rem;
}

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-label {
  color: var(--text-muted);
}

.legend-value {
  font-weight: 700;
  margin-left: auto;
  padding-left: 1rem;
}

/* ---- Educational Content ---- */
.content-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 1.5rem;
}

.content-col h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.6rem;
}

.content-col h3:first-child {
  margin-top: 0;
}

.content-col p {
  color: var(--text-muted);
  line-height: 1.75;
  margin: 0 0 1rem;
}

/* Rate Breakdown Visual */
.rate-breakdown-visual {
  margin: 1rem 0 1.25rem;
}

.rate-bar {
  display: flex;
  height: 44px;
  border-radius: var(--radius);
  overflow: hidden;
}

.rate-segment {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
}

.rate-segment.ss {
  background: #3b82f6;
}
.rate-segment.mc {
  background: #8b5cf6;
}

.rate-seg-label {
  font-size: 0.65rem;
  opacity: 0.9;
}
.rate-seg-pct {
  font-weight: 800;
  font-size: 0.85rem;
}

.rate-bar-total {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-weight: 600;
}

.info-list {
  padding-left: 1.25rem;
  margin: 1rem 0;
}

.info-list li {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

/* Formula Box */
.formula-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1rem 0;
}

.formula-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.formula-step {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0.3rem 0;
}

.formula-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.4rem;
}

/* Example Calc */
.example-calc {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0;
}

.ex-step {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.ex-step:last-child {
  border-bottom: none;
}

.ex-step.highlight {
  background: rgba(34, 197, 94, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.5rem;
  margin: 0.2rem -0.5rem;
}

.ex-label {
  color: var(--text-muted);
}

.ex-val {
  font-weight: 700;
  font-family: "SF Mono", "Fira Code", monospace;
}

/* Quarter cards (guide section) */
.quarter-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.quarter-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.q-label {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
}

.q-period {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.25rem 0;
}

.q-due {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 0.5rem;
}

/* Method Cards */
.method-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
}

.method-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.method-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.method-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Deductions Grid */
.deductions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.deduction-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.ded-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.deduction-item h4 {
  font-size: 0.95rem;
  margin: 0 0 0.4rem;
}

.deduction-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* FAQ (reuse brackets styles) */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-item summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  transition: background 0.2s;
}

.faq-item summary:hover {
  background: var(--border);
}

.faq-item summary::after {
  content: "+";
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--text-muted);
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
}

.faq-answer p {
  margin: 0.75rem 0 0;
  line-height: 1.75;
  color: var(--text-muted);
}

/* CTA */
.cta-block {
  text-align: center;
  padding: 2rem 0;
}

.cta-block h2 {
  margin-bottom: 0.75rem;
}

.cta-block p {
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 1.5rem;
  line-height: 1.7;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Ad Slots */
.ad-slot {
  max-width: 728px;
  margin: 1.5rem auto;
  text-align: center;
}

.ad-placeholder {
  background: var(--card-bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 900px) {
  .calc-layout {
    grid-template-columns: 1fr;
  }

  .calc-inputs {
    position: static;
  }
}

@media (max-width: 768px) {
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .quarterly-grid {
    grid-template-columns: 1fr 1fr;
  }

  .content-columns {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .quarter-cards {
    grid-template-columns: 1fr 1fr;
  }

  .method-cards {
    grid-template-columns: 1fr;
  }

  .deductions-grid {
    grid-template-columns: 1fr 1fr;
  }

  .donut-wrap {
    flex-direction: column;
    align-items: center;
  }

  .waterfall-row {
    grid-template-columns: 140px 1fr 90px;
  }
}

@media (max-width: 480px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .quarterly-grid {
    grid-template-columns: 1fr;
  }

  .quarter-cards {
    grid-template-columns: 1fr;
  }

  .deductions-grid {
    grid-template-columns: 1fr;
  }

  .waterfall-row {
    grid-template-columns: 1fr 80px;
  }

  .wf-bar-track {
    display: none;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
}
