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

* {
  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: 460px;
  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;
  margin-top: 8px;
}

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);
}

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

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

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.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
}

.secondary-btn {
  margin-top: 10px;
  background: #f1f5f9;
  color: var(--text);
  border: 1px solid var(--border);
}

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

.error-msg {
  color: var(--error);
  font-size: 0.9rem;
  margin-top: 16px;
  padding: 12px;
  background: #fee;
  border-radius: 8px;
  border-left: 4px solid var(--error);
}

.result {
  margin-top: 24px;
  padding: 20px;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  border-radius: 12px;
  border: 2px solid var(--primary-light);
  animation: fadeIn 0.3s ease;
}

.result h3 {
  margin: 0 0 12px 0;
  color: var(--primary);
  font-size: 1.1rem;
}

.result p {
  margin: 8px 0;
  font-size: 0.95rem;
}

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

.highlight-amount {
  background: white;
  padding: 16px;
  border-radius: 10px;
  margin: 16px 0;
  text-align: center;
  border: 2px solid var(--primary);
}

.highlight-amount p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.highlight-amount strong {
  display: block;
  font-size: 1.8rem;
  color: var(--primary);
  margin-top: 4px;
}

.info-box {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 0.9rem;
}

.warning-box {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 0.9rem;
}

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

.content-section h2 {
  font-size: 1.3rem;
  margin: 32px 0 16px;
  font-weight: 600;
  color: var(--text);
}

.content-section h2:first-child {
  margin-top: 0;
}

.content-section h3 {
  font-size: 1.1rem;
  margin: 24px 0 12px;
  font-weight: 600;
  color: var(--primary);
}

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

.content-section ul {
  padding-left: 24px;
  margin: 12px 0;
}

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

.formula-box {
  background: white;
  padding: 16px;
  border-radius: 10px;
  border: 2px solid var(--primary-light);
  margin: 16px 0;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.8;
}

.example-box {
  background: #f0fdf4;
  border-left: 4px solid #10b981;
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

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

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

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

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

/* Ads */
.ads {
  margin: 24px 0;
  padding: 20px;
  background: #f1f5f9;
  border-radius: 10px;
  text-align: center;
  color: var(--muted);
  border: 2px dashed var(--border);
}

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

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

  h1 {
    font-size: 1.5rem;
  }

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

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

.related-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  padding: 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #1e40af;
  font-weight: 500;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.related-links a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  border-color: #2563eb;
}

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