/* ══════════════════════════════════════════════════════════════
   SafeGuard SVG — Public Stylesheet
   Clean, approachable, civilian-friendly
══════════════════════════════════════════════════════════════ */

:root {
  --primary:    #1a3a6b;
  --primary-light: #2451a3;
  --accent:     #e63946;
  --danger:     #e63946;
  --accent-warn: #f4a261;
  --success:    #2d6a4f;
  --white:      #ffffff;
  --off-white:  #f8f9fa;
  --light-gray: #e9ecef;
  --mid-gray:   #6c757d;
  --dark:       #1a1a2e;
  --text:       #212529;
  --text-muted: #6c757d;
  --border:     #dee2e6;
  --shadow:     0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.12);
  --radius:     8px;
  --radius-lg:  16px;
  --font:       'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--off-white);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ── Navigation ─────────────────────────────────────────────── */
.navbar {
  background: var(--primary);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
}

.navbar-brand .brand-icon {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.navbar-brand .brand-flag {
  width: 48px;
  height: 32px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  object-fit: cover;
}

.navbar-brand .brand-sub {
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.75;
  display: block;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  color: rgba(255,255,255,0.85);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  display: block;
}

.nav-links a:hover { background: rgba(255,255,255,0.1); color: var(--white); }
.nav-links a.active { background: rgba(255,255,255,0.15); color: var(--white); }

.nav-btn {
  background: var(--accent);
  color: var(--white) !important;
  padding: 8px 18px !important;
  border-radius: var(--radius) !important;
  font-weight: 600 !important;
}

.nav-btn:hover { background: #c1121f !important; }

/* ── Emergency Banner ───────────────────────────────────────── */
.emergency-banner {
  background: var(--accent);
  color: var(--white);
  text-align: center;
  padding: 10px 24px;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.emergency-banner a {
  color: var(--white);
  text-decoration: underline;
}

/* ── Hero Section ───────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: 80px 24px;
  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.03'%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-content { position: relative; max-width: 800px; margin: 0 auto; }

.hero-flag {
  width: 120px;
  height: 80px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  margin-bottom: 24px;
  object-fit: cover;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.15;
}

.hero h1 span { color: #ffd700; }

.hero p {
  font-size: 1.125rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

/* ── Search Bar ─────────────────────────────────────────────── */
.search-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 8px 8px 8px 20px;
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 640px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text);
  background: transparent;
  font-family: var(--font);
}

.search-box input::placeholder { color: var(--text-muted); }

.search-box select {
  border: none;
  outline: none;
  font-size: 0.875rem;
  color: var(--text-muted);
  background: var(--light-gray);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--font);
}

.btn-search {
  background: var(--accent);
  color: var(--white);
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background 0.15s;
  font-family: var(--font);
  white-space: nowrap;
}

.btn-search:hover { background: #c1121f; }

/* ── Stats Bar ──────────────────────────────────────────────── */
.stats-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
}

.stats-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat-item {
  background: var(--white);
  padding: 20px 24px;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s;
  display: block;
}

.stat-item:hover { background: var(--off-white); text-decoration: none; }

.stat-num {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-num.missing { color: var(--accent); }
.stat-num.wanted { color: #e85d04; }
.stat-num.offenders { color: var(--primary); }

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

/* ── Container ──────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Section ────────────────────────────────────────────────── */
.section { padding: 48px 0; }
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary);
}
.section-sub {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 0.9375rem;
}

/* ── Person Cards ───────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.person-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: var(--text);
  display: block;
}

.person-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.person-card.urgency-critical { border-top: 4px solid var(--accent); }
.person-card.urgency-urgent { border-top: 4px solid var(--accent-warn); }
.person-card.urgency-standard { border-top: 4px solid var(--primary-light); }
.person-card.armed { border-top: 4px solid #7b2d00; }

.card-photo {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  color: var(--mid-gray);
}

.card-photo img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-body { padding: 16px; }

.card-name {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--primary);
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.5;
}

.card-badges { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.badge-critical { background: #fde8e8; color: var(--accent); }
.badge-urgent   { background: #fff3e0; color: #e65100; }
.badge-standard { background: #e8f0fe; color: var(--primary); }
.badge-active   { background: #e8f5e9; color: var(--success); }
.badge-found    { background: #e8f5e9; color: var(--success); }
.badge-armed    { background: #3c0000; color: #ff6b6b; }
.badge-compliant    { background: #e8f5e9; color: var(--success); }
.badge-noncompliant { background: #fde8e8; color: var(--accent); }
.badge-absconded    { background: #3c0000; color: #ff6b6b; }
.badge-predatory    { background: #3c0000; color: #ff6b6b; }
.badge-serious      { background: #fde8e8; color: var(--accent); }
.badge-minor        { background: #fff3e0; color: #e65100; }
.badge-neutral      { background: var(--light-gray); color: var(--text-muted); }

/* ── Alert Boxes ────────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-danger  { background: #fde8e8; border: 1px solid #f5c6cb; color: #721c24; }
.alert-warning { background: #fff3cd; border: 1px solid #ffc107; color: #856404; }
.alert-success { background: #d4edda; border: 1px solid #c3e6cb; color: #155724; }
.alert-info    { background: #d1ecf1; border: 1px solid #bee5eb; color: #0c5460; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
}

.form-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--light-gray);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.required::after { content: ' *'; color: var(--accent); }

input[type="text"],
input[type="date"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
textarea,
select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.9375rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(36,81,163,0.1);
}

textarea { resize: vertical; min-height: 100px; }

.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  padding: 11px 24px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font);
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-light); color: var(--white); text-decoration: none; }

.btn-danger { background: var(--accent); color: var(--white); }
.btn-danger:hover { background: #c1121f; color: var(--white); text-decoration: none; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--white); text-decoration: none; }

.btn-secondary { background: var(--light-gray); color: var(--text); }
.btn-secondary:hover { background: var(--border); text-decoration: none; }

.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Quick Actions (homepage) ───────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.quick-action {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  display: block;
}

.quick-action:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.quick-action .qa-icon { font-size: 2.5rem; margin-bottom: 12px; display: block; }
.quick-action .qa-title { font-weight: 700; font-size: 1rem; color: var(--primary); }
.quick-action .qa-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* ── Detail Page ────────────────────────────────────────────── */
.detail-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  align-items: start;
}

.detail-photo {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--light-gray);
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
}

.detail-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info { display: flex; flex-direction: column; gap: 20px; }

.info-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}

.info-block-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
  font-size: 0.9rem;
}

.info-key { color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.info-val { color: var(--text); font-weight: 400; }

/* ── Tip Form ───────────────────────────────────────────────── */
.tip-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.tip-toggle input[type="radio"] { display: none; }

.tip-toggle label {
  flex: 1;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  background: var(--white);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
  border: none;
}

.tip-toggle input[type="radio"]:checked + label {
  background: var(--primary);
  color: var(--white);
}

/* ── Reference Number ───────────────────────────────────────── */
.ref-number {
  font-family: monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--light-gray);
  padding: 12px 24px;
  border-radius: var(--radius);
  display: inline-block;
  letter-spacing: 0.1em;
  border: 2px dashed var(--border);
}

/* ── Success Page ───────────────────────────────────────────── */
.success-box {
  max-width: 540px;
  margin: 60px auto;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
}

.success-icon { font-size: 64px; margin-bottom: 20px; display: block; }

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  background: var(--primary);
  color: rgba(255,255,255,0.8);
  padding: 48px 24px 24px;
  margin-top: 60px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand { color: var(--white); font-size: 1.25rem; font-weight: 700; margin-bottom: 8px; }
.footer-brand-sub { font-size: 0.8rem; opacity: 0.7; margin-bottom: 12px; }
.footer-col-title { color: var(--white); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: rgba(255,255,255,0.7); font-size: 0.875rem; transition: color 0.15s; text-decoration: none; }
.footer-links a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; display: flex; justify-content: space-between; font-size: 0.8rem; flex-wrap: wrap; gap: 8px; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 32px; }
.pagination a, .pagination span {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--text);
  background: var(--white);
  transition: all 0.15s;
}
.pagination a:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }
.pagination .current { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* ── Hamburger Menu ──────────────────────────────────────────── */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 110;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  margin: 6px 0;
  transition: all 0.3s;
  border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar-inner { padding: 0 16px; }

  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--primary);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 105;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: var(--radius);
  }

  .nav-links a:hover,
  .nav-links a.active {
    background: rgba(255,255,255,0.1);
  }

  .nav-links .nav-btn {
    background: var(--accent);
    text-align: center;
    margin-top: 8px;
  }

  .emergency-banner {
    font-size: 0.8rem;
    padding: 8px 16px;
    text-align: center;
    line-height: 1.5;
  }

  .stats-inner { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: 1; }
  .detail-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 48px 16px; }
  .hero-flag { width: 80px; height: 53px; }
  .container { padding: 0 16px; }
  .section { padding: 32px 0; }
  .cards-grid { grid-template-columns: 1fr; }

  .search-box {
    flex-direction: column;
    padding: 12px;
    gap: 8px;
  }

  .search-box select {
    width: 100%;
  }

  .person-card { border-radius: var(--radius); }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 6px 0;
  }

  .btn { padding: 10px 16px; font-size: 0.875rem; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .hero h1 { font-size: 1.75rem; }
  .hero-flag { width: 60px; height: 40px; }
  .navbar-brand .brand-flag { width: 36px; height: 24px; }
  .navbar-brand { font-size: 1rem; gap: 8px; }
  .navbar-brand .brand-icon { width: 32px; height: 32px; font-size: 16px; }
  .navbar-brand .brand-sub { font-size: 0.6rem; }
  .success-box { padding: 32px 20px; margin: 32px auto; }
  .ref-number { font-size: 1.1rem; padding: 8px 16px; }
}
