:root {
  --bg: #f4f5f7;
  --bg-alt: #ffffff;
  --primary: #0057b8;
  --primary-dark: #003f82;
  --accent: #f39c12;
  --text-main: #222222;
  --text-muted: #666666;
  --border-soft: #dde1e7;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.08);
  --max-width: 1200px;
  --transition-fast: 0.18s ease-in-out;
  --danger: #c0392b;
  --success: #2e7d32;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #e5f1ff, #f4f5f7);
  color: var(--text-main);
  line-height: 1.6;
}

/* HEADER */

.site-header {
  background: linear-gradient(135deg, #0f172a, #1f2937);
  color: #ffffff;
  box-shadow: var(--shadow-soft);
  margin-bottom: 1rem;
}

.top-bar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: center;
}

.branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.site-title {
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.03em;
}

.site-subtitle {
  font-size: 0.85rem;
  opacity: 0.85;
}

.contact-block {
  text-align: right;
  font-size: 0.9rem;
}

.contact-line {
  white-space: nowrap;
}

.contact-label {
  opacity: 0.8;
  margin-right: 0.25rem;
}

.contact-value {
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
}

.contact-value:hover {
  text-decoration: underline;
}

.email-visible {
  color: #f9fafb;
}

/* Construction banner */

.construction-banner {
  background: linear-gradient(90deg, #f97316, #facc15);
  color: #111827;
  text-align: center;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

/* MAIN NAV */

.main-nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.3rem 1.25rem 0.7rem;
  display: flex;
  align-items: center;
  position: relative;
}

.nav-toggle {
  display: none;
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.nav-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  margin: 0;
}

.nav-links a {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  text-decoration: none;
  color: #e5e7eb;
  border: 1px solid transparent;
  transition: var(--transition-fast);
}

.nav-links a:hover {
  border-color: rgba(209, 213, 219, 0.7);
  background: rgba(15, 23, 42, 0.5);
}

/* LAYOUT */

.layout {
  max-width: var(--max-width);
  margin: 0 auto 2rem;
  padding: 1rem 1.25rem 2rem;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 230px;
  gap: 1rem;
}

/* SIDE BARS */

.sidebar {
  align-self: flex-start;
  position: sticky;
  top: 120px;
}

.sidebar-title {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav a {
  display: block;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.15rem;
  border-radius: 999px;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.4);
  transition: var(--transition-fast);
}

.sidebar-nav a:hover {
  background: #e5f1ff;
  border-color: var(--primary);
}

.sidebar-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg);
  padding: 0.9rem;
  box-shadow: var(--shadow-soft);
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-soft);
}

.sidebar-card h3 {
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.sidebar-card p {
  margin: 0.2rem 0;
  font-size: 0.88rem;
}

.sidebar-cta {
  margin-top: 0.5rem;
  margin-bottom: 0.8rem;
}

.sidebar-steps {
  margin: 0.3rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.88rem;
}

/* MAIN CONTENT */

.content {
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem 1.7rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
}

.page-title {
  margin-top: 0;
  margin-bottom: 0.3rem;
  font-size: 1.5rem;
}

.page-subtitle {
  margin-top: 0;
  margin-bottom: 1.1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* FORMS */

.calculator-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  padding: 1rem;
  margin-bottom: 1rem;
  background: #f9fafb;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.8rem 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.form-group label {
  font-size: 0.86rem;
  font-weight: 600;
}

.form-group small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
  outline: none;
  background: #ffffff;
}

.form-group textarea {
  border-radius: 10px;
  min-height: 80px;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

/* BUTTONS */

.btn {
  display: inline-block;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: var(--transition-fast);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: #e5e7eb;
  color: #111827;
}

.btn-secondary:hover {
  background: #d1d5db;
}

.btn-full {
  width: 100%;
}

/* RESULTS BLOCKS */

.results-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  padding: 0.9rem;
  background: #ffffff;
  margin-top: 0.75rem;
}

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

.result-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.result-value {
  font-weight: 700;
  font-size: 1rem;
}

/* TABLES (for projections) */

.simple-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  font-size: 0.86rem;
}

.simple-table th,
.simple-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: right;
}

.simple-table th:first-child,
.simple-table td:first-child {
  text-align: left;
}

.simple-table thead {
  background: #eef2ff;
}

/* FOOTER */

.site-footer {
  background: #0f172a;
  color: #e5e7eb;
  padding: 1.5rem 1.25rem 1.25rem;
}

.footer-columns {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr;
  gap: 1.1rem;
  font-size: 0.85rem;
}

.footer-col h4 {
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 0.25rem;
}

.footer-col a {
  color: #e5e7eb;
  text-decoration: none;
}

.footer-col a:hover {
  text-decoration: underline;
}

.footer-small {
  margin: 0.2rem 0;
  font-size: 0.78rem;
  color: #cbd5f5;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 1rem auto 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8rem;
}

/* UTILITIES */

.text-danger {
  color: var(--danger);
}

.text-success {
  color: var(--success);
}

.muted {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* RESPONSIVE */

@media (max-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    order: 2;
  }

  .sidebar-right {
    order: 3;
  }

  .content {
    order: 1;
  }

  .footer-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .contact-block {
    text-align: left;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: 0.5rem;
  }

  .nav-links.nav-open {
    display: flex;
  }

  .nav-links a {
    width: 100%;
    text-align: left;
    padding-left: 0;
  }

  .layout {
    padding-inline: 0.75rem;
  }

  .content {
    padding: 1rem;
  }
}
