/* ============================================================
   styles.css — Accra / Tema Drainage Platform
   Design language: Tropical civic — warm earth tones meet
   precise data-collection utility. Typography: Fraunces
   (display, evocative of tropical colonial maps) + Inter (UI).
   Palette: deep teal, clay orange, cream, near-black, alert red.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,300;0,600;0,900;1,300&family=Inter:wght@300;400;500;600&display=swap');

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  --teal:       #0D5C6B;
  --teal-light: #1A8098;
  --teal-pale:  #E8F4F7;
  --clay:       #C4622D;
  --clay-light: #E07B45;
  --clay-pale:  #FDF1EB;
  --cream:      #FAF7F2;
  --ink:        #131A1F;
  --ink-soft:   #3D4F57;
  --stone:      #8FA3AB;
  --stone-pale: #EDF1F3;
  --alert:      #D63B2F;
  --success:    #2A7A4F;
  --gold:       #C4983A;

  --radius:     10px;
  --radius-lg:  18px;
  --shadow:     0 2px 12px rgba(13,92,107,0.10);
  --shadow-lg:  0 8px 32px rgba(13,92,107,0.15);
  --transition: 0.22s cubic-bezier(.4,0,.2,1);

  --nav-height: 64px;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-light); }

/* ── Navigation ──────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--teal);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 1000;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
}
.nav-logo {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: white;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.nav-logo span { color: var(--clay-light); }
.nav-links {
  display: flex; gap: 8px; margin-left: auto; align-items: center;
}
.nav-links a {
  color: rgba(255,255,255,0.82);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  background: rgba(255,255,255,0.15);
  color: white;
}
.nav-phase {
  background: var(--clay);
  color: white;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Page wrapper ────────────────────────────────────────────── */
.page {
  padding-top: calc(var(--nav-height) + 32px);
  min-height: 100vh;
}
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}
.container--wide { max-width: 1200px; }
.container--narrow { max-width: 640px; }

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-light) 100%);
  color: white;
  padding: 72px 24px 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 12px;
}
.hero h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 16px;
}
.hero h1 em { font-style: italic; color: var(--clay-light); }
.hero p {
  font-size: 1.05rem;
  opacity: 0.88;
  max-width: 540px;
  margin: 0 auto 28px;
}
.hero-phases {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin-top: 8px;
}
.phase-badge {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 8px 20px;
  border-radius: 40px;
  font-size: 0.85rem;
  font-weight: 500;
}
.phase-badge strong { color: var(--clay-light); }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px;
  border: 1px solid rgba(0,0,0,0.05);
}
.card--clay { border-top: 4px solid var(--clay); }
.card--teal { border-top: 4px solid var(--teal); }
.card--gold { border-top: 4px solid var(--gold); }

.card-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 8px;
}
.card h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.card p { color: var(--ink-soft); font-size: 0.92rem; line-height: 1.65; }

/* ── Grid helpers ────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 680px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-section { margin-bottom: 32px; }
.form-section-title {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--teal);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--teal-pale);
  display: flex; align-items: center; gap: 8px;
}
.form-section-title .section-num {
  background: var(--teal);
  color: white;
  width: 26px; height: 26px;
  border-radius: 50%;
  font-size: 0.78rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.form-group label .required { color: var(--clay); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #DDE4E8;
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  color: var(--ink);
  background: white;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,92,107,0.12);
}
textarea { min-height: 100px; resize: vertical; }
select { cursor: pointer; }

.radio-group, .checkbox-group {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 6px;
}
.radio-option, .checkbox-option {
  display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.radio-option input, .checkbox-option input {
  width: auto; margin-top: 2px; flex-shrink: 0;
  accent-color: var(--teal);
}
.radio-option.inline-group {
  flex-direction: row; flex-wrap: wrap; gap: 12px;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  border: none; border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--teal);
  color: white;
}
.btn-primary:hover { background: var(--teal-light); color: white; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-clay {
  background: var(--clay);
  color: white;
}
.btn-clay:hover { background: var(--clay-light); color: white; transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  color: var(--teal);
  border: 2px solid var(--teal);
}
.btn-outline:hover { background: var(--teal); color: white; }
.btn-ghost {
  background: var(--stone-pale);
  color: var(--ink-soft);
}
.btn-ghost:hover { background: #DDE4E8; }
.btn-sm { padding: 8px 16px; font-size: 0.82rem; }
.btn-lg { padding: 15px 32px; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

/* ── Upload zone ─────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed #BDD0D6;
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--teal-pale);
}
.upload-zone:hover { border-color: var(--teal); background: #DDF0F4; }
.upload-zone input[type="file"] { display: none; }
.upload-zone .upload-icon { font-size: 2rem; margin-bottom: 8px; }
.upload-zone p { font-size: 0.88rem; color: var(--ink-soft); }
.upload-zone p strong { color: var(--teal); }
.upload-preview {
  margin-top: 12px;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.upload-preview img {
  width: 80px; height: 80px; object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--teal-pale);
}
.upload-preview .file-name {
  display: flex; align-items: center; gap: 6px;
  background: white;
  border: 1px solid #DDE4E8;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* ── Status / Alerts ─────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin: 16px 0;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-info { background: var(--teal-pale); color: var(--teal); border-left: 4px solid var(--teal); }
.alert-success { background: #EBF7F1; color: var(--success); border-left: 4px solid var(--success); }
.alert-warn { background: #FEF9E7; color: #7A6000; border-left: 4px solid var(--gold); }
.alert-error { background: #FDECEA; color: var(--alert); border-left: 4px solid var(--alert); }

.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-pending { background: #FEF9E7; color: #7A6000; }
.status-approved { background: #EBF7F1; color: var(--success); }
.status-rejected { background: #FDECEA; color: var(--alert); }
.status-verified { background: var(--teal-pale); color: var(--teal); }

/* ── GPS capture ─────────────────────────────────────────────── */
.gps-box {
  background: var(--teal-pale);
  border: 1.5px solid var(--teal);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; align-items: center; gap: 12px;
}
.gps-icon { font-size: 1.4rem; }
.gps-info { flex: 1; }
.gps-info .label { font-size: 0.75rem; font-weight: 600; color: var(--teal); text-transform: uppercase; }
.gps-coords { font-family: monospace; font-size: 0.88rem; color: var(--ink); }

/* ── Progress steps ──────────────────────────────────────────── */
.steps {
  display: flex; gap: 0; margin-bottom: 36px;
  overflow: hidden; border-radius: var(--radius);
  background: var(--stone-pale);
}
.step {
  flex: 1; padding: 10px 8px;
  text-align: center; font-size: 0.78rem;
  font-weight: 500; color: var(--stone);
  position: relative; cursor: default;
}
.step.active { background: var(--teal); color: white; }
.step.done { background: var(--teal-pale); color: var(--teal); }

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background: white; }
thead { background: var(--teal); color: white; }
thead th { padding: 12px 16px; font-size: 0.82rem; font-weight: 600; text-align: left; }
tbody tr { border-bottom: 1px solid var(--stone-pale); }
tbody tr:hover { background: var(--teal-pale); }
tbody td { padding: 12px 16px; font-size: 0.88rem; color: var(--ink-soft); }

/* ── Map container ───────────────────────────────────────────── */
#map, .map-container {
  width: 100%;
  height: 520px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--teal-pale);
}

/* ── Legend ──────────────────────────────────────────────────── */
.map-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 12px; margin-bottom: 8px;
}
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--ink-soft); }
.legend-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}

/* ── Misc helpers ────────────────────────────────────────────── */
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.text-center { text-align: center; }
.text-muted { color: var(--stone); font-size: 0.85rem; }
.text-sm { font-size: 0.85rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.divider { border: none; border-top: 1px solid var(--stone-pale); margin: 24px 0; }

/* ── Section header ──────────────────────────────────────────── */
.section-header { margin-bottom: 28px; }
.section-header .eyebrow {
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--clay); margin-bottom: 6px;
}
.section-header h2 {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 600;
  color: var(--ink);
}
.section-header p { color: var(--ink-soft); margin-top: 8px; }

/* ── Toast notification ──────────────────────────────────────── */
#toast {
  position: fixed; bottom: 28px; right: 24px;
  background: var(--ink); color: white;
  padding: 13px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(80px); opacity: 0;
  transition: all 0.3s;
  z-index: 9999;
  max-width: 320px;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.success { background: var(--success); }
#toast.error { background: var(--alert); }

/* ── Loading spinner ─────────────────────────────────────────── */
.spinner {
  width: 22px; height: 22px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Mobile ──────────────────────────────────────────────────── */
/* Mobile nav toggle button — hidden on desktop, shown only under the
   600px breakpoint below. Injected automatically by nav.js into every
   page that has a .nav-links block, so none of the 12 pages needed
   individual HTML edits. */
.nav-mobile-toggle {
  display: none;
  background: rgba(255,255,255,0.12);
  border: none;
  color: white;
  font-size: 1.2rem;
  line-height: 1;
  width: 38px; height: 38px;
  border-radius: 8px;
  cursor: pointer;
  margin-left: auto;
}
.nav-mobile-toggle:hover { background: rgba(255,255,255,0.22); }

@media (max-width: 600px) {
  .nav-mobile-toggle { display: block; }
  /* Links stay in the DOM and keep working with JS disabled/before
     nav.js runs — they just collapse into a dropdown panel instead
     of a horizontal row, and only that panel toggles open/closed. */
  .nav-links {
    margin-left: 0;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--teal);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.22);
    max-height: 0;
    overflow: hidden;
    padding-top: 0; padding-bottom: 0;
    transition: max-height 0.22s ease;
  }
  .nav-links.nav-open {
    max-height: 70vh;
    overflow-y: auto;
    padding: 8px;
  }
  .nav-links a { padding: 12px 14px; }
  .card { padding: 20px; }
  .hero { padding: 48px 20px 40px; }
  #map, .map-container { height: 340px; }
}

/* ── Camera Capture (orientation-aware) ─────────────────────── */
.cc-wrap { margin-top: 4px; }
.cc-hint { font-size: 0.85rem; color: var(--stone); margin-bottom: 12px; }
.cc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.cc-orient-btn {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  padding: 16px 10px;
  border: 2px dashed var(--stone-pale);
  border-radius: var(--radius);
  background: white;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
  overflow: hidden;
  min-height: 96px;
}
.cc-orient-btn:hover { border-color: var(--teal); background: #F4F9FA; }
.cc-orient-btn.cc-captured { border: 2px solid var(--teal); background: #F4F9FA; }
.cc-orient-btn .cc-emoji { font-size: 1.4rem; }
.cc-orient-btn .cc-label { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); text-align: center; z-index: 1; }
.cc-orient-btn .cc-thumb {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0.28;
}
.cc-stage {
  margin-top: 14px; padding: 14px; background: var(--stone-pale);
  border-radius: var(--radius);
}
.cc-video { width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--radius); background: #000; }
.cc-stage-actions { display: flex; gap: 10px; margin-top: 10px; }
.cc-stage-actions .btn { flex: 1; }
.cc-gps-status { margin-top: 6px; font-size: 0.78rem; }

