/* ==========================================================================
   JCI Voting Tool — design system
   Overgenomen van AwardsJCI (awards.jci.vlaanderen) zodat beide platformen
   dezelfde JCI-huisstijl delen: kleuren, typografie, knoppen en cards.
   ========================================================================== */

:root {
  /* JCI Brand colors */
  --jci-navy: #3A67B1;
  --jci-navy-dark: #2A4F8C;
  --jci-navy-light: #7B9BD4;
  --jci-navy-ultralight: #ECF1FA;
  --jci-aqua: #0097D7;
  --jci-aqua-dark: #007DB3;
  --jci-gold: #EDBE38;
  --jci-gold-dark: #C9A02E;
  --jci-gold-light: #FAEBB4;
  --jci-seafoam: #56BDA3;
  /* Neutrals (tuned to JCI typography colors) */
  --jci-text: #0A0F29;        /* Off black for headings */
  --jci-text-soft: #414042;   /* 90% black for body */
  --gray-50: #F7F8FB;
  --gray-100: #EFF2F7;
  --gray-200: #E2E6EE;
  --gray-300: #CBD2DD;
  --gray-400: #94A0B2;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --green: #56BDA3;
  --green-dark: #3FA38A;
  --green-light: #DDF1EA;
  --red: #DC2626;
  --red-light: #FEE2E2;
  --shadow-sm: 0 1px 2px rgba(10,15,41,0.04);
  --shadow-md: 0 4px 14px rgba(10,15,41,0.07);
  --shadow-lg: 0 12px 32px rgba(10,15,41,0.12);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--jci-text-soft); background: var(--gray-50);
  line-height: 1.5; min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 { color: var(--jci-text); font-weight: 700; }
img { max-width: 100%; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* ==========================================================================
   HEADER
   ========================================================================== */
.header {
  background: white;
  color: var(--jci-text);
  padding: 0.85rem 0;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 0.85rem; font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; color: var(--jci-text); text-decoration: none; }
.logo-img { height: 40px; width: auto; display: block; }
.logo-text { line-height: 1.2; color: var(--jci-text); }
.logo-text small { display: block; font-weight: 500; font-size: 0.78rem; color: var(--jci-navy); opacity: 0.85; }

.header-nav { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.header-nav .nav-link {
  padding: 0.45rem 0.8rem; color: var(--gray-600); text-decoration: none;
  font-weight: 600; font-size: 0.92rem; border-radius: 100px;
  transition: all 0.15s;
}
.header-nav .nav-link:hover { color: var(--jci-navy); background: var(--jci-navy-ultralight); }

.lang-switch {
  display: flex; gap: 0.2rem; margin-left: 0.5rem;
  background: var(--gray-100); border-radius: 100px; padding: 0.2rem;
}
.lang-pill {
  padding: 0.28rem 0.7rem; border-radius: 100px; text-decoration: none;
  font-size: 0.78rem; font-weight: 700; color: var(--gray-500);
  transition: all 0.15s; letter-spacing: 0.03em;
}
.lang-pill:hover { color: var(--jci-navy); }
.lang-pill.active { background: var(--jci-navy); color: white; }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  background: linear-gradient(135deg, var(--jci-navy-dark) 0%, var(--jci-navy) 60%, #2E77B8 100%);
  color: white;
  padding: 7rem 1.5rem 6rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 80% -20%, rgba(237,190,56,0.18) 0%, transparent 55%);
}
.hero-inner { max-width: 780px; margin: 0 auto; position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-block; font-size: 0.82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--jci-gold);
  margin-bottom: 1.25rem;
}
.hero h1 {
  color: white; font-size: 2.7rem; font-weight: 800; letter-spacing: -0.02em;
  line-height: 1.15; margin-bottom: 1rem;
}
.hero-sub { font-size: 1.15rem; color: rgba(255,255,255,0.85); margin-bottom: 2.25rem; }
.hero-actions { display: flex; gap: 0.85rem; justify-content: center; flex-wrap: wrap; }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-block; padding: 0.75rem 1.5rem; border-radius: 100px;
  font-size: 0.95rem; font-weight: 600; border: none; cursor: pointer;
  transition: all 0.15s; font-family: inherit; text-decoration: none;
  letter-spacing: 0.01em; text-align: center;
}
.btn-primary, .btn-base-color { background: var(--jci-navy); color: white; }
.btn-primary:hover, .btn-base-color:hover { background: var(--jci-navy-dark); transform: translateY(-1px); box-shadow: 0 6px 14px rgba(58,103,177,0.28); color: white; }
.btn-primary:disabled, .btn-base-color:disabled { background: var(--gray-300); cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary { background: white; color: var(--jci-navy); border: 2px solid var(--jci-navy); padding: calc(0.75rem - 2px) calc(1.5rem - 2px); }
.btn-secondary:hover { background: var(--jci-navy-ultralight); color: var(--jci-navy); }

.btn-success, .btn-green { background: var(--jci-seafoam); color: white; }
.btn-success:hover, .btn-green:hover { background: var(--green-dark); transform: translateY(-1px); box-shadow: 0 6px 14px rgba(86,189,163,0.32); color: white; }

.btn-info { background: var(--jci-aqua); color: white; }
.btn-info:hover { background: var(--jci-aqua-dark); transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0,151,215,0.28); color: white; }

.btn-warning, .btn-accent { background: var(--jci-gold); color: var(--jci-text); }
.btn-warning:hover, .btn-accent:hover { background: var(--jci-gold-dark); color: white; }

.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #B91C1C; color: white; }

.btn-hero-ghost { background: transparent; color: white; border: 2px solid rgba(255,255,255,0.65); padding: calc(0.75rem - 2px) calc(1.5rem - 2px); }
.btn-hero-ghost:hover { background: rgba(255,255,255,0.12); border-color: white; color: white; }

.btn-block { display: block; width: 100%; }
.btn-block + .btn-block { margin-top: 0.6rem; }
.btn-large { padding: 0.9rem 2rem; font-size: 1.02rem; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.85rem; }

/* ==========================================================================
   START-SECTIE (keuze + panelen)
   ========================================================================== */
.start-section { padding: 4rem 0 5rem; }
/* Het werkgedeelte (kiezerslijst, moties, resultaten) krijgt de volle 90% van het scherm */
.start-section > .container { width: 90%; max-width: none; }
.page-title-center { text-align: center; max-width: 640px; margin: 0 auto 2.5rem; }
.page-title-center h2 { font-size: 1.9rem; letter-spacing: -0.02em; font-weight: 800; margin-bottom: 0.5rem; }
.page-title-center .subtitle { color: var(--jci-text-soft); font-size: 1rem; }
.accent-line {
  display: inline-block; width: 56px; height: 4px; border-radius: 2px;
  background: var(--jci-gold); margin-top: 1.25rem;
}

.start-grid { display: grid; grid-template-columns: 320px 1fr; gap: 1.5rem; align-items: start; }
/* Zonder dit krijgt de 1fr-kolom min-width:auto en zet een brede tabel
   (de kiezerslijst) de hele kolom — en dus de pagina — buiten het scherm.
   min-width:0 laat de kolom op 1fr blijven; de tabel scrollt dan binnen de card. */
.start-col-main { min-width: 0; }
@media (max-width: 860px) {
  .start-grid { grid-template-columns: 1fr; }
}

/* Panelen: ook de via jQuery gegenereerde inhoud (admin/kiezer-schermen)
   landt in deze containers, dus de card-stijl moet dat allemaal dragen. */
.panel-card {
  background: white; border-radius: 12px; border: 1px solid var(--gray-200);
  padding: 1.5rem; box-shadow: var(--shadow-sm);
  /* Brede inhoud (kiezerslijst) scrollt binnen de card i.p.v. de pagina te verbreden. */
  overflow-x: auto;
}
.panel-card:empty { padding: 0; border: none; background: transparent; box-shadow: none; }
.panel-card + .panel-card { margin-top: 1.5rem; }

.panel-card h2 { font-size: 1.4rem; letter-spacing: -0.01em; margin-bottom: 0.35rem; }
.panel-card h3 { font-size: 1.15rem; letter-spacing: -0.01em; margin-bottom: 0.75rem; }
.panel-card h4 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.panel-card p { margin-bottom: 0.9rem; }

.card-title {
  font-size: 1.05rem; font-weight: 700; color: var(--jci-text);
  margin-bottom: 1rem; padding-bottom: 0.6rem; border-bottom: 2px solid var(--gray-100);
  letter-spacing: -0.01em;
}

/* Motieknoppen die onder het admin-menu verschijnen (#motions) */
#motions { margin-top: 1rem; }
#motions .btn { margin-top: 0.6rem; }

/* ==========================================================================
   FORMULIEREN (incl. door jQuery gegenereerde velden)
   ========================================================================== */
label {
  display: block; font-weight: 600; font-size: 0.85rem;
  color: var(--gray-700); margin-bottom: 0.4rem;
}
.form-control {
  width: 100%; padding: 0.7rem 0.9rem; border: 2px solid var(--gray-200);
  border-radius: 8px; font-size: 0.95rem; font-family: inherit;
  color: var(--jci-text); background: white;
  transition: border 0.15s; margin-bottom: 1rem;
}
.form-control:focus { outline: none; border-color: var(--jci-navy); }
select.form-control { appearance: auto; }
textarea.form-control { min-height: 110px; resize: vertical; line-height: 1.5; }
input[type="checkbox"].form-control {
  width: 1.05rem; height: 1.05rem; display: inline-block;
  margin: 0 0 0 0.55rem; vertical-align: -0.15rem; accent-color: var(--jci-navy);
}
.form-control-sm { padding: 0.45rem 0.6rem; font-size: 0.88rem; margin-bottom: 0; }
.control-label { display: inline-block; margin-top: 0.25rem; }

.help-block { font-size: 0.82rem; color: var(--gray-500); margin: -0.4rem 0 1rem; line-height: 1.45; }

.form-divider { border: none; border-top: 1px solid var(--gray-200); margin: 1.75rem 0; }

/* Organisatie aanmaken + inloggen naast elkaar */
.org-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; align-items: start; }
.org-grid .org-col + .org-col { border-left: 1px solid var(--gray-200); padding-left: 2rem; }
@media (max-width: 860px) {
  .org-grid { grid-template-columns: 1fr; gap: 1.75rem 0; }
  .org-grid .org-col + .org-col { border-left: none; padding-left: 0; border-top: 1px solid var(--gray-200); padding-top: 1.75rem; }
}
.panel-card hr { border: none; border-top: 1px solid var(--gray-200); margin: 1.5rem 0; }

/* Tekstkleuren die de bestaande scripts gebruiken */
.text-base-color { color: var(--jci-navy); font-weight: 700; }
.text-info { color: var(--jci-navy); }

/* ==========================================================================
   TABELLEN (kiezerslijst, quorum- en resultaattabellen uit scripts.php)
   ========================================================================== */
table.table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: white; border: 1px solid var(--gray-200); border-radius: 10px;
  overflow: hidden; margin: 1.25rem 0; font-size: 0.92rem;
}
table.table th {
  background: var(--gray-50); padding: 0.7rem 0.9rem; text-align: left;
  font-size: 0.8rem; font-weight: 700; color: var(--gray-700);
  text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--gray-200);
}
table.table td {
  padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700); vertical-align: middle;
}
table.table tr:last-child td { border-bottom: none; }
table.table tbody tr:hover td { background: var(--gray-50); }
table.table .form-control { margin-bottom: 0; padding: 0.45rem 0.6rem; font-size: 0.88rem; }

/* Actieknoppen in tabellen: rustige, gelijkvormige pills op één lijn.
   Kleuren volgen de actie: navy = versturen, outline = bewerken, rood = verwijderen. */
table.table .btn {
  padding: 0.4rem 0.85rem; font-size: 0.82rem;
  margin: 0.1rem 0.15rem 0.1rem 0; white-space: nowrap;
}
table.table .btn:hover { transform: none; box-shadow: none; }
/* Actiekolommen krimpen tot hun inhoud zodat de knoppen op één lijn blijven */
table.table td:has(> .btn) { white-space: nowrap; width: 1%; }
table.table .btn-primary, table.table .btn-base-color, table.table .btn-info {
  background: var(--jci-navy-ultralight); color: var(--jci-navy-dark);
}
table.table .btn-primary:hover, table.table .btn-base-color:hover, table.table .btn-info:hover {
  background: var(--jci-navy); color: white;
}
table.table .btn-secondary {
  border-width: 1.5px; padding: calc(0.4rem - 1.5px) calc(0.85rem - 1.5px);
}
table.table .btn-danger { background: var(--red-light); color: #B91C1C; }
table.table .btn-danger:hover { background: var(--red); color: white; }
table.table .btn-warning { background: var(--jci-gold-light); color: #6B4E0A; }
table.table .btn-warning:hover { background: var(--jci-gold); color: var(--jci-text); }
table.table .btn-success { background: var(--green-light); color: var(--green-dark); }
table.table .btn-success:hover { background: var(--jci-seafoam); color: white; }

/* ==========================================================================
   SPACING-UTILITIES die scripts.php genereert
   ========================================================================== */
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mr-1 { margin-right: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: white;
  text-align: center;
  padding: 2.5rem 1.5rem 2rem;
  font-size: 0.85rem;
  color: var(--gray-500);
  border-top: 1px solid var(--gray-200);
  margin-top: 4rem;
}
.site-footer .footer-logo { height: 44px; width: auto; opacity: 0.85; margin-bottom: 1.25rem; }
.footer-social { display: flex; justify-content: center; gap: 1rem; margin-bottom: 1.25rem; }
.footer-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--gray-100); color: var(--gray-600);
  transition: all 0.15s;
}
.footer-social a:hover { background: var(--jci-navy); color: white; }
.footer-social svg { width: 17px; height: 17px; fill: currentColor; }
.site-footer .copyright a {
  color: var(--gray-600); text-decoration: none; font-weight: 600;
  border-bottom: 1px solid var(--gray-300);
  transition: color 0.15s, border-color 0.15s;
}
.site-footer .copyright a:hover { color: var(--jci-navy); border-bottom-color: currentColor; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 640px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 0.65rem; }
  .header-nav { width: 100%; justify-content: space-between; }
  .lang-switch { margin-left: 0; }
  .hero { padding: 4.5rem 1.25rem 4rem; }
  .hero h1 { font-size: 1.9rem; }
  .hero-sub { font-size: 1rem; }
  .hero-actions .btn { width: 100%; }
  .start-section { padding: 2.5rem 0 3.5rem; }
  .panel-card { padding: 1.25rem; }
  .container { padding: 0 1rem; }
  /* Touch-vriendelijke knoppen in tabellen */
  table.table .btn { min-height: 40px; }
}
