:root {
  --bg-color: #0b0f19;
  --bg-card: #131b2e;
  --bg-card-hover: #19243d;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #24324f;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent-green: #10b981;
  --accent-cyan: #06b6d4;
  --accent-danger: #ef4444;
  --accent-amber: #f59e0b;
  --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-color: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --card-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.08);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
  padding: 0.85rem 1.25rem;
}

.header-content {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-link {
  text-decoration: none;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s;
}

.brand-badge:hover {
  color: var(--primary);
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-tag {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-year {
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

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

.hero-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.hero-section h1 {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 660px;
  margin: 0 auto;
}

/* Tabs */
.tabs-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  padding: 0.4rem;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  overflow-x: auto;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Main Calculator Card */
.calc-main-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 2.5rem;
}

.tab-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.calc-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.input-card label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.input-prefix-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-symbol {
  position: absolute;
  left: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
}

.input-prefix-wrapper input {
  padding-left: 2rem;
}

input, select {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1.05rem;
  font-family: inherit;
  background: var(--bg-color);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Presets */
.quick-presets {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.presets-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.preset-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-pill:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Hero Result Banner */
.result-hero-banner {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 16px;
  padding: 1.75rem;
  text-align: center;
  margin-bottom: 1.75rem;
  position: relative;
}

.banner-green {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.banner-blue {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
}

.result-hero-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}

.result-hero-amount {
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--accent-green);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.banner-blue .result-hero-amount {
  color: var(--primary);
}

.result-hero-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.copy-summary-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-summary-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Distribution Bar */
.breakdown-bar-container {
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 14px;
  border: 1px solid var(--border-color);
}

.bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.progress-bar-wrapper {
  height: 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  margin-bottom: 0.75rem;
}

.bar-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.bar-neto {
  background: var(--accent-green);
}

.bar-deductions {
  background: var(--accent-danger);
}

.bar-legend {
  display: flex;
  gap: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-neto {
  background: var(--accent-green);
}

.dot-deductions {
  background: var(--accent-danger);
}

/* Deductions List */
.deductions-detail h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.deductions-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.deduction-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1.2rem;
  border-radius: 10px;
}

.deduction-concept {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.deduction-rate {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: var(--text-muted);
}

.deduction-amount {
  font-weight: 700;
  font-size: 1.05rem;
}

.total-row {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  margin-top: 0.5rem;
}

.text-danger {
  color: var(--accent-danger);
}

/* SAC Info Cards */
.sac-info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.info-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
}

.info-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.info-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.info-card code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* FAQ */
.faq-section {
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.faq-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
}

.faq-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.faq-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Cross Promo */
.cross-promo-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.05));
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 3rem;
  text-align: center;
}

.cross-promo-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.cross-promo-card h3 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.cross-promo-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.promo-links {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.promo-pill {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.2s;
}

.promo-pill:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
  padding: 2rem 0;
  margin-top: auto;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--primary);
  text-decoration: none;
}

.footer-note {
  font-size: 0.8rem;
  margin-top: 0.4rem;
  opacity: 0.75;
}

@media (max-width: 640px) {
  .hero-section h1 {
    font-size: 1.8rem;
  }
  .result-hero-amount {
    font-size: 2.4rem;
  }
  .calc-main-card {
    padding: 1.25rem;
  }
}
