/* ================================================
   ASBESTOS REGISTER UK — Design System
   Dark navy + amber/safety palette
   Mobile-first, institutional, trustworthy
   ================================================ */

:root {
  --primary: #1a3a5c;
  --primary-dark: #0f2640;
  --accent: #d4922a;
  --accent-light: #f5deb3;
  --cta: #2563eb;
  --cta-hover: #1d4ed8;
  --verified: #16a34a;
  --verified-bg: #dcfce7;
  --bg: #f8f9fa;
  --bg-white: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
}

/* ================================================
   RESET & BASE
   ================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cta); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.3; color: var(--primary); }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 600; margin-bottom: 1rem; }
h3 { font-size: 1.1rem; font-weight: 600; }

img { max-width: 100%; height: auto; }

/* ================================================
   LAYOUT
   ================================================ */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

.section {
  padding: 2rem 0;
}

.section + .section {
  border-top: 1px solid var(--border);
}

.content-block p {
  margin-bottom: 1rem;
  max-width: 75ch;
}

.content-page {
  background: var(--bg-white);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 2rem 0;
}

.content-page h2 { margin-top: 1.5rem; }
.content-page ul { margin: 0.5rem 0 1rem 1.5rem; }

/* ================================================
   NAV
   ================================================ */

.nav {
  background: var(--primary);
  color: #fff;
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

.nav-shield {
  background: var(--accent);
  color: var(--primary-dark);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 1.1rem;
  font-weight: 800;
}

.nav-logo .dot { color: var(--accent); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.25rem;
}

.nav-links a {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  text-decoration: none;
}

.nav-links a:hover { color: #fff; text-decoration: none; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary-dark);
    padding: 1rem;
    gap: 0.75rem;
  }
  .nav-links.open { display: flex; }
}

/* ================================================
   BREADCRUMB
   ================================================ */

.breadcrumb {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 1100px;
  margin: 0 auto;
}

.breadcrumb a { color: var(--cta); }
.breadcrumb .sep { margin: 0 0.35rem; }

/* ================================================
   HERO
   ================================================ */

.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 3rem 1rem;
  text-align: center;
}

.hero-inner {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  color: #fff;
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.hero-sub {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat strong {
  font-size: 1.75rem;
  color: var(--accent);
}

.stat span {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* ================================================
   PAGE HEADER
   ================================================ */

.page-header {
  padding: 2rem 0 1rem;
}

.page-header h1 { margin-bottom: 0.5rem; }
.page-header p { color: var(--text-muted); }

/* ================================================
   CARD GRID
   ================================================ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.card-grid.contractors {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* ================================================
   REGION / COUNTY CARDS
   ================================================ */

.region-card,
.county-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.region-card:hover,
.county-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  text-decoration: none;
}

.region-card h3,
.county-card h3 {
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.counties-list {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ================================================
   LICENCE TYPE CARDS
   ================================================ */

.licence-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.licence-type-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  text-align: center;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.licence-type-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  text-decoration: none;
}

.licence-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.licence-type-card h3 { margin-bottom: 0.5rem; }
.licence-type-card p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.5rem; }

/* ================================================
   CONTRACTOR CARDS
   ================================================ */

.contractor-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.contractor-card-top {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.contractor-icon {
  width: 48px;
  height: 48px;
  background: var(--bg);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.contractor-info h3 {
  font-size: 1rem;
  margin-bottom: 0.15rem;
}

.contractor-info h3 a {
  color: var(--primary);
  text-decoration: none;
}

.contractor-info h3 a:hover { color: var(--cta); }

.location {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Badges */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.badge-standard {
  background: var(--verified-bg);
  color: var(--verified);
}

.badge-scaffolding {
  background: #fef3c7;
  color: #92400e;
}

.badge-maintenance {
  background: #e0e7ff;
  color: #3730a3;
}

/* Rating */
.contractor-rating,
.detail-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.stars { color: var(--accent); font-size: 1rem; }
.rating-text { font-size: 0.85rem; }

/* Licence row */
.licence-row {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* Actions */
.contractor-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  min-height: 48px; /* touch target */
}

.btn-phone {
  background: var(--cta);
  color: #fff;
}

.btn-phone:hover {
  background: var(--cta-hover);
  text-decoration: none;
}

.btn-outline {
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  text-decoration: none;
}

.btn-primary {
  background: var(--cta);
  color: #fff;
}

.btn-primary:hover {
  background: var(--cta-hover);
  text-decoration: none;
}

/* ================================================
   CONTRACTOR DETAIL PAGE
   ================================================ */

.contractor-detail {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 1rem 0 2rem;
  box-shadow: var(--shadow);
}

.detail-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.detail-icon {
  width: 56px;
  height: 56px;
  background: var(--bg);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.detail-header h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.detail-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
}

.detail-table th,
.detail-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.detail-table th {
  width: 40%;
  color: var(--text-muted);
  font-weight: 500;
}

.contact-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.contact-item span:first-child { width: 1.25rem; text-align: center; }

/* ================================================
   COMPARISON TABLE
   ================================================ */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.compare-table th,
.compare-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  white-space: nowrap;
}

.compare-table th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.compare-table tr:hover { background: #f1f5f9; }
.compare-table a { text-decoration: none; }
.compare-table a:hover { text-decoration: underline; }

/* ================================================
   FAQ
   ================================================ */

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  background: var(--bg-white);
}

.faq-item summary {
  padding: 0.75rem 1rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::after { content: '+'; font-size: 1.25rem; color: var(--text-muted); }
.faq-item[open] summary::after { content: '\2212'; }

.faq-answer {
  padding: 0 1rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.faq-answer p { margin-bottom: 0.5rem; }

/* ================================================
   ERROR PAGE
   ================================================ */

.error-page {
  text-align: center;
  padding: 4rem 1rem;
}

.error-page h1 {
  font-size: 4rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.error-page p {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

/* ================================================
   FOOTER
   ================================================ */

.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.7);
  padding: 1.5rem 1rem;
  margin-top: 3rem;
  font-size: 0.85rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer a {
  color: rgba(255,255,255,0.85);
}

.footer a:hover {
  color: #fff;
}

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 640px) {
  h1 { font-size: 1.4rem; }
  .hero { padding: 2rem 1rem; }
  .hero h1 { font-size: 1.6rem; }
  .hero-stats { gap: 1.25rem; }
  .stat strong { font-size: 1.4rem; }
  .card-grid { grid-template-columns: 1fr; }
  .licence-type-grid { grid-template-columns: 1fr; }
  .contractor-detail { padding: 1.25rem; }
  .detail-table th { width: 35%; }
  .footer-inner { flex-direction: column; text-align: center; }
  .compare-table th,
  .compare-table td { padding: 0.5rem; font-size: 0.8rem; }
}
