/* ============================================
   ASSURE SAFETY NZ — Custom Styles
   Tailwind CDN handles utilities.
   This file: custom properties, components,
   animations, and overrides.
   ============================================ */

/* --- Brand Tokens --- */
:root {
  --color-primary: #1A1A2E;
  --color-accent: #0E8B8B;
  --color-accent-dark: #0A6E6E;
  --color-accent-light: #E0F5F5;
  --color-light-bg: #F0F7F7;
  --color-white: #FFFFFF;
  --color-text: #2D2D2D;
  --color-muted: #6B7280;
  --color-success: #059669;
  --color-warning: #D97706;
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', 'Open Sans', system-ui, -apple-system, sans-serif;
}

/* --- Skip Link (accessibility) --- */
.skip-link {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
  background: var(--color-accent); color: #fff;
  padding: 0.75rem 1.5rem; font-weight: 600;
  z-index: 1000; border-radius: 0 0 8px 0;
}
.skip-link:focus {
  position: fixed; left: 0; top: 0;
  width: auto; height: auto; overflow: visible;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--color-accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-accent-dark); }

/* --- Navigation --- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: #FFFFFF;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s;
}
.nav.scrolled { box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08); }

.nav-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}

.nav-logo img { height: 44px; width: auto; }

.nav-links { display: flex; gap: 2rem; align-items: center; list-style: none; }
.nav-links a {
  font-size: 0.938rem; font-weight: 500; color: var(--color-text);
  padding: 0.5rem 0; position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 0; height: 2px; background: var(--color-accent);
  transition: width 0.3s;
}
.nav-links a:hover, .nav-links a.active { color: var(--color-accent); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-cta {
  background: var(--color-accent); color: #fff !important;
  padding: 0.625rem 1.5rem; border-radius: 8px;
  font-weight: 600; font-size: 0.875rem;
  transition: background 0.2s, transform 0.2s;
}
.nav-cta:hover { background: var(--color-accent-dark); transform: translateY(-1px); }
.nav-cta::after { display: none !important; }

/* Mobile menu */
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  padding: 0.5rem; color: var(--color-text);
}
.nav-toggle svg { width: 28px; height: 28px; }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; padding: 1rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    gap: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 0.75rem 0; border-bottom: 1px solid #f3f4f6; }
  .nav-links a::after { display: none; }
  .nav-cta { display: block; text-align: center; margin-top: 0.5rem; }
}

/* --- Hero Section --- */
.hero {
  position: relative; min-height: 90vh;
  display: flex; align-items: center;
  background: var(--color-primary);
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0.35;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(26,26,46,0.85) 0%, rgba(14,139,139,0.4) 100%);
}
.hero-content {
  position: relative; z-index: 2;
  max-width: 1280px; margin: 0 auto;
  padding: 8rem 1.5rem 4rem;
}
.hero h1 {
  font-size: clamp(2.25rem, 5vw, 4rem);
  color: #fff; font-weight: 700;
  margin-bottom: 1rem; max-width: 700px;
}
.hero .subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: rgba(255,255,255,0.85);
  max-width: 560px; margin-bottom: 2rem;
  font-family: var(--font-body);
}
.hero .te-reo {
  font-style: italic; color: var(--color-accent-light);
  font-size: 1.125rem; margin-bottom: 2.5rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.875rem 2rem; border-radius: 8px;
  font-weight: 600; font-size: 1rem;
  cursor: pointer; border: none;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-dark); color: #fff; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(14,139,139,0.3); }

.btn-outline { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,0.4); }
.btn-outline:hover { border-color: #fff; color: #fff; transform: translateY(-2px); }

.btn-dark { background: var(--color-primary); color: #fff; }
.btn-dark:hover { background: #12122a; color: #fff; transform: translateY(-2px); }

/* --- Sections --- */
.section {
  padding: 5rem 1.5rem;
}
.section-dark { background: var(--color-primary); color: #fff; }
.section-light { background: var(--color-light-bg); }
.section-white { background: #fff; }

.container { max-width: 1280px; margin: 0 auto; }

.section-header {
  text-align: center; max-width: 700px; margin: 0 auto 3.5rem;
}
.section-header h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  color: var(--color-primary); margin-bottom: 1rem;
}
.section-dark .section-header h2 { color: #fff; }
.section-header p { color: var(--color-muted); font-size: 1.125rem; }
.section-dark .section-header p { color: rgba(255,255,255,0.7); }

.section-label {
  display: inline-block; font-size: 0.8125rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--color-accent); margin-bottom: 0.75rem;
}

/* --- Trust Bar --- */
.trust-bar {
  background: var(--color-accent-light);
  padding: 1.5rem;
}
.trust-bar-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 2.5rem;
}
.trust-item {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.9375rem; font-weight: 500; color: var(--color-primary);
}
.trust-item svg { width: 24px; height: 24px; color: var(--color-accent); flex-shrink: 0; }

/* --- Stats --- */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}
.stat-card {
  text-align: center; padding: 2rem 1rem;
}
.stat-number {
  font-family: var(--font-heading);
  font-size: 3rem; font-weight: 700;
  color: var(--color-accent); line-height: 1;
  margin-bottom: 0.5rem;
}
.section-dark .stat-number { color: var(--color-accent-light); }
.stat-label {
  font-size: 0.9375rem; color: var(--color-muted);
}
.section-dark .stat-label { color: rgba(255,255,255,0.7); }

/* --- Service Cards --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.75rem;
}

.service-card {
  background: #fff; border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
  transition: transform 0.3s, box-shadow 0.3s;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}
.service-card-img {
  height: 200px; overflow: hidden;
}
.service-card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s;
}
.service-card:hover .service-card-img img { transform: scale(1.05); }
.service-card-body { padding: 1.5rem; }
.service-card h3 {
  font-size: 1.25rem; color: var(--color-primary);
  margin-bottom: 0.75rem;
}
.service-card p {
  font-size: 0.9375rem; color: var(--color-muted);
  margin-bottom: 1rem; line-height: 1.6;
}
.service-card .learn-more {
  font-weight: 600; font-size: 0.875rem;
  color: var(--color-accent);
  display: inline-flex; align-items: center; gap: 0.375rem;
}
.service-card .learn-more svg { width: 16px; height: 16px; transition: transform 0.2s; }
.service-card:hover .learn-more svg { transform: translateX(4px); }

/* --- Process Steps --- */
.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  counter-reset: step;
}
.process-step {
  text-align: center; padding: 2rem 1.5rem;
  position: relative;
}
.process-step::before {
  counter-increment: step;
  content: counter(step);
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin: 0 auto 1.25rem;
  background: var(--color-accent);
  color: #fff; font-family: var(--font-heading);
  font-size: 1.5rem; font-weight: 700;
  border-radius: 50%;
}
.process-step h3 {
  font-size: 1.125rem; margin-bottom: 0.75rem;
  color: var(--color-primary);
}
.process-step p { font-size: 0.9375rem; color: var(--color-muted); }

/* --- FAQ / Accordion --- */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item {
  border-bottom: 1px solid #e5e7eb;
}
.faq-question {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 1.25rem 0;
  background: none; border: none; cursor: pointer;
  font-size: 1.0625rem; font-weight: 600;
  color: var(--color-primary); text-align: left;
  font-family: var(--font-body);
}
.faq-question svg {
  width: 20px; height: 20px; flex-shrink: 0;
  transition: transform 0.3s; color: var(--color-accent);
}
.faq-item.open .faq-question svg { transform: rotate(180deg); }
.faq-answer {
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s;
}
.faq-item.open .faq-answer {
  max-height: 500px; padding-bottom: 1.25rem;
}
.faq-answer p {
  font-size: 0.9375rem; color: var(--color-muted); line-height: 1.7;
}

/* --- Contact Form --- */
.contact-form {
  max-width: 640px; margin: 0 auto;
}
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block; font-weight: 600; font-size: 0.875rem;
  color: var(--color-primary); margin-bottom: 0.375rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: 0.75rem 1rem;
  border: 1.5px solid #d1d5db; border-radius: 8px;
  font-family: var(--font-body); font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none; border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(14,139,139,0.12);
}
.form-group textarea { min-height: 140px; resize: vertical; }

.form-status {
  padding: 1rem; border-radius: 8px; margin-bottom: 1rem;
  font-weight: 500; display: none;
}
.form-status.success { display: block; background: #d1fae5; color: #065f46; }
.form-status.error { display: block; background: #fee2e2; color: #991b1b; }

/* Honeypot */
.ohnohoney { position: absolute; left: -9999px; }

/* --- Footer --- */
.footer {
  background: var(--color-primary); color: rgba(255,255,255,0.7);
  padding: 4rem 1.5rem 2rem;
}
.footer-grid {
  max-width: 1280px; margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2.5rem;
  margin-bottom: 3rem;
}
.footer h4 { color: #fff; font-size: 1.125rem; margin-bottom: 1rem; }
.footer p { font-size: 0.9375rem; line-height: 1.7; }
.footer a { color: rgba(255,255,255,0.7); }
.footer a:hover { color: var(--color-accent-light); }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { font-size: 0.9375rem; }

.footer-bottom {
  max-width: 1280px; margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem;
  font-size: 0.8125rem;
  padding-right: 5rem;
}

/* --- WhatsApp Floating Button --- */
.whatsapp-float {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 100;
  display: flex; align-items: center; gap: 0.75rem;
  background: #25D366; color: #fff;
  padding: 0.875rem 1.5rem;
  border-radius: 50px;
  font-weight: 600; font-size: 0.9375rem;
  box-shadow: 0 4px 20px rgba(37,211,102,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}
.whatsapp-float:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 6px 28px rgba(37,211,102,0.5);
  color: #fff;
}
.whatsapp-float svg { width: 24px; height: 24px; }

@media (max-width: 640px) {
  .whatsapp-float span { display: none; }
  .whatsapp-float { padding: 1rem; border-radius: 50%; }
}

/* --- Scroll Reveal Animation --- */
.reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* --- Downloads Page --- */
.download-card {
  background: #fff; border-radius: 16px; padding: 2rem;
  border: 1px solid rgba(0,0,0,0.06);
  display: flex; align-items: center; gap: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.download-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.download-icon {
  width: 64px; height: 64px; flex-shrink: 0;
  background: #fee2e2; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #dc2626;
}
.download-card h3 { font-size: 1.125rem; color: var(--color-primary); margin-bottom: 0.375rem; }
.download-card p { font-size: 0.875rem; color: var(--color-muted); margin-bottom: 0.75rem; }

/* --- Page Header Banner --- */
.page-header {
  background: var(--color-primary);
  padding: 7rem 1.5rem 3.5rem;
  text-align: center;
}
.page-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  color: #fff; margin-bottom: 0.75rem;
}
.page-header p {
  color: rgba(255,255,255,0.7); font-size: 1.125rem;
  max-width: 600px; margin: 0 auto;
}

/* --- Misc --- */
.text-accent { color: var(--color-accent); }
.bg-accent { background: var(--color-accent); }

/* Contact info items */
.contact-info-item {
  display: flex; align-items: flex-start; gap: 1rem;
  margin-bottom: 1.5rem;
}
.contact-info-item svg {
  width: 24px; height: 24px; color: var(--color-accent); flex-shrink: 0; margin-top: 2px;
}

/* Reasons list */
.reasons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.75rem;
}
.reason-card {
  background: #fff; border-radius: 16px; padding: 2rem;
  border: 1px solid rgba(0,0,0,0.06);
  border-left: 4px solid var(--color-accent);
}
.reason-card h3 {
  font-size: 1.125rem; color: var(--color-primary); margin-bottom: 0.75rem;
}
.reason-card p { font-size: 0.9375rem; color: var(--color-muted); }

/* Map container */
.map-container {
  border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
  height: 400px;
}
.map-container iframe { width: 100%; height: 100%; border: 0; }

/* --- Responsive: Stack 2-col grids on mobile --- */
@media (max-width: 768px) {
  .hero { min-height: 80vh; }
  .hero-content { padding: 7rem 1.5rem 3rem; }
  .section { padding: 3.5rem 1.5rem; }
  .page-header { padding: 6rem 1.5rem 2.5rem; }

  /* Stack all 2-col inline grids */
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .trust-bar-inner {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    padding: 0 0.5rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .process-grid {
    grid-template-columns: 1fr;
  }

  .reasons-grid {
    grid-template-columns: 1fr;
  }

  .download-card {
    flex-direction: column;
    text-align: center;
  }

  .map-container { height: 280px; }
}

/* --- Site Credit --- */
.site-credit {
  text-align: center; padding: 1rem 1.5rem;
  background: #111122;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
}
.site-credit a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
}
.site-credit a:hover {
  color: rgba(255,255,255,0.7);
}
