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

* {
  box-sizing: border-box;
}

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

/* 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 {
  margin: 0 8px;
  color: var(--muted);
}

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

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

h1 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 32px;
  color: var(--text);
}

/* Form Styles */
.form-group, .form-section {
  margin-bottom: 24px;
}

label {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 8px;
  display: block;
  color: var(--text);
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
  background: #fff;
  font-family: inherit;
}

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

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

/* Button Group */
.button-group, .form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
}

button {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.calculate-btn {
  background: var(--primary);
  color: white;
}

.calculate-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.secondary-btn, .download-btn {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.secondary-btn:hover, .download-btn:hover {
  background: #f8fafc;
  border-color: var(--muted);
}

/* Error Box */
.error-box, .error-message {
  background-color: #fef2f2;
  border: 1px solid #fee2e2;
  color: var(--error);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 24px;
  text-align: center;
  font-weight: 500;
  display: none;
}

.error-box.show, .error-message.show {
  display: block;
}

/* Result Section */
.result {
  margin-top: 32px;
  padding: 32px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe); /* Blue gradient for loans */
  border-radius: 24px;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  animation: slideAddress 0.5s forwards;
  display: none; /* Hidden by default until JS shows it */
}

.result.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.result h2 {
  margin-top: 0;
  color: #1e3a8a; /* Dark Blue */
  font-size: 1.5rem;
  margin-bottom: 24px;
}

.highlight-amount {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  margin: 24px 0;
  display: inline-block;
  min-width: 250px;
}

.amount-label {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.amount-value {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 24px;
  text-align: left;
}

.result-item {
  background: rgba(255, 255, 255, 0.6);
  padding: 16px;
  border-radius: 12px;
}

.result-item label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.result-item .value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.breakdown-table {
  width: 100%;
  margin-top: 24px;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

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

.breakdown-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
}

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

/* Animations */
@keyframes slideAddress {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Content Section (Below Calculator) */
.content-section {
  max-width: 800px;
  margin: 64px auto;
  padding: 0 24px;
  color: var(--text);
}

.content-section h2 {
  font-size: 1.8rem;
  margin-top: 48px;
  margin-bottom: 24px;
  color: var(--text);
}

.content-section h3 {
  font-size: 1.4rem;
  margin-top: 32px;
  margin-bottom: 16px;
}

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

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

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

.formula-box {
  background: #f1f5f9;
  padding: 20px;
  border-radius: 12px;
  margin: 24px 0;
  border-left: 4px solid var(--primary);
}

.example-box {
  background: #fff;
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 12px;
  margin: 24px 0;
}

/* Additional specific styles for Education Loan */
.moratorium-info {
    background: #fefcbf;
    color: #744210;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    text-align: left;
}
.moratorium-info h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
}
.savings-highlight {
    background: #f0fdf4;
    color: #166534;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 24px;
    border: 1px solid #bbf7d0;
}

/* Responsive */
@media (max-width: 600px) {
  .result-grid {
    grid-template-columns: 1fr;
  }
  
  .button-group {
    grid-template-columns: 1fr;
  }
  
  .amount-value {
    font-size: 2rem;
  }
}

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

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