/* CalcMyProject — Shared Stylesheet */

:root {
  --primary:       #1e40af;
  --primary-dark:  #1e3a8a;
  --primary-mid:   #1d4ed8;
  --primary-light: #3b82f6;
  --primary-pale:  #eff6ff;
  --text:          #1e293b;
  --text-muted:    #64748b;
  --border:        #e2e8f0;
  --bg:            #ffffff;
  --card-bg:       #f8fafc;
  --result-bg:     #f0fdf4;
  --result-border: #bbf7d0;
  --result-text:   #166534;
  --result-mid:    #15803d;
  --warn-bg:       #fffbeb;
  --warn-border:   #f59e0b;
  --warn-dark:     #92400e;
  --warn-text:     #78350f;
  --radius:        8px;
  --shadow:        0 1px 3px rgba(0,0,0,0.09), 0 1px 2px rgba(0,0,0,0.06);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}

/* ── Header ───────────────────────────────────────────── */
header {
  background: var(--primary);
  padding: 0.875rem 1.5rem;
}
.header-inner {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo span { color: #93c5fd; }
.tagline {
  font-size: 0.8rem;
  color: #bfdbfe;
}

/* ── Nav ──────────────────────────────────────────────── */
nav {
  background: var(--primary-dark);
  padding: 0 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav-inner {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  overflow-x: auto;
}
nav a {
  display: inline-block;
  color: #93c5fd;
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.65rem 0.875rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.12s, border-color 0.12s;
}
nav a:hover, nav a.active {
  color: #fff;
  border-bottom-color: #60a5fa;
}

/* ── Hero (homepage only) ─────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
  color: #fff;
  padding: 3.5rem 1.5rem 3rem;
  text-align: center;
}
.hero h1 {
  color: #fff;
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
.hero p {
  font-size: 1.1rem;
  opacity: 0.88;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ── Main layout ─────────────────────────────────────── */
main {
  max-width: 880px;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 3rem;
}

/* ── Page header (calculator pages) ─────────────────── */
.page-header { margin-bottom: 1.75rem; }
.page-header h1 {
  font-size: 1.9rem;
  font-weight: 800;
  margin-bottom: 0.375rem;
  letter-spacing: -0.02em;
}
.page-intro { color: var(--text-muted); font-size: 1.025rem; }

/* ── Calculator card ─────────────────────────────────── */
.calc-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.125rem;
  margin-bottom: 1.375rem;
}
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }

label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}
.label-hint {
  font-size: 0.775rem;
  color: var(--text-muted);
  font-weight: 400;
}

input[type="number"], select {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  width: 100%;
  -moz-appearance: textfield;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
input[type="number"]:focus, select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.calc-btn {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 0.12s, transform 0.08s;
}
.calc-btn:hover { background: var(--primary-mid); }
.calc-btn:active { transform: scale(0.99); }

/* ── Results ─────────────────────────────────────────── */
.results {
  margin-top: 1.375rem;
  padding: 1.25rem 1.5rem;
  background: var(--result-bg);
  border: 1px solid var(--result-border);
  border-radius: var(--radius);
  display: none;
}
.results.show { display: block; }

.results-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--result-text);
  margin-bottom: 1rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem 1.5rem;
}
.result-item { display: flex; flex-direction: column; gap: 0.15rem; }
.result-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--result-text);
  line-height: 1.1;
}
.result-label {
  font-size: 0.78rem;
  color: var(--result-mid);
  font-weight: 500;
}

/* ── Content sections ────────────────────────────────── */
.content-section { margin-bottom: 2.25rem; }

.content-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
}
.content-section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.25rem 0 0.4rem;
}
.content-section p {
  color: #374151;
  margin-bottom: 0.7rem;
  line-height: 1.72;
}
.content-section ul, .content-section ol {
  padding-left: 1.4rem;
  color: #374151;
  margin-bottom: 0.7rem;
  line-height: 1.72;
}
.content-section li { margin-bottom: 0.3rem; }

/* ── Cost table ──────────────────────────────────────── */
.cost-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0.875rem 0 1rem;
}
.cost-table th {
  background: var(--primary-pale);
  color: var(--primary);
  font-weight: 700;
  padding: 0.55rem 0.875rem;
  text-align: left;
  border-bottom: 2px solid #bfdbfe;
  white-space: nowrap;
}
.cost-table td {
  padding: 0.55rem 0.875rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.cost-table tr:last-child td { border-bottom: none; }
.cost-table tr:nth-child(even) td { background: var(--card-bg); }

/* ── Contractor note ─────────────────────────────────── */
.contractor-note {
  background: var(--warn-bg);
  border-left: 4px solid var(--warn-border);
  padding: 0.9rem 1.125rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.25rem 0;
}
.contractor-note strong {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--warn-dark);
  margin-bottom: 0.3rem;
}
.contractor-note p {
  color: var(--warn-text) !important;
  font-size: 0.925rem;
  line-height: 1.6;
  margin: 0 !important;
}

/* ── Homepage calc grid ──────────────────────────────── */
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-light);
  margin-bottom: 0.5rem;
}
.section-title {
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.section-intro { color: var(--text-muted); margin-bottom: 1.75rem; }

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.125rem;
}
.calc-card-link {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.1s;
}
.calc-card-link:hover {
  border-color: var(--primary-light);
  box-shadow: 0 4px 14px rgba(30,64,175,0.12);
  transform: translateY(-2px);
}
.calc-card-link .icon {
  font-size: 1.75rem;
  margin-bottom: 0.7rem;
  display: block;
}
.calc-card-link h3 {
  font-size: 1.025rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: var(--primary);
}
.calc-card-link p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.calc-card-link .arrow {
  font-size: 0.8rem;
  color: var(--primary-light);
  margin-top: 0.75rem;
  display: block;
  font-weight: 600;
}

.about-strip {
  background: var(--primary-pale);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-top: 2.5rem;
}
.about-strip h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.4rem;
}
.about-strip p {
  color: #1e40af;
  font-size: 0.925rem;
  line-height: 1.65;
}

/* ── Footer ──────────────────────────────────────────── */
footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 1.75rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
footer a { color: var(--primary-light); text-decoration: none; }
footer a:hover { text-decoration: underline; }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 620px) {
  .hero h1 { font-size: 1.75rem; }
  .page-header h1 { font-size: 1.55rem; }
  .calc-card { padding: 1.125rem; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .result-value { font-size: 1.4rem; }
  nav a { padding: 0.6rem 0.6rem; font-size: 0.825rem; }
}
@media (max-width: 400px) {
  .form-grid { grid-template-columns: 1fr; }
}
