:root {
  --bg: #faf6f0;
  --surface: #ffffff;
  --surface-alt: #f2ece2;
  --text: #2a2420;
  --text-muted: #6b6055;
  --border: #e6ddd0;
  --teal: #1f6f6b;
  --teal-dark: #15514e;
  --teal-tint: #e4f0ee;
  --terracotta: #c96a3c;
  --terracotta-dark: #a8502a;
  --terracotta-tint: #fbe9e0;
  --gold: #c99a2e;
  --danger: #b3452f;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(40, 30, 20, 0.08);
  --shadow-md: 0 6px 20px rgba(40, 30, 20, 0.10);
  --shadow-lg: 0 16px 40px rgba(40, 30, 20, 0.16);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1815;
    --surface: #242019;
    --surface-alt: #2c2721;
    --text: #f2ece2;
    --text-muted: #b3a89a;
    --border: #3a332b;
    --teal: #4fa39d;
    --teal-dark: #6cc0b9;
    --teal-tint: #1e3532;
    --terracotta: #e08a5c;
    --terracotta-dark: #f0a476;
    --terracotta-tint: #3a2a20;
    --gold: #ddb655;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="dark"] {
  --bg: #1b1815;
  --surface: #242019;
  --surface-alt: #2c2721;
  --text: #f2ece2;
  --text-muted: #b3a89a;
  --border: #3a332b;
  --teal: #4fa39d;
  --teal-dark: #6cc0b9;
  --teal-tint: #1e3532;
  --terracotta: #e08a5c;
  --terracotta-dark: #f0a476;
  --terracotta-tint: #3a2a20;
  --gold: #ddb655;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
}

:root[data-theme="light"] {
  --bg: #faf6f0;
  --surface: #ffffff;
  --surface-alt: #f2ece2;
  --text: #2a2420;
  --text-muted: #6b6055;
  --border: #e6ddd0;
  --teal: #1f6f6b;
  --teal-dark: #15514e;
  --teal-tint: #e4f0ee;
  --terracotta: #c96a3c;
  --terracotta-dark: #a8502a;
  --terracotta-tint: #fbe9e0;
  --gold: #c99a2e;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--teal), var(--terracotta));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 15px;
}
nav.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
nav.main-nav a {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
nav.main-nav a:hover { background: var(--surface-alt); color: var(--text); }
nav.main-nav a.active { color: var(--teal-dark); background: var(--teal-tint); }
.nav-toggle { display: none; }

/* Hero */
.hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-alt), var(--bg));
}
.hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  max-width: 720px;
}
.hero p.lede {
  color: var(--text-muted);
  font-size: 17px;
  max-width: 620px;
  margin: 0 0 26px;
}
.hero-stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.hero-stat .num { font-size: 22px; font-weight: 800; color: var(--teal-dark); }
.hero-stat .label { font-size: 13px; color: var(--text-muted); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--teal); color: white; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-alt); }
.btn-terracotta { background: var(--terracotta); color: white; }
.btn-terracotta:hover { background: var(--terracotta-dark); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-alt); }

/* Filters */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 22px 0;
}
.search-input {
  flex: 1 1 240px;
  min-width: 200px;
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14.5px;
}
.search-input:focus, select:focus, textarea:focus, input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
select.sort-select {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 20px;
}
.chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { background: var(--surface-alt); }
.chip.active { background: var(--teal); color: white; border-color: var(--teal); }

/* Grid & cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
  padding-bottom: 48px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-top { display: flex; gap: 12px; align-items: flex-start; }
.avatar {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 16px;
}
.card-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-name { font-weight: 700; font-size: 16px; }
.badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--teal-dark);
  background: var(--teal-tint);
  padding: 2px 8px;
  border-radius: 999px;
}
.badge-new {
  font-size: 11px;
  font-weight: 700;
  color: var(--terracotta-dark);
  background: var(--terracotta-tint);
  padding: 2px 8px;
  border-radius: 999px;
}
.card-location { font-size: 13px; color: var(--text-muted); }
.rating-row { display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.stars { color: var(--gold); letter-spacing: 1px; }
.review-count { color: var(--text-muted); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-alt);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 999px;
}
.card-bio {
  font-size: 13.5px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.rate { font-weight: 800; font-size: 15px; }
.rate span { font-weight: 500; font-size: 12px; color: var(--text-muted); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* Profile detail */
.profile-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 32px 0 24px;
}
.avatar-lg {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 30px;
  flex-shrink: 0;
}
.profile-header-info { flex: 1; min-width: 240px; }
.profile-header-info h1 { margin: 0 0 6px; font-size: 26px; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--text-muted); font-size: 14px; margin-bottom: 8px; }
.profile-hire-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  min-width: 220px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.profile-hire-box .rate-big { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.profile-hire-box .rate-big span { font-size: 13px; font-weight: 500; color: var(--text-muted); }

.section { padding: 22px 0; border-top: 1px solid var(--border); }
.section h2 { font-size: 18px; margin: 0 0 14px; }
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
.skill-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.skill-list li { font-size: 14px; padding-left: 20px; position: relative; }
.skill-list li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 700; }

.review-card {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.review-card-top { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 700; margin-bottom: 4px; }
.review-card-top .when { font-weight: 500; color: var(--text-muted); }
.review-text { font-size: 14px; color: var(--text-muted); }

.sidebar-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
}
.sidebar-box h3 { font-size: 14px; margin: 0 0 8px; }
.sidebar-box p { font-size: 13.5px; color: var(--text-muted); margin: 0; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 12, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 100;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 4px;
}
.modal h2 { margin: 0 0 4px; font-size: 20px; }
.modal .sub { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.field textarea { resize: vertical; min-height: 70px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.field-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check-item { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.check-item input { width: auto; }

.success-panel { text-align: center; padding: 10px 0 6px; }
.success-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--teal-tint); color: var(--teal-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; margin: 0 auto 16px;
}
.success-panel h2 { margin-bottom: 8px; }
.success-panel .conf-id { font-family: monospace; background: var(--surface-alt); padding: 4px 10px; border-radius: 6px; font-size: 13px; }

/* Requests page */
.request-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.request-card .grow { flex: 1; min-width: 200px; }
.status-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.status-pending { background: var(--terracotta-tint); color: var(--terracotta-dark); }
.status-confirmed { background: var(--teal-tint); color: var(--teal-dark); }

/* For workers page */
.split-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  padding: 44px 0;
  align-items: center;
}
.why-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 14px; }
.why-list li { padding-left: 32px; position: relative; font-size: 14.5px; }
.why-list li::before {
  content: "";
  position: absolute; left: 0; top: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--terracotta);
}
.why-list li::after {
  content: "✓";
  position: absolute; left: 4px; top: 2px;
  color: white; font-size: 12px; font-weight: 800;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--teal-dark);
  color: white;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  z-index: 200;
}

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 20px;
}

/* Safety banner */
.safety-banner {
  background: var(--terracotta-tint);
  border: 1px solid var(--terracotta);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--text);
  margin: 18px 0;
}
.safety-banner a { color: var(--terracotta-dark); font-weight: 700; text-decoration: underline; }

.loading-state, .error-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.error-state { color: var(--danger); }

.card-job { border-left: 4px solid var(--terracotta); }
.status-open { background: var(--teal-tint); color: var(--teal-dark); }

.agree-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin: 16px 0;
}
.agree-row input { margin-top: 3px; width: auto; }
.agree-row a { color: var(--teal-dark); font-weight: 600; }

.terms-page { max-width: 760px; margin: 0 auto; padding: 32px 0 60px; }
.terms-page h1 { font-size: 28px; margin-bottom: 6px; }
.terms-page .updated { color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }
.terms-page h2 { font-size: 17px; margin: 28px 0 10px; }
.terms-page p, .terms-page li { font-size: 14.5px; color: var(--text-muted); line-height: 1.65; }
.terms-page ul { padding-left: 20px; }
.terms-page .callout {
  background: var(--terracotta-tint);
  border: 1px solid var(--terracotta);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: 20px 0;
  color: var(--text);
  font-size: 14px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
}

@media (max-width: 780px) {
  .detail-grid { grid-template-columns: 1fr; gap: 24px; }
  .skill-list { grid-template-columns: 1fr; }
  .split-hero { grid-template-columns: 1fr; }
  nav.main-nav { display: none; }
  nav.main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px;
    gap: 2px;
    z-index: 50;
  }
  .nav-toggle { display: inline-flex; }
  .field-row, .check-grid { grid-template-columns: 1fr; }
}
