:root {
  --bg: #f9fafb;
  --surface: #ffffff;
  --text: #0f172a;
  --text-secondary: #475569;
  --muted: #64748b;
  --accent: #16a34a;
  --accent-hover: #15803d;
  --accent-light: #f0fdf4;
  --accent-border: #dcfce7;
  --border: #e2e8f0;
  --max: 1280px;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
  border-radius: 14px;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* ── Top bar ── */
.topbar {
  font-size: 0.85rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
}

.topbar .container {
  padding: 0.7rem 0;
  text-align: center;
  font-weight: 500;
}

/* ── Nav ── */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.75rem 0;
}

.logo {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border);
  transition: all 0.2s ease;
}

.logo:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

.links {
  display: flex;
  gap: 2rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.links a {
  color: var(--text-secondary);
  transition: color 0.2s ease;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.links a:hover {
  color: var(--accent);
}

.links a.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

/* ── Typography ── */
h1, h2, h3 {
  margin: 0 0 1rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-weight: 700;
}

h1 { 
  font-size: clamp(2.2rem, 5vw, 3.5rem); 
  color: var(--text);
}

h2 { 
  font-size: clamp(1.6rem, 3.5vw, 2.4rem); 
  color: var(--text);
}

h3 {
  font-size: 1.25rem;
  color: var(--text);
}

.lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 60ch;
  margin-bottom: 1.5rem;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── Pill ── */
.pill {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

/* ── Sections ── */
section {
  padding: 1rem 0 2rem;
}

/* ── Hero ── */
.hero {
  padding: 4rem 0 3rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.02) 0%, rgba(34, 197, 94, 0.02) 100%);
}

.hero .container {
  max-width: 1200px;
}

.hero-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-bottom: 4rem;
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-content h1 {
  margin-bottom: 1.2rem;
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-image {
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  object-fit: cover;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.stat-label {
  display: block;
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 0.85rem 2rem;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.75rem 1.75rem;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--accent-light);
}

.btn-full {
  width: 100%;
  text-align: center;
}

@media (max-width: 768px) {
  .hero-wrapper {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-top: 2rem;
  }

  .hero-cta {
    flex-direction: column;
  }

  .btn-primary, .btn-secondary {
    width: 100%;
  }
}

/* ── Services ── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.service {
  padding: 1.2rem;
}

.service p {
  margin: 0;
  color: var(--muted);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

/* ── FAQs ── */
.faqs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.faq {
  padding: 1.1rem;
}

.faq p {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

/* ── Contact ── */
.contact {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
}

.contact-card,
.contact-form {
  padding: 1.2rem;
}

.contact-form form {
  display: grid;
  gap: 0.7rem;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem;
  font: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  padding: 2rem 0 3rem;
  font-size: 0.9rem;
  background: rgba(15, 23, 42, 0.02);
}

/* ── Nav extras ── */
.nav-user {
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-nav-logout {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.btn-nav-logout:hover {
  background: var(--border);
  color: var(--text);
}

/* ── Auth / login ── */
.auth-section {
  display: flex;
  justify-content: center;
  padding: 4rem 0;
}

.auth-card {
  width: min(100%, 440px);
  padding: 2.5rem;
  text-align: center;
}

.auth-header { margin-bottom: 2rem; }

.auth-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  border: 2px solid var(--border);
}

.auth-note {
  margin-top: 1.5rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

.auth-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  color: var(--muted);
}

/* ── Staff portal ── */
.portal-header {
  padding: 1.5rem 0 0.5rem;
}

.section-note {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1rem;
  font-style: italic;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.resource-card {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.resource-icon {
  font-size: 1.8rem;
  line-height: 1;
  margin-bottom: 0.2rem;
}

.resource-card h3 { margin: 0; }

.resource-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  flex: 1;
}

.btn-resource {
  display: inline-block;
  margin-top: 0.8rem;
  background: #e8f0ec;
  color: #184a37;
  border: 1px solid #cde2d9;
  border-radius: 8px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  align-self: flex-start;
  transition: background 0.15s;
}

.btn-resource:hover { background: #d4e8de; }

/* ── Admin portal ── */
.admin-form {
  padding: 1.4rem;
  max-width: 700px;
  margin-bottom: 0.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.form-group {
  display: grid;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

select {
  width: 100%;
  border: 1px solid #cec4be;
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: #fff;
}

.form-msg {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.form-msg--success { color: var(--accent); font-weight: 600; }
.form-msg--error   { color: #c0392b; font-weight: 600; }

.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.user-table th {
  text-align: left;
  padding: 0.7rem 1rem;
  background: var(--border);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--muted);
}

.user-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.user-table tr:last-child td { border-bottom: none; }

.btn-table-action {
  border: none;
  border-radius: 7px;
  padding: 0.3rem 0.75rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger {
  background: #ffe8ef;
  color: #c0392b;
  border: 1px solid #fca5a5;
}

.btn-danger:hover { background: #fca5a5; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .hero-grid,
  .services-grid,
  .gallery,
  .faqs,
  .contact,
  .resources-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .links {
    gap: 0.8rem;
    font-size: 0.95rem;
  }
}
