/* ===========================================================
   TradieHub NZ — design tokens
   Palette: workwear navy, hi-vis orange, kauri timber tan,
   concrete cream, bush-forest green (trust/verified)
   =========================================================== */
:root {
  --navy: #1B2430;
  --navy-light: #2B3645;
  --orange: #FF6B1A;
  --orange-dark: #E0570D;
  --tan: #C9A574;
  --cream: #F2F0EB;
  --cream-dim: #E7E3D9;
  --slate: #5B6470;
  --forest: #2F4538;
  --ink: #14181F;
  --white: #FFFFFF;

  --font-display: "Big Shoulders", "Archivo Black", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --radius: 6px;
  --max-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.05;
  margin: 0 0 0.4em;
  text-transform: uppercase;
}

p { margin: 0 0 1em; color: var(--slate); }

button, .btn {
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  padding: 13px 22px;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}
.btn-primary {
  background: var(--orange);
  color: var(--white);
  box-shadow: 0 3px 0 var(--orange-dark);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--orange-dark); }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--orange-dark); }
.btn-dark {
  background: var(--navy);
  color: var(--cream);
}
.btn-dark:hover { background: var(--navy-light); }
.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
  padding: 11px 20px;
}
.btn-outline:hover { background: var(--navy); color: var(--cream); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ===================== Header ===================== */
.site-header {
  background: var(--navy);
  color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid var(--orange);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.logo .accent { color: var(--orange); }
.main-nav { display: flex; gap: 28px; align-items: center; }
.main-nav a {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cream-dim);
}
.main-nav a:hover { color: var(--orange); }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--cream);
  font-size: 26px;
  padding: 4px 8px;
}

@media (max-width: 760px) {
  .main-nav {
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: var(--navy);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px 24px;
    gap: 16px;
    border-bottom: 3px solid var(--orange);
    transform: translateY(-110%);
    transition: transform 0.2s ease;
  }
  .main-nav.open { transform: translateY(0); }
  .nav-toggle { display: block; }
}

/* ===================== Hero + ticket search ===================== */
.hero {
  background: var(--navy);
  color: var(--cream);
  padding: 56px 0 100px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 14px;
  background: repeating-linear-gradient(45deg, var(--orange) 0 18px, var(--navy) 18px 36px);
  opacity: 0.9;
}
.hero-inner {
  display: grid;
  gap: 36px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 10px;
}
.hero h1 {
  font-size: clamp(34px, 6vw, 58px);
  color: var(--white);
  max-width: 14ch;
}
.hero h1 .hi {
  -webkit-text-stroke: 2px var(--orange);
  color: transparent;
}
.hero-sub {
  font-size: 17px;
  color: var(--cream-dim);
  max-width: 46ch;
}

/* Signature element: job-ticket search card */
.job-ticket {
  background: var(--cream);
  color: var(--ink);
  border-radius: var(--radius);
  position: relative;
  padding: 26px 26px 22px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
  max-width: 560px;
}
.job-ticket::before,
.job-ticket::after {
  content: "";
  position: absolute;
  width: 26px; height: 26px;
  background: var(--navy);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
}
.job-ticket::before { left: -13px; }
.job-ticket::after { right: -13px; }
.ticket-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px dashed var(--cream-dim);
  padding-bottom: 14px;
  margin-bottom: 16px;
}
.ticket-row .tag {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  background: var(--orange);
  color: var(--white);
  padding: 4px 10px;
  border-radius: 3px;
  font-weight: 700;
}
.ticket-row .ticket-no {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--slate);
}
.ticket-fields {
  display: grid;
  gap: 14px;
}
@media (min-width: 540px) {
  .ticket-fields { grid-template-columns: 1fr 1fr; }
  .ticket-fields .full { grid-column: 1 / -1; }
}
.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--slate);
  margin-bottom: 6px;
}
select, input, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  padding: 11px 12px;
  border: 2px solid var(--cream-dim);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
}
select:focus, input:focus, textarea:focus {
  border-color: var(--orange);
  outline: none;
}
.ticket-submit { margin-top: 18px; }

/* ===================== Trust strip ===================== */
.trust-strip {
  background: var(--cream-dim);
  border-bottom: 1px solid #ddd6c5;
}
.trust-strip .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: center;
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--slate);
}
.trust-strip strong { color: var(--ink); }

/* ===================== Section scaffolding ===================== */
section { padding: 64px 0; }
.section-head { margin-bottom: 34px; max-width: 640px; }
.section-head .eyebrow { color: var(--orange-dark); }
.section-head h2 { font-size: clamp(26px, 4vw, 38px); color: var(--navy); }
.section-head p { font-size: 16px; }
.section-alt { background: var(--white); }

/* ===================== Category grid ===================== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .cat-grid { grid-template-columns: repeat(5, 1fr); } }

.cat-card {
  background: var(--white);
  border: 2px solid var(--cream-dim);
  border-radius: var(--radius);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s, transform 0.15s;
}
.cat-card:hover { border-color: var(--orange); transform: translateY(-3px); }
.cat-card .icon {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy);
  color: var(--orange);
  border-radius: 6px;
}
.cat-card .name { font-weight: 700; font-size: 15px; color: var(--ink); }
.cat-card .count { font-family: var(--font-mono); font-size: 12px; color: var(--slate); }

/* ===================== Tradie cards ===================== */
.tradie-list { display: grid; gap: 18px; }
.tradie-card {
  background: var(--white);
  border: 2px solid var(--cream-dim);
  border-radius: var(--radius);
  padding: 22px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 18px;
  position: relative;
}
@media (min-width: 640px) {
  .tradie-card { grid-template-columns: 80px 1fr auto; align-items: center; }
}
.avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
}
@media (min-width: 640px) { .avatar { width: 80px; height: 80px; font-size: 26px; } }
.tradie-info .name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tradie-info h3 { font-size: 19px; margin: 0; text-transform: none; }
.badge-verified {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--forest);
  color: var(--white);
  padding: 3px 8px;
  border-radius: 3px;
  text-transform: uppercase;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--slate);
  margin-top: 6px;
  font-family: var(--font-mono);
}
.stars { color: var(--orange); letter-spacing: 1px; }
.tradie-bio { font-size: 14px; margin-top: 8px; margin-bottom: 0; }
.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  grid-column: 1 / -1;
}
@media (min-width: 640px) { .card-actions { grid-column: auto; margin-top: 0; flex-direction: column; } }

/* ===================== Filters bar ===================== */
.filters-bar {
  background: var(--white);
  border: 2px solid var(--cream-dim);
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  gap: 12px;
  margin-bottom: 26px;
}
@media (min-width: 720px) {
  .filters-bar { grid-template-columns: 1fr 1fr 1fr auto; align-items: end; }
}

/* ===================== Profile page ===================== */
.profile-header {
  background: var(--navy);
  color: var(--cream);
  padding: 48px 0;
}
.profile-top {
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
}
.profile-top .avatar { width: 96px; height: 96px; font-size: 32px; }
.profile-top h1 { font-size: clamp(26px, 4vw, 38px); color: var(--white); margin-bottom: 6px; }
.stat-strip {
  display: flex;
  gap: 28px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.stat { font-family: var(--font-mono); }
.stat .num { font-size: 22px; font-weight: 700; color: var(--orange); display: block; }
.stat .label { font-size: 12px; color: var(--cream-dim); text-transform: uppercase; }

.profile-grid {
  display: grid;
  gap: 32px;
  margin-top: 40px;
}
@media (min-width: 860px) { .profile-grid { grid-template-columns: 2fr 1fr; } }

.review-card {
  background: var(--white);
  border: 2px solid var(--cream-dim);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}
.review-card .name-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--slate); margin-bottom: 6px; }

.quote-box {
  background: var(--white);
  border: 2px solid var(--cream-dim);
  border-radius: var(--radius);
  padding: 22px;
  position: sticky;
  top: 86px;
}
.quote-box h3 { font-size: 18px; color: var(--navy); }
.field { margin-bottom: 14px; }

/* ===================== Forms / auth ===================== */
.auth-shell {
  max-width: 460px;
  margin: 60px auto;
  background: var(--white);
  border: 2px solid var(--cream-dim);
  border-radius: var(--radius);
  padding: 36px 30px;
}
.auth-shell h1 { font-size: 24px; color: var(--navy); }
.auth-shell .switch { font-size: 14px; margin-top: 18px; text-align: center; }
.auth-shell .switch a { color: var(--orange-dark); font-weight: 700; }
.alert {
  padding: 12px 14px;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-error { background: #FDEAE3; color: #99371A; border: 1px solid #F2B9A0; }
.alert-success { background: #E6EFE8; color: var(--forest); border: 1px solid #A9CBB2; }

/* ===================== Dashboard ===================== */
.dash-shell { display: grid; gap: 24px; }
@media (min-width: 860px) { .dash-shell { grid-template-columns: 220px 1fr; } }
.dash-nav { background: var(--white); border: 2px solid var(--cream-dim); border-radius: var(--radius); padding: 16px; }
.dash-nav a { display: block; padding: 10px 12px; border-radius: 4px; font-weight: 600; font-size: 14px; color: var(--ink); }
.dash-nav a.active, .dash-nav a:hover { background: var(--cream-dim); color: var(--orange-dark); }
.dash-card { background: var(--white); border: 2px solid var(--cream-dim); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data-table th { text-align: left; font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; color: var(--slate); border-bottom: 2px solid var(--cream-dim); padding: 10px 8px; }
table.data-table td { padding: 12px 8px; border-bottom: 1px solid var(--cream-dim); }
.status-pill { font-family: var(--font-mono); font-size: 11px; padding: 3px 9px; border-radius: 10px; text-transform: uppercase; }
.status-new { background: #FDE9D7; color: var(--orange-dark); }
.status-contacted { background: #E1ECFB; color: #2452A6; }
.status-closed { background: var(--cream-dim); color: var(--slate); }

/* ===================== Footer ===================== */
.site-footer {
  background: var(--ink);
  color: var(--cream-dim);
  padding: 48px 0 28px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr;
}
@media (min-width: 700px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-grid h4 { color: var(--white); font-size: 14px; margin-bottom: 14px; }
.footer-grid a { display: block; font-size: 14px; color: var(--cream-dim); margin-bottom: 8px; }
.footer-grid a:hover { color: var(--orange); }
.footer-bottom {
  border-top: 1px solid #2B3038;
  margin-top: 32px;
  padding-top: 18px;
  font-size: 12px;
  color: var(--slate);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ===================== Misc ===================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--slate);
}
.empty-state h3 { color: var(--navy); }

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 30px; }
.pagination a, .pagination span {
  padding: 8px 14px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--white);
  border: 2px solid var(--cream-dim);
}
.pagination .current { background: var(--navy); color: var(--cream); border-color: var(--navy); }
