/* ============================================================
   BMIT Tools — Shared Shell Styles
   Brand: bostonmit.com | "Boston Navy" design system
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap');

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

:root {
  /* Brand palette */
  --color-navy:       #0f1c2e;
  --color-navy-mid:   #1a2e47;
  --color-blue:       #2563eb;
  --color-blue-dark:  #1d4ed8;
  --color-blue-light: #3b82f6;
  --color-blue-glow:  rgba(37, 99, 235, 0.18);
  --color-bmit-green:       #40B87E;
  --color-bmit-green-dark:  #329c68;
  --color-bmit-green-light: #5ecb93;
  --color-bmit-green-glow:  rgba(64, 184, 126, 0.18);

  /* UI palette */
  --color-bg:         #f0f5fb;
  --color-surface:    #ffffff;
  --color-border:     #dce5f0;
  --color-border-mid: #b4c7df;
  --color-text:       #0f1c2e;
  --color-muted:      #5a7394;

  /* Status colors */
  --color-green:  #059669;
  --color-orange: #d97706;
  --color-red:    #dc2626;

  /* Grade colors */
  --grade-A: #059669;
  --grade-B: #65a30d;
  --grade-C: #d97706;
  --grade-D: #ea580c;
  --grade-F: #dc2626;

  /* Elevation */
  --shadow-sm: 0 1px 3px rgba(15, 28, 46, 0.08);
  --shadow-md: 0 4px 16px rgba(15, 28, 46, 0.10);
  --shadow-lg: 0 8px 32px rgba(15, 28, 46, 0.12);

  /* Shape */
  --radius:    10px;
  --radius-sm: 6px;
  --radius-lg: 16px;

  --header-height: 50px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-bmit-green-dark);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* --- Site Header ------------------------------------------ */
.site-header {
  background: var(--color-navy);
  color: #ffffff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--color-bmit-green);
}

/* Logo — image injected by shell.js */
.site-header .logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  opacity: 0.92;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.site-header .logo:hover { opacity: 1; text-decoration: none; }

.site-header .logo img {
  display: block;
  height: 26px;
  width: auto;
}

.site-header .header-divider {
  width: 1px;
  height: 18px;
  background: rgba(255,255,255,0.14);
  flex-shrink: 0;
}

.site-header .site-title {
  color: rgba(255,255,255,0.45);
  font-size: 0.82rem;
  font-weight: 400;
  white-space: nowrap;
}

/* Spacer pushes nav to the right */
.site-header .header-spacer { flex: 1; }

/* --- Site Nav --------------------------------------------- */
.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.site-nav a {
  color: rgba(255,255,255,0.60);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 5px;
  transition: color 0.15s, background 0.15s;
}

.site-nav a:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.07);
  text-decoration: none;
}

/* CTA link in nav */
.site-nav a.nav-cta {
  color: #ffffff;
  background: var(--color-bmit-green);
  border: 1px solid var(--color-bmit-green);
  padding: 4px 12px;
  border-radius: 5px;
}

.site-nav a.nav-cta:hover {
  background: var(--color-bmit-green-dark);
  border-color: var(--color-bmit-green-dark);
  color: #ffffff;
}

/* --- Hamburger — hidden, nav is minimal enough to not need it */
.hamburger { display: none; }

/* --- Main Content ----------------------------------------- */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  position: relative;
}

/* --- Site Footer ------------------------------------------ */
.site-footer {
  background: var(--color-navy);
  color: rgba(255,255,255,0.45);
  font-size: 0.85rem;
  text-align: center;
  padding: 24px;
  margin-top: 64px;
}

.site-footer a {
  color: rgba(255,255,255,0.55);
  transition: color 0.15s;
}

.site-footer a:hover {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
}

.site-footer .footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* --- Buttons ---------------------------------------------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--color-bmit-green);
  color: #ffffff;
  padding: 11px 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.925rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(64, 184, 126, 0.30);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--color-bmit-green-dark);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(64, 184, 126, 0.40);
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--color-surface);
  color: var(--color-blue);
  padding: 10px 22px;
  border: 1.5px solid var(--color-blue);
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.925rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: var(--color-blue);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
}

/* --- Form Inputs ------------------------------------------ */
.form-input {
  display: block;
  width: 100%;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  color: var(--color-text);
  background: var(--color-surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
  border-color: var(--color-bmit-green);
  box-shadow: 0 0 0 3px var(--color-bmit-green-glow);
}

.form-input::placeholder {
  color: var(--color-muted);
  opacity: 0.7;
}

/* --- Card ------------------------------------------------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

/* --- Score Badge ------------------------------------------ */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  min-width: 64px;
  min-height: 64px;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.grade-A { background: var(--grade-A); }
.grade-B { background: var(--grade-B); }
.grade-C { background: var(--grade-C); }
.grade-D { background: var(--grade-D); }
.grade-F { background: var(--grade-F); }

.score-badge.score-sm {
  font-size: 1.1rem;
  min-width: 38px;
  min-height: 38px;
  padding: 4px 8px;
  border-radius: 5px;
}

/* --- Tool Header ------------------------------------------ */
.tool-header {
  margin-bottom: 28px;
}

.tool-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.tool-header .tagline {
  color: var(--color-muted);
  font-size: 1rem;
  font-weight: 400;
}

/* --- Tool Section ----------------------------------------- */
.tool-section {
  border-top: 1px solid var(--color-border);
  padding-top: 28px;
  margin-top: 28px;
}

.tool-section h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

/* --- Check Items ------------------------------------------ */
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.check-item:last-child { border-bottom: none; }

.check-item .check-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 2px;
  width: 20px;
  text-align: center;
}

.check-item .check-name {
  font-weight: 600;
  font-size: 0.95rem;
  flex: 1;
}

.check-item .check-summary {
  font-size: 0.875rem;
  color: var(--color-muted);
  flex: 2;
}

.check-item.pass .check-icon { color: var(--color-green); }
.check-item.warn .check-icon { color: var(--color-orange); }
.check-item.fail .check-icon { color: var(--color-red); }
.check-item.fail .check-name { color: var(--color-red); }

/* --- Related Tools Grid ----------------------------------- */
.related-tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.related-tools .card {
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.18s, border-color 0.18s, transform 0.15s;
  display: block;
}

.related-tools .card:hover {
  border-color: var(--color-bmit-green);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--color-bmit-green);
  transform: translateY(-2px);
  text-decoration: none;
}

.related-tools .card .tool-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-bmit-green-dark);
  margin-bottom: 4px;
}

.related-tools .card .tool-tagline {
  font-size: 0.8rem;
  color: var(--color-muted);
  line-height: 1.4;
}

/* --- Error Banner ----------------------------------------- */
.error-banner {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 10px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* --- Utility ---------------------------------------------- */
.text-muted  { color: var(--color-muted); }
.text-pass   { color: var(--color-green); }
.text-warn   { color: var(--color-orange); }
.text-fail   { color: var(--color-red); }

.mono {
  font-family: 'IBM Plex Mono', 'Roboto Mono', monospace;
  font-size: 0.9em;
}

/* --- Mobile (≤640px) -------------------------------------- */
@media (max-width: 640px) {
  .site-header {
    padding: 0 16px;
  }

  .site-header .site-title {
    display: none;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-navy);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 8px 24px rgba(0,0,0,0.30);
    z-index: 99;
  }

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

  .site-nav a {
    padding: 12px 20px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }

  .hamburger { display: flex; }

  main { padding: 20px 16px 40px; }

  .related-tools { grid-template-columns: 1fr; }

  .score-badge {
    font-size: 1.5rem;
    min-width: 52px;
    min-height: 52px;
  }

  .check-item { flex-wrap: wrap; }

  .check-item .check-summary {
    flex: 1 1 100%;
    padding-left: 32px;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .related-tools { grid-template-columns: repeat(2, 1fr); }
}
