/* Theme colours come from the organisation logo: green, gold and red. */
:root {
  --brand: #0a7a3b;
  --brand-dark: #064d26;
  --brand-darker: #04361b;
  --brand-soft: #eef7f1;
  --gold: #f5c400;
  --gold-dark: #d9ad00;
  --red: #c8102e;
  --ink: #111827;
  --muted: #6b7280;
  --bg: #f5f7f6;
  --border: #e5e7eb;
  --radius: 14px;
  --shadow: 0 10px 30px -12px rgba(4, 54, 27, .25);
}

html { font-size: 15px; }
body {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

.text-brand { color: var(--brand) !important; }
.text-gold { color: var(--gold) !important; }
.text-red { color: var(--red) !important; }
.bg-brand { background: var(--brand) !important; }
.bg-brand-soft { background: var(--brand-soft) !important; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 500; padding: .6rem 1.2rem; }
.btn-sm { padding: .35rem .75rem; border-radius: 8px; }
.btn-lg { padding: .85rem 1.75rem; font-size: 1.05rem; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-outline-brand { border-color: var(--brand); color: var(--brand); }
.btn-outline-brand:hover { background: var(--brand); color: #fff; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--brand-darker); font-weight: 600; }
.btn-gold:hover, .btn-gold:focus { background: var(--gold-dark); border-color: var(--gold-dark); color: var(--brand-darker); }
.btn:focus, .form-control:focus, .form-select:focus, .form-check-input:focus {
  box-shadow: 0 0 0 .2rem rgba(10, 122, 59, .25);
  border-color: var(--brand);
}
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }

/* ---------- Public navbar ---------- */
.site-nav {
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-nav .navbar-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--brand-dark); line-height: 1.1; }
.site-nav .navbar-brand img { width: 44px; height: 44px; border-radius: 50%; }
.site-nav .navbar-brand small { display: block; font-size: .68rem; font-weight: 500; color: var(--red); letter-spacing: .02em; }
.site-nav .nav-link { color: var(--ink); font-weight: 500; }
.site-nav .nav-link:hover { color: var(--brand); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 85% 20%, rgba(245, 196, 0, .18), transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(255, 255, 255, .08), transparent 45%),
    linear-gradient(135deg, var(--brand-darker) 0%, var(--brand-dark) 45%, var(--brand) 100%);
  padding: 5rem 0 6rem;
}
.hero::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 60px;
  background: #fff;
  clip-path: polygon(0 100%, 100% 100%, 100% 0);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(245, 196, 0, .15); color: var(--gold);
  border: 1px solid rgba(245, 196, 0, .4);
  padding: .35rem .9rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
}
.hero h1 { font-weight: 800; font-size: clamp(2rem, 4.5vw, 3.4rem); line-height: 1.12; margin: 1.1rem 0; }
.hero h1 .accent { color: var(--gold); }
.hero .lead { color: rgba(255, 255, 255, .85); max-width: 36rem; }
.hero-logo {
  width: min(380px, 80vw); aspect-ratio: 1; border-radius: 50%;
  background: #fff; padding: 10px;
  box-shadow: 0 0 0 10px rgba(255, 255, 255, .08), 0 0 0 22px rgba(245, 196, 0, .12), 0 30px 60px -20px rgba(0, 0, 0, .5);
}
.hero-logo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 2rem; margin-top: 2.5rem; }
.hero-stats .num { font-size: 1.8rem; font-weight: 700; color: var(--gold); line-height: 1; }
.hero-stats .lbl { font-size: .82rem; color: rgba(255, 255, 255, .75); }

/* ---------- Sections ---------- */
.section { padding: 5rem 0; }
.section-alt { background: var(--bg); }
.eyebrow { color: var(--red); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; }
.section-title { font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.3rem); margin: .4rem 0 1rem; }

.feature-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 2rem; height: 100%; transition: transform .2s, box-shadow .2s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature-icon {
  width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.5rem; margin-bottom: 1.1rem;
}
.step-num {
  width: 46px; height: 46px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; margin-bottom: 1rem;
  box-shadow: 0 0 0 6px var(--brand-soft);
}
.state-chip {
  display: inline-block; padding: .4rem .9rem; margin: .25rem; border-radius: 999px;
  background: #fff; border: 1px solid var(--border); font-size: .88rem;
}
.cta-band {
  background: linear-gradient(120deg, var(--brand-dark), var(--brand));
  color: #fff; border-radius: 22px; padding: 3rem; position: relative; overflow: hidden;
}
.cta-band::before {
  content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px;
  border-radius: 50%; background: rgba(245, 196, 0, .15);
}

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-darker); color: rgba(255, 255, 255, .75); padding: 3rem 0 1.5rem; font-size: .9rem; }
.site-footer a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer .flag-rule { height: 4px; background: linear-gradient(90deg, var(--brand) 33%, #fff 33% 66%, var(--brand) 66%); border-radius: 2px; }

/* ---------- Auth pages ---------- */
.auth-wrap { background: var(--bg); padding: 3rem 0; }
.auth-card { background: #fff; border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.auth-side {
  background:
    radial-gradient(circle at 80% 10%, rgba(245, 196, 0, .2), transparent 40%),
    linear-gradient(160deg, var(--brand-darker), var(--brand));
  color: #fff; padding: 2.5rem;
}
.auth-side img { width: 110px; height: 110px; border-radius: 50%; background: #fff; padding: 4px; }
.auth-side ul { list-style: none; padding: 0; }
.auth-side li { display: flex; gap: .6rem; margin-bottom: .8rem; color: rgba(255, 255, 255, .9); }
.auth-side li i { color: var(--gold); }
.auth-form { padding: 2.5rem; }
.form-section-title {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
  color: var(--brand); border-bottom: 1px solid var(--border); padding-bottom: .4rem; margin: 1.5rem 0 1rem;
}
.form-label { font-weight: 500; font-size: .9rem; }
.form-control, .form-select { border-radius: 10px; padding: .6rem .85rem; }
.optional { color: var(--muted); font-weight: 400; font-size: .8rem; }
.field-validation-error { font-size: .82rem; color: var(--red); }
.input-validation-error { border-color: var(--red); }

/* ---------- Cards & tables (member + admin) ---------- */
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.panel-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.panel-header h2, .panel-header h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.panel-body { padding: 1.25rem; }
.table > :not(caption) > * > * { padding: .7rem .9rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: #fafbfa; border-bottom-width: 1px; }
.table-hover tbody tr:hover { background: var(--brand-soft); }
.badge-soft { background: var(--brand-soft); color: var(--brand-dark); font-weight: 500; }
.detail-list dt { font-weight: 500; color: var(--muted); font-size: .85rem; }
.detail-list dd { font-weight: 500; margin-bottom: .9rem; }

/* HTML preview of the ID card (mirrors the PDF design). */
.id-card {
  width: 100%; max-width: 430px; aspect-ratio: 85.6 / 54; border-radius: 16px; overflow: hidden;
  background: #fff; box-shadow: var(--shadow); border: 1px solid var(--border);
  display: flex; flex-direction: column; font-size: clamp(.55rem, 2.2vw, .78rem);
}
.id-card .ic-head { background: linear-gradient(110deg, var(--brand) 70%, var(--brand-dark) 70%); color: #fff; display: flex; align-items: center; gap: .7em; padding: .6em .9em; }
.id-card .ic-head img { width: 3.6em; height: 3.6em; border-radius: 50%; background: #fff; padding: 2px; }
.id-card .ic-head strong { display: block; font-size: 1.25em; letter-spacing: .02em; }
.id-card .ic-head span { color: var(--gold); font-weight: 600; font-size: .85em; }
.id-card .ic-band { background: var(--gold); color: var(--brand-dark); text-align: center; font-weight: 700; font-size: .78em; letter-spacing: .1em; padding: .2em; }
.id-card .ic-body { flex: 1; display: flex; gap: 1em; padding: .7em 1em; }
.id-card .ic-body .lbl { font-size: .68em; color: var(--muted); font-weight: 600; letter-spacing: .05em; }
.id-card .ic-body .val { font-weight: 700; line-height: 1.2; margin-bottom: .45em; }
.id-card .ic-qr { width: 5.5em; height: 5.5em; border: 2px dashed var(--border); border-radius: 8px; display: grid; place-items: center; color: var(--muted); font-size: 1.8em; align-self: center; }
.id-card .ic-foot { background: var(--brand); border-top: 3px solid var(--red); color: #fff; text-align: center; font-size: .7em; font-weight: 600; padding: .3em; }

.alert { border-radius: 12px; border: 0; }
.alert-success { background: var(--brand-soft); color: var(--brand-darker); }

/* ---------- Admin shell ---------- */
.admin-body { background: var(--bg); }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 260px; flex-shrink: 0; background: var(--brand-darker); color: rgba(255, 255, 255, .8);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar .brand { display: flex; align-items: center; gap: .7rem; padding: 1.25rem; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.admin-sidebar .brand img { width: 42px; height: 42px; border-radius: 50%; background: #fff; padding: 2px; }
.admin-sidebar .brand strong { display: block; font-size: .95rem; line-height: 1.15; }
.admin-sidebar .brand small { color: var(--gold); font-size: .72rem; }
.admin-sidebar .nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: rgba(255, 255, 255, .4); padding: 1.2rem 1.25rem .4rem; }
.admin-sidebar .nav-link {
  color: rgba(255, 255, 255, .78); display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1.25rem; margin: .1rem .75rem; border-radius: 10px; font-weight: 500; font-size: .92rem;
}
.admin-sidebar .nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.admin-sidebar .nav-link.active { background: var(--brand); color: #fff; }
.admin-sidebar .nav-link.active i { color: var(--gold); }
.admin-sidebar button.nav-link { background: none; border: 0; width: calc(100% - 1.5rem); text-align: left; }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  background: #fff; border-bottom: 1px solid var(--border); padding: .85rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: sticky; top: 0; z-index: 10;
}
.admin-topbar h1 { font-size: 1.2rem; font-weight: 600; margin: 0; }
.admin-content { padding: 1.5rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 600; }
.sidebar-toggle { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
  .admin-sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 1050; transform: translateX(-100%); transition: transform .25s; }
  .admin-shell.sidebar-open .admin-sidebar { transform: none; }
  .admin-shell.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 1040; }
  .sidebar-toggle { display: inline-flex; }
  .admin-content { padding: 1rem; }
}

.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; height: 100%; display: flex; gap: 1rem; align-items: center; }
.stat-card .icon { width: 50px; height: 50px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; flex-shrink: 0; }
.stat-card .value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stat-card .label { color: var(--muted); font-size: .85rem; }
.icon-green { background: var(--brand-soft); color: var(--brand); }
.icon-gold { background: #fff7d6; color: #a07d00; }
.icon-red { background: #fdecef; color: var(--red); }
.icon-blue { background: #e8f0fe; color: #1a56db; }
.chart-box { position: relative; height: 320px; }
.bar-row { display: flex; align-items: center; gap: .75rem; margin-bottom: .7rem; font-size: .88rem; }
.bar-row .name { width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .track { flex: 1; height: 8px; background: var(--brand-soft); border-radius: 4px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--brand); border-radius: 4px; }
.bar-row .count { width: 3.5rem; text-align: right; font-weight: 600; }

.pagination .page-link { color: var(--brand); border-radius: 8px; margin: 0 2px; }
.pagination .page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }
.min-w-0 { min-width: 0; }

/* Passport photos: 7:9 like a 35x45mm passport photo; object-position mirrors the server-side crop. */
.passport-frame {
  width: 160px; aspect-ratio: 7 / 9; border-radius: 10px; overflow: hidden;
  border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border), var(--shadow); background: var(--brand-soft);
  display: grid; place-items: center;
}
.passport-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.passport-frame i { font-size: 3rem; color: var(--brand); opacity: .5; }
.passport-thumb { width: 36px; height: 46px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); background: var(--brand-soft); }
.id-card .ic-photo { width: 4.6em; aspect-ratio: 7 / 9; border-radius: 6px; overflow: hidden; border: 2px solid var(--brand); flex-shrink: 0; align-self: flex-start; background: var(--brand-soft); }
.id-card .ic-photo img { width: 100%; height: 100%; object-fit: cover; }

/* Signing pad. touch-action: none stops the page scrolling while signing on a phone. */
.signature-pad-wrap {
  position: relative; height: 200px; border: 2px dashed var(--border); border-radius: 12px; background: #fff;
}
.signature-pad-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; z-index: 1; }
.signature-baseline { position: absolute; left: 8%; right: 8%; bottom: 28%; border-bottom: 1px solid var(--border); }
.signature-hint { position: absolute; left: 8%; bottom: calc(28% + 6px); color: #c4c9cf; font-size: .9rem; pointer-events: none; }
.signature-current { max-width: 260px; max-height: 90px; border: 1px solid var(--border); border-radius: 8px; padding: 6px; background: #fff; }
.signature-preview { background: var(--brand-soft); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; display: grid; place-items: center; min-height: 120px; }
.signature-preview img { max-width: 100%; max-height: 110px; }
.nav-pills .nav-link { color: var(--brand); border-radius: 8px; padding: .35rem .8rem; font-size: .88rem; }
.nav-pills .nav-link.active { background: var(--brand); color: #fff; }
