:root {
  --bg-base: #f8fafc;
  --surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #10b981;
  --border: #e2e8f0;
  --radius-lg: 12px;
  --radius-md: 8px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-base);
  color: var(--text-main);
  padding: 2rem 1rem;
  line-height: 1.5;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

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

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

@media (min-width: 850px) {
  .calculator-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--bg-base);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Form Layout */
.form-group {
  margin-bottom: 1.25rem;
}

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

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

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

.input-prefix {
  position: absolute;
  left: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

input[type="number"],
select {
  width: 100%;
  padding: 0.65rem 0.75rem 0.65rem 2.2rem;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--surface);
  color: var(--text-main);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

select {
  padding-left: 0.75rem;
  cursor: pointer;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Toggle Options */
.toggle-group {
  display: flex;
  background: var(--bg-base);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.toggle-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: calc(var(--radius-md) - 2px);
  transition: all 0.15s ease;
}

.toggle-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow);
}

/* Summary Output Card */
.results-summary {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #ffffff;
  border: none;
}

.results-summary .card-title {
  border-bottom: 1px solid #334155;
}

.hero-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.metric-block h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 0.25rem;
}

.metric-block .value {
  font-size: 1.5rem;
  font-weight: 700;
}

.metric-block .value.tax-high {
  color: #f43f5e;
}

.metric-block .value.take-home {
  color: #10b981;
}

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.breakdown-table th,
.breakdown-table td {
  padding: 0.65rem 0.5rem;
  text-align: left;
}

.breakdown-table th {
  color: #94a3b8;
  font-weight: 600;
  border-bottom: 1px solid #334155;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.breakdown-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.breakdown-table tr.highlight td {
  font-weight: 600;
  color: #f1f5f9;
  border-bottom: 1px solid #475569;
}

/* Tax Slabs Visualization */
.slab-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.slab-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  font-size: 0.85rem;
}

.slab-item.active-slab {
  background: rgba(37, 99, 235, 0.15);
  border-left: 3px solid var(--primary);
}

.slab-rate {
  font-weight: 600;
  min-width: 40px;
}

.slab-range {
  flex-grow: 1;
  margin-left: 1rem;
  color: #cbd5e1;
}

.slab-tax {
  font-weight: 600;
}

/* Info Badge */
.info-note {
  margin-top: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: #94a3b8;
  border-left: 3px solid #64748b;
}