/* Loan Calculations — visual system
   Deep teal + amber/gold on warm off-white
   Mobile-first, no external requests, system font stack */

:root {
  --teal: #0b6e4f;
  --teal-dark: #103a63;
  --teal-darker: #081f3a;
  --teal-light: #e4f2ec;
  --amber: #10b981;
  --gold: #34d399;
  --offwhite: #f6f8fa;
  --surface: #ffffff;
  --surface-warm: #fbfcfe;
  --text: #0f1e2e;
  --muted: #52677a;
  --border: #dde5ec;
  --border-strong: #c2d2df;
  --shadow-sm: 0 1px 2px rgba(8, 31, 58, 0.06), 0 1px 3px rgba(8, 31, 58, 0.08);
  --shadow-md: 0 6px 16px -6px rgba(8, 31, 58, 0.15), 0 10px 30px -12px rgba(8, 31, 58, 0.12);
  --shadow-lg: 0 20px 40px -20px rgba(8, 31, 58, 0.25);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --max-width: 1120px;
  --header-height: 68px;
  --transition: 180ms ease;
  --focus-ring: 0 0 0 3px rgba(16, 185, 129, 0.4);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  /* Legacy aliases — inline page styles and older markup reference these */
  --accent: var(--teal);
  --accent-dark: var(--teal-dark);
  --ink: var(--text);
  --line: var(--border);
  --warn: #b3541e;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--offwhite);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg {
  max-width: 100%;
  display: inline-block;
}

::selection {
  background: rgba(16, 185, 129, 0.35);
  color: var(--teal-darker);
}

a {
  color: var(--teal);
  text-decoration: none;
  transition: color var(--transition), background-color var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

a:hover {
  color: var(--teal-dark);
}

.wrap {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* Sticky header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(180deg, rgba(8, 31, 58, 0.98), rgba(8, 31, 58, 0.96));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(52, 211, 153, 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-height);
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: #fff;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--amber) 100%);
  color: var(--teal-darker);
  font-size: 20px;
  font-weight: 900;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25), 0 4px 10px rgba(0, 0, 0, 0.2);
}

.brand span {
  color: var(--gold);
  letter-spacing: -0.01em;
}

.site-header nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.site-header nav a {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
}

.site-header nav a:hover {
  background: rgba(52, 211, 153, 0.14);
  color: #fff;
}

.site-header nav a[aria-current="page"] {
  background: rgba(52, 211, 153, 0.2);
  color: #fff;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0b6e4f 0%, #103a63 45%, #081f3a 100%);
  color: #fff;
  padding: 72px 0 80px;
  border-bottom: 4px solid var(--gold);
}

.hero::before {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(52, 211, 153, 0.35), rgba(16, 185, 129, 0.15) 70%);
}

.hero::after {
  content: "";
  position: absolute;
  left: -60px;
  bottom: -100px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.hero .wrap {
  position: relative;
  z-index: 1;
}

.hero h1 {
  max-width: 14ch;
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero p {
  max-width: 60ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.6;
}

/* Main content */
main .wrap {
  padding-top: 48px;
  padding-bottom: 64px;
}

h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  color: var(--text);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

h2::before {
  content: "";
  flex: none;
  width: 6px;
  height: 26px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--gold), var(--amber));
}

/* Cards, tool grids */
.card {
  margin-bottom: 24px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card h2 {
  margin: 0 0 16px;
  color: var(--teal-dark);
  font-size: 1.2rem;
  font-weight: 700;
}

.card h2::before {
  display: none;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 18px;
  margin: 0 0 48px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.tool-card:hover,
.tool-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--amber);
}

.tool-card:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.tool-card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--offwhite), #fff);
  font-size: 24px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  transition: background var(--transition), border-color var(--transition);
}

.tool-card:hover .icon {
  background: linear-gradient(135deg, var(--gold), var(--amber));
  border-color: rgba(16, 185, 129, 0.5);
}

.tool-card h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Form fields */
.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
}

.field input,
.field select {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface-warm);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.field input:hover,
.field select:hover {
  border-color: #bfb7a8;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--teal);
  background: #fff;
  box-shadow: var(--focus-ring);
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230b6e4f' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 36px;
}

.field .hint {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 640px) {
  .row {
    grid-template-columns: 1fr;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 8px 18px -8px rgba(11, 110, 79, 0.5);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.btn:hover {
  background: linear-gradient(135deg, #0d7d59, #0b6e4f);
  box-shadow: 0 10px 22px -8px rgba(11, 110, 79, 0.65);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.5);
}

/* Results panel */
.results {
  display: none;
  margin-top: 24px;
  padding: 22px;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal-darker));
  color: #fff;
  border-left: 6px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.results.show {
  display: block;
  animation: fadeInUp 240ms ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.results .big {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Tool pages use inline color:var(--muted) for result labels — keep readable on the dark panel */
.results [style*="--muted"] {
  color: rgba(255, 255, 255, 0.78) !important;
}

.results table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  color: #fff;
}

.results td {
  padding: 10px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.95rem;
}

.results td:first-child {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

.results td:last-child {
  text-align: right;
  font-weight: 700;
}

/* FAQ */
.faq {
  margin-top: 24px;
  padding-top: 8px;
}

.faq h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 20px 0 8px;
  color: var(--teal-dark);
  font-size: 1.05rem;
  font-weight: 700;
}

.faq h3::before {
  content: "Q";
  flex: none;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--amber);
  font-size: 0.75rem;
  font-weight: 800;
}

.faq p {
  margin: 0 0 8px;
  padding-left: 28px;
  color: var(--muted);
  line-height: 1.6;
}

/* CTA box */
.cta-box {
  margin: 40px 0 20px;
  padding: 32px 28px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--amber) 100%);
  color: var(--teal-darker);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-md);
}

.cta-box h3 {
  margin: 0 0 8px;
  color: var(--teal-darker);
  font-size: 1.5rem;
  font-weight: 800;
}

.cta-box p {
  margin: 0 0 18px;
  color: rgba(8, 31, 58, 0.85);
  font-size: 1rem;
}

/* Site footer */
.site-footer {
  padding: 36px 0;
  background: var(--teal-darker);
  color: rgba(255, 255, 255, 0.78);
  border-top: 4px solid var(--gold);
  font-size: 0.9rem;
}

.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer a {
  color: var(--gold);
  font-weight: 600;
}

.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

/* Breadcrumb and tool page heading */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.85rem;
}

.breadcrumb a {
  color: var(--teal);
  font-weight: 600;
}

.breadcrumb a:hover {
  color: var(--amber);
}

h1.tool-title {
  margin: 0 0 12px;
  color: var(--text);
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 70ch;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.note {
  margin: 16px 0;
  padding: 14px 16px;
  background: rgba(16, 185, 129, 0.1);
  border-left: 4px solid var(--amber);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Related tools */
.related-tools {
  margin-top: 40px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.related-tools h2 {
  margin-bottom: 16px;
  color: var(--teal-dark);
  font-size: 1.25rem;
  font-weight: 700;
}

.related-tools h2::before {
  display: none;
}

.related-tools ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-tools a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--offwhite);
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
}

.related-tools a:hover {
  background: var(--amber);
  color: var(--teal-darker);
}

/* Responsive header */
@media (max-width: 760px) {
  .site-header .wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-header nav {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .wrap {
    padding-left: 18px;
    padding-right: 18px;
  }

  .card {
    padding: 18px;
  }

  .hero {
    padding: 56px 0 64px;
  }
}

/* Print styles */
@media print {
  .site-header,
  .site-footer,
  .cta-box,
  .breadcrumb,
  .no-print {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .wrap {
    max-width: 100%;
    padding: 0;
  }

  .card,
  .tool-card,
  .results,
  .cta-box {
    box-shadow: none;
    border-color: #ddd;
    background: #fff;
    color: #000;
  }

  .results .big {
    color: #000;
  }

  .results td {
    color: #000;
    border-color: #ddd;
  }

  a,
  h1.tool-title,
  h2,
  h3 {
    color: #000 !important;
  }

  .btn,
  .brand-icon {
    background: #000;
    color: #fff;
  }

  .hero {
    background: #f0f0f0;
    color: #000;
  }

  .hero h1,
  .hero p {
    color: #000;
  }

  .hero::before,
  .hero::after {
    display: none;
  }
}
/* Ad slots (Adsterra) + house fallback */
.nn-ad{margin:22px auto;text-align:center;display:flex;flex-direction:column;align-items:center;max-width:100%;overflow:hidden}
.nn-ad iframe{max-width:100%}
.nn-ad-label{font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:#9aa5a1;margin-bottom:6px}
.nn-house{display:block;max-width:728px;width:100%;padding:18px 20px;border:1px dashed var(--amber,#10b981);border-radius:12px;background:#ecf8f2;color:#0f1e2e;text-decoration:none}
.nn-house strong{display:block;font-size:1.05rem;margin-bottom:4px;color:#0b6e4f}
.nn-house span{font-size:.9rem;color:#52677a}
