/* ===== SHARED STYLES — freefinancialtoolkit.com ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0e0c;
  --surface: #1a1916;
  --surface2: #242320;
  --border: #2e2c28;
  --gold: #c9a84c;
  --gold-light: #e8c96a;
  --gold-dim: rgba(201,168,76,0.12);
  --text: #f0ede6;
  --text-muted: #8a8677;
  --text-dim: #5a5750;
  --green: #4caf78;
  --red: #e05c5c;
  --radius: 12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* NAV */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15,14,12,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.nav-logo span { color: var(--text-muted); font-style: italic; }

.nav-links { display: flex; gap: 1.5rem; list-style: none; }
.nav-links a {
  color: var(--text-muted); text-decoration: none;
  font-size: 0.875rem; font-weight: 500; transition: color 0.2s;
}
.nav-links a:hover { color: var(--gold); }

/* AD SLOT */
.ad-slot {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 1.5rem auto;
  max-width: 728px;
  min-height: 90px;
  display: flex; align-items: center; justify-content: center;
}

/* CALCULATOR LAYOUT */
.calc-wrapper {
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 2rem 6rem;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb span { margin: 0 0.4rem; }

.calc-header { margin-bottom: 2rem; }
.calc-header h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}
.calc-header p { color: var(--text-muted); font-size: 1rem; }

/* FORM */
.calc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.25rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group.full { grid-column: 1 / -1; }

label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.input-wrap { position: relative; display: flex; align-items: center; }
.input-prefix {
  position: absolute; left: 0.875rem;
  color: var(--text-dim); font-size: 0.95rem; pointer-events: none;
}

input[type="number"], input[type="text"], select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.875rem;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.has-prefix input { padding-left: 1.75rem; }
input:focus, select:focus { outline: none; border-color: var(--gold); }

select {
  cursor: pointer; 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='%238a8677' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.calc-btn {
  width: 100%;
  background: var(--gold);
  color: #0f0e0c;
  border: none; border-radius: 8px;
  padding: 0.9rem 1.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 1.25rem;
}
.calc-btn:hover { background: var(--gold-light); transform: translateY(-1px); }
.calc-btn:active { transform: translateY(0); }

/* RESULTS */
.results-card {
  background: var(--surface);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: var(--radius);
  padding: 2rem;
  display: none;
  margin-bottom: 1.25rem;
}
.results-card.show { display: block; animation: fadeUp 0.3s ease; }

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

.results-title {
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1.5rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.result-item .r-label {
  font-size: 0.72rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.25rem;
}
.result-item .r-value {
  font-family: 'DM Serif Display', serif;
  font-size: 1.6rem; color: var(--text); letter-spacing: -0.02em;
}
.result-item .r-value.highlight { color: var(--gold); }
.result-item .r-value.green { color: var(--green); }
.result-item .r-value.red { color: var(--red); }

.result-divider { height: 1px; background: var(--border); margin: 1.25rem 0; }

/* TABLE */
.table-wrap {
  overflow-x: auto; border-radius: 8px;
  border: 1px solid var(--border); margin-top: 1rem;
}
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th {
  background: var(--surface2); padding: 0.6rem 1rem;
  text-align: left; color: var(--text-muted);
  font-weight: 600; font-size: 0.72rem;
  letter-spacing: 0.06em; text-transform: uppercase;
}
td { padding: 0.6rem 1rem; border-top: 1px solid var(--border); color: var(--text); }
tr:hover td { background: var(--surface2); }

/* SEO CONTENT */
.seo-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  margin-top: 2rem;
}
.seo-content h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem; letter-spacing: -0.02em;
  margin-bottom: 1rem; color: var(--text);
}
.seo-content h3 {
  font-size: 1rem; font-weight: 600;
  color: var(--gold); margin: 1.5rem 0 0.5rem;
}
.seo-content p {
  color: var(--text-muted); font-size: 0.95rem;
  line-height: 1.8; margin-bottom: 1rem;
}
.seo-content ul {
  color: var(--text-muted); font-size: 0.95rem;
  line-height: 1.8; padding-left: 1.5rem; margin-bottom: 1rem;
}
.seo-content li { margin-bottom: 0.3rem; }
.faq-item { margin-bottom: 1.5rem; }
.faq-q {
  font-weight: 600; color: var(--text);
  margin-bottom: 0.4rem; font-size: 0.95rem;
}
.faq-a { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; }

/* RELATED TOOLS */
.related-tools {
  margin-top: 2rem;
}
.related-tools h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem; margin-bottom: 1rem;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.related-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  text-decoration: none; color: var(--text);
  font-size: 0.875rem; font-weight: 500;
  transition: border-color 0.2s, transform 0.2s;
  display: flex; align-items: center; gap: 0.6rem;
}
.related-card:hover {
  border-color: rgba(201,168,76,0.4);
  transform: translateY(-2px);
}

/* FOOTER */
footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-dim); font-size: 0.8rem;
}
footer a { color: var(--text-muted); text-decoration: none; }
footer a:hover { color: var(--gold); }
.footer-links {
  display: flex; justify-content: center; gap: 2rem; margin-bottom: 1rem;
  flex-wrap: wrap;
}

/* RESPONSIVE */
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .calc-wrapper { padding: 1.5rem 1rem 4rem; }
}
