:root {
  --primary: #2563eb;
  --primary-light: #eff6ff;
  --background: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --error: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--background);
  color: var(--text);
}

.container {
  max-width: 440px;
  margin: 0 auto;
  padding: 20px;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text);
}

input,
select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 16px;
  margin-bottom: 8px;
  background: white;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

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

.help-text {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}

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

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

.form-col {
  width: 100%;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

button {
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: #1d4ed8;
}

.result {
  margin-top: 24px;
  padding: 16px;
  background: var(--primary-light);
  border-radius: 6px;
  border-left: 4px solid var(--primary);
}

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

.error-msg {
  color: var(--error);
  font-size: 14px;
  margin-top: 8px;
}

.content-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.content-section h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

.content-section p,
.content-section li {
  line-height: 1.6;
}

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

.faq-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.faq-section h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

.faq-item {
  margin-bottom: 16px;
}

.faq-item h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.faq-item p {
  line-height: 1.6;
  color: var(--muted);
}

.ads {
  margin: 24px 0;
  padding: 16px;
  background: #f1f5f9;
  border: 1px dashed var(--border);
  text-align: center;
  color: var(--muted);
}

.note {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 12px;
  margin-top: 16px;
}

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

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

  h1 {
    font-size: 20px;
  }

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

/* Breadcrumb */
.breadcrumb {
  list-style: none;
  padding: 0;
  margin-bottom: 20px;
  display: flex;
  gap: 8px;
  font-size: 14px;
}

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

.breadcrumb-item a:hover {
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: var(--muted);
}

/* Chart */
canvas {
  max-width: 100%;
  height: auto;
  margin: 16px 0;
}

/* Table */
.table-wrapper {
  overflow-x: auto;
  margin: 16px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

thead {
  background: var(--primary);
  color: white;
}

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

th {
  font-weight: 600;
}

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

/* Secondary button */
.secondary-btn {
  background: var(--muted);
}

.secondary-btn:hover {
  background: #475569;
}

/* PRINT STYLES */
@media print {
  .navbar, .ads, .form-actions .secondary-btn, button:not(.secondary-btn) {
    display: none !important;
  }

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

  .result {
    page-break-inside: avoid;
  }
}
/* Note Section */
.note {
  margin-top: 16px;
  padding: 12px;
  background: #fef3c7;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #92400e;
  line-height: 1.6;
}

.note strong {
  color: #78350f;
  font-weight: 600;
}

.note a {
  color: #1d4ed8;
  text-decoration: underline;
}

.note a:hover {
  color: #2563eb;
}

/* Footer */
footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

footer p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

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

footer a:hover {
  text-decoration: underline;
}
/* 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 {
  background: #1d4ed8;
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}
