/* North West Gas Compliance – Fault Codes Tool
   Styled to match nwgc.uk */

:root {
  --navy: #0f172a;
  --navy-light: #1e293b;
  --green: #059669;
  --green-bright: #10b981;
  --green-dark: #047857;
  --slate: #64748b;
  --slate-light: #94a3b8;
  --off-white: #f8fafc;
  --white: #ffffff;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, 0.12);
  --radius: 12px;
  --transition: 0.25s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--navy);
  background: var(--off-white);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* Header */
.site-header {
  background: var(--navy);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

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

.brand img.logo { height: 48px; width: auto; }

.brand-text strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--green-bright);
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 0.7rem;
  color: var(--slate-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 0.5rem;
}

.main-nav a {
  padding: 0.5rem 0.75rem;
  color: var(--white);
  font-weight: 500;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}

.main-nav a:hover, .main-nav a.active {
  background: rgba(16, 185, 129, 0.18);
  color: var(--green-bright);
}

/* Main */
main { flex: 1; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.page-header {
  background: var(--navy);
  color: var(--white);
  padding: 2.25rem 1.25rem;
  text-align: center;
}

.page-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-header p {
  color: var(--slate-light);
  margin-top: 0.4rem;
}

.section { padding: 2.5rem 0; }

.content-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

/* Search */
.search-box { margin: 1.5rem auto; max-width: 600px; text-align: center; }

#search {
  width: 100%;
  padding: 0.85rem 1.1rem;
  font-size: 1.05rem;
  border: 2px solid var(--navy);
  border-radius: 8px;
  box-sizing: border-box;
}

#search:focus {
  outline: none;
  border-color: var(--green);
}

/* Buttons / brand cards */
.buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  margin: 2rem auto;
  max-width: 1100px;
}

.btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  width: 180px;
  height: 160px;
  padding: 1rem;
  background: var(--white);
  color: var(--navy);
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow);
  border: 2px solid #e2e8f0;
}

.btn:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--green);
}

.btn img {
  max-width: 140px;
  max-height: 70px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

/* Manufacturer website button under title */
.manu-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin: 1.25rem 0 1.5rem;
}

.manu-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  width: 200px;
  padding: 1rem 1.25rem;
  background: var(--white);
  color: var(--navy);
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow);
  border: 2px solid #e2e8f0;
}

.manu-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--green);
}

.manu-btn img {
  max-width: 140px;
  max-height: 60px;
  object-fit: contain;
  margin-bottom: 0.4rem;
}

.manu-btn span {
  font-size: 0.85rem;
  color: var(--slate);
  font-weight: 500;
}

.back-brands {
  color: var(--green);
  font-weight: 600;
  font-size: 0.95rem;
}

.back-brands:hover {
  color: var(--green-dark);
  text-decoration: underline;
}


/* Responsive tables */
.container table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  background: var(--white);
  margin: 1.5rem 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

th, td {
  border: none;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.85rem 1rem;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #0f172a;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 1rem;
}

th:last-child, td:last-child {
  text-align: center;
  width: 100px;
  min-width: 80px;
}

tbody tr:nth-child(odd) { background: #fff; }
tbody tr:nth-child(even) { background: #f1f5f9; }
tbody tr:hover { background: #e0f2fe; }

td:first-child {
  font-weight: 600;
  color: #0f172a;
}

/* Note */
.note {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin: 1.25rem 0;
}

/* Results */
.results {
  max-width: 900px;
  margin: 1.5rem auto;
  background: var(--white);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  text-align: left;
}

.result {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.result:last-child { border-bottom: none; }

.result strong { color: var(--navy); }

.section-tag {
  display: inline-block;
  background: rgba(16, 185, 129, 0.12);
  color: var(--green-dark);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.no-results { color: var(--slate); font-style: italic; text-align: center; padding: 1.5rem; }

/* Footer */
.site-footer {
  background: var(--navy);
  color: var(--slate-light);
  padding: 2rem 1.25rem 1.5rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  font-weight: 700;
  color: var(--green-bright);
  font-size: 1.05rem;
}

.footer-contact a {
  color: var(--slate-light);
  display: block;
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.footer-contact a:hover { color: var(--green-bright); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1rem;
  margin-top: 1rem;
  font-size: 0.85rem;
}

.back-link {
  display: inline-block;
  margin: 1rem 0;
  color: var(--green);
  font-weight: 600;
}

.back-link:hover { color: var(--green-dark); text-decoration: underline; }

/* Mobile */

/* Tick boxes */
.tick-cell { text-align: center; }
.tick-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 2px solid #dc2626;
  border-radius: 6px;
  background: #fff;
  color: #dc2626;
  font-weight: bold;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tick-box:hover { transform: scale(1.1); }
.tick-box.ticked {
  border-color: #16a34a;
  background: #16a34a;
  color: #fff;
}

@media (max-width: 640px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 0.6rem 1rem;
    gap: 0.5rem;
  }

  .brand img.logo { height: 40px; }

  .brand-text { display: none; }

  .main-nav {
    width: 100%;
    order: 3;
  }

  .main-nav ul {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .main-nav a {
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
  }

  .buttons {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .btn {
    width: 100%;
    max-width: 280px;
    height: auto;
    min-height: 140px;
    padding: 1.25rem;
  }

  .btn img {
    max-height: 60px;
  }

  .page-header {
    padding: 1.75rem 1rem;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }
}

@media (min-width: 640px) {
  .brand-text { display: block; }
}
