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

* {
  box-sizing: border-box;
}

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

/* Breadcrumb */
.breadcrumb {
  max-width: 1100px;
  margin: 16px auto;
  padding: 0 24px;
  font-size: 0.9rem;
  color: var(--muted);
}

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

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

.breadcrumb span {
  color: var(--text);
}

.breadcrumb .current {
  font-weight: 500;
}

.container {
  max-width: 440px;
  margin: 48px auto;
  padding: 24px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
  color: var(--text);
}

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

input,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
}

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

input.error {
  border-color: #dc2626;
}

.help-text {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

.form-section {
  margin-bottom: 20px;
}

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

button {
  flex: 1;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
  color: white;
  transition: transform 0.2s;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.secondary-btn {
  background: #f1f5f9;
  color: var(--text);
}

.secondary-btn:hover {
  background: #e2e8f0;
  box-shadow: none;
}

.error-msg {
  background: #fef2f2;
  color: #dc2626;
  padding: 12px;
  border-radius: 6px;
  margin: 16px 0;
  font-size: 0.9rem;
  display: none;
}

.error-msg.show {
  display: block;
}

.result {
  margin-top: 32px;
  padding: 20px;
  background: #f1f5f9;
  border-radius: 8px;
  display: none;
}

.result.show {
  display: block;
}

.result h2 {
  font-size: 1.25rem;
  margin-bottom: 16px;
  color: var(--text);
  background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result h3 {
  font-size: 1.1rem;
  margin-top: 20px;
  margin-bottom: 12px;
  color: var(--text);
  background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result p {
  margin: 8px 0;
  color: var(--text);
}

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

.highlight-amount {
  background: white;
  padding: 16px;
  border-radius: 6px;
  margin: 16px 0;
  border-left: 4px solid var(--primary);
}

.highlight-amount p {
  margin: 4px 0;
  font-size: 0.95rem;
}

.highlight-amount strong {
  font-size: 1.5rem;
  color: var(--primary);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  background: white;
  border-radius: 6px;
  overflow: hidden;
}

th {
  background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: 600;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

tr:last-child td {
  border-bottom: none;
}

tr:nth-child(even) {
  background: #f8fafc;
}

.comparison-table {
  margin: 20px 0;
}

/* Canvas Chart */
canvas {
  margin: 20px auto;
  display: block;
  max-width: 100%;
  height: auto;
}

/* Content Sections */
.content-section {
  max-width: 1100px;
  margin: 48px auto;
  padding: 0 24px;
  line-height: 1.7;
}

.content-section h2 {
  font-size: 1.75rem;
  margin-top: 40px;
  margin-bottom: 16px;
  color: var(--text);
}

.content-section h3 {
  font-size: 1.3rem;
  margin-top: 28px;
  margin-bottom: 12px;
  color: var(--text);
}

.content-section p {
  margin-bottom: 16px;
  color: #475569;
}

.content-section ul,
.content-section ol {
  margin: 16px 0;
  padding-left: 24px;
}

.content-section li {
  margin-bottom: 8px;
  color: #475569;
}

.content-section a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.content-section a:hover {
  text-decoration: underline;
}

.content-section strong {
  color: var(--text);
  font-weight: 600;
}

.content-section table {
  margin: 24px 0;
}

/* FAQ Section */
.faq-item {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h3 {
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 12px;
}

.faq-item p {
  color: #475569;
  line-height: 1.7;
}

/* Print Styles */
@media print {
  body {
    background: white;
  }

  .navbar,
  .ads,
  .form-actions,
  button,
  .breadcrumb {
    display: none !important;
  }

  .container {
    max-width: 100%;
    box-shadow: none;
    margin: 0;
    padding: 20px;
  }

  .result {
    display: block !important;
    page-break-inside: avoid;
  }

  .content-section {
    display: block !important;
    page-break-inside: avoid;
    margin: 20px 0;
    padding: 0;
  }

  .content-section h2 {
    page-break-after: avoid;
  }

  .faq-item {
    display: block !important;
    page-break-inside: avoid;
  }

  table {
    page-break-inside: avoid;
  }

  canvas {
    page-break-inside: avoid;
  }

  h1 {
    font-size: 1.5rem;
  }

  .result h2,
  .result h3,
  .content-section h2,
  .content-section h3 {
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .highlight-amount {
    border: 1px solid #ddd;
  }

  a {
    color: #000;
    text-decoration: none;
  }
}

/* Note Section */
.note {
  background: #fef3c7;
  padding: 20px;
  margin: 24px auto;
  max-width: 1100px;
  border-radius: 8px;
  border-left: 4px solid #f59e0b;
  color: #78350f;
  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 {
  background: white;
  padding: 20px;
  margin: 24px auto 40px;
  max-width: 1100px;
  text-align: center;
  border-top: 1px solid var(--border);
}

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

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

footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
  .container {
    margin: 24px auto;
    padding: 16px;
  }

  h1 {
    font-size: 1.5rem;
  }

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

  button {
    width: 100%;
  }

  .content-section {
    padding: 0 16px;
  }
}

/* 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;
}
