/* ========================================
   Paycheck Calculator — Styles
   Professional payroll tool design
   ======================================== */

:root {
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-focus: #10b981;
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #ecfdf5;
  --accent: #f59e0b;
  --accent-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --success: #10b981;
  --success-light: #ecfdf5;
  --info: #3b82f6;
  --info-light: #eff6ff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Navigation ---- */

.nav {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  overflow-x: auto;
}

.nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  white-space: nowrap;
  transition: all 0.15s;
}

.nav a:hover { background: var(--primary-light); color: var(--primary); }
.nav a.active { background: var(--primary); color: #fff; }

.nav-brand {
  font-weight: 700;
  font-size: 16px;
  color: var(--text) !important;
  margin-right: auto;
}

/* ---- Layout ---- */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.hero {
  text-align: center;
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  color: var(--text);
}

.hero p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto;
}

/* ---- Calculator Grid ---- */

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

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

/* ---- Card ---- */

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

/* ---- Form Elements ---- */

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group .hint {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 4px;
}

.input-group {
  position: relative;
}

.input-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
  pointer-events: none;
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--card-bg);
  transition: border-color 0.15s;
  appearance: none;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
}

input.with-prefix { padding-left: 32px; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ---- Radio Buttons ---- */

.radio-group {
  display: flex;
  gap: 8px;
}

.radio-group label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-secondary);
}

.radio-group input { display: none; }
.radio-group input:checked + label {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* ---- Button ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 32px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
}

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

.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* ---- Results ---- */

.results { display: none; }
.results.show { display: block; }

.result-hero {
  text-align: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.result-hero .label {
  font-size: 14px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.result-hero .amount {
  font-size: 42px;
  font-weight: 800;
  color: var(--primary);
  margin: 4px 0;
}

.result-hero .sub {
  font-size: 15px;
  color: var(--text-muted);
}

.result-table {
  width: 100%;
  border-collapse: collapse;
}

.result-table th {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.result-table td {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}

.result-table td:last-child {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.result-table tr.deduct td { color: var(--danger); }
.result-table tr.net td { color: var(--primary); font-size: 17px; font-weight: 700; border-bottom: none; }

/* ---- Info Section ---- */

.info-section {
  margin-top: 48px;
}

.info-section h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}

.info-section h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 8px;
  color: var(--text);
}

.info-section p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.7;
}

.info-section ul {
  margin: 0 0 12px 20px;
}

.info-section li {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.7;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.info-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.info-card h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.info-card p {
  font-size: 14px;
  margin: 0;
}

/* ---- State Grid ---- */

.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.state-link {
  display: block;
  padding: 10px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}

.state-link:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* ---- Callout ---- */

.callout {
  background: var(--info-light);
  border-left: 4px solid var(--info);
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 16px 0;
  font-size: 14px;
  color: var(--text);
}

.callout strong { color: var(--info); }

/* ---- Footer ---- */

.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
  margin: 0 8px;
}

.footer a:hover { color: var(--primary); }

/* ---- FAQ ---- */

.faq-section {
  margin-top: 48px;
}

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

.faq-item summary {
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 20px; color: var(--text-muted); }
.faq-item[open] summary::after { content: '−'; }

.faq-item p {
  padding: 0 20px 16px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ---- Disclaimer ---- */

.disclaimer {
  background: var(--accent-light);
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 13px;
  color: #92400e;
  margin-top: 24px;
}

/* ---- Responsive ---- */

@media (max-width: 640px) {
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 16px; }
  .card { padding: 20px; }
  .result-hero .amount { font-size: 32px; }
}
