:root {
  --primary: #2563eb;
  --accent: #22c55e;
  --text: #0f172a;
  --muted: #64748b;
  --bg: #f8fafc;
  --border: #e2e8f0;
  --error: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 440px;
  margin: 48px auto;
  padding: 24px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

h1 {
  text-align: center;
  font-size: 1.75rem;
  margin-bottom: 24px;
}

label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  display: block;
}

input,
select {
  width: 100%;
  padding: 14px 12px;
  font-size: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  background: #fff;
}

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

input.error {
  border-color: var(--error);
}

small.help-text {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: -8px;
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

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

.form-actions {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

button {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  color: #fff;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.35);
}

button:nth-child(2) {
  background: var(--muted);
}

button:nth-child(2):hover {
  background: #475569;
  box-shadow: none;
  transform: none;
}

.result {
  margin-top: 24px;
  padding: 16px;
  background: #f1f5f9;
  border-radius: 12px;
  font-size: 0.95rem;
  animation: fadeIn 0.3s ease;
}

.result strong {
  color: var(--primary);
}

.error-msg {
  font-size: 0.8rem;
  color: var(--error);
  margin-top: -6px;
  margin-bottom: 8px;
}

/* Content section */
.content-section {
  margin-top: 32px;
  padding: 20px;
  background: #f8fafc;
  border-radius: 12px;
}

.content-section h2 {
  font-size: 1.15rem;
  margin: 24px 0 10px;
  font-weight: 600;
}

.content-section p,
.content-section li {
  font-size: 0.95rem;
}

.content-section ul {
  padding-left: 20px;
}

.note {
  margin-top: 16px;
  font-size: 0.85rem;
  text-align: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Breadcrumb style */
.breadcrumb {
  font-size: 14px;
  margin-bottom: 16px;
  color: var(--muted);
}

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

.breadcrumb span {
  margin: 0 6px;
}

.breadcrumb .current {
  color: var(--text);
  font-weight: 500;
}

/* Chart and table styles */
.chart-container {
  margin: 20px 0;
  text-align: center;
}

canvas {
  max-width: 100%;
  height: 300px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
}

.table-container {
  margin: 20px 0;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text);
}

tr:nth-child(even) {
  background: var(--bg);
}

.download-btn {
  margin-top: 16px;
  background: var(--accent) !important;
}

.download-btn:hover {
  background: #16a34a !important;
}

@media (max-width: 480px) {
  .container {
    margin: 24px 16px;
    padding: 20px;
  }

  .form-actions {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .table-container {
    font-size: 0.8rem;
  }

  th,
  td {
    padding: 8px 4px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .container {
    box-shadow: none;
    margin: 0;
    max-width: none;
  }

  button {
    display: none;
  }

  .form-actions {
    display: none;
  }
}
/* Related Calculators & Resources */
.related-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.related-links a {
  background: white;
  padding: 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  display: block;
  text-align: center;
}

.related-links a:hover {
  border-color: var(--primary);
  background: #eff6ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  text-decoration: none;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
}

.back-to-top a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: #2563eb;
  color: white;
  text-decoration: none;
  border-radius: 50%;
  font-size: 24px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all 0.3s ease;
}

.back-to-top a:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  background: #1d4ed8;
}
