/* Lettertype en kleuren van de CWW-website (WordPress-deel van cwwaterland.nl) */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

:root {
    --blue:   #003c89;   /* CWW-donkerblauw: balk bovenin en voettekst */
    --blue2:  #004e98;   /* CWW-linkblauw */
    --orange: #ff6700;   /* CWW-oranje: actieknoppen */
    --teal:   #219ebc;   /* CWW-iconenblauw */
    --green:  #27ae60;
    --red:    #c0392b;
    --bg:     #f0f4f8;
    --card:   #ffffff;
    --text:   #2c3e50;
    --muted:  #4f5b66;   /* donker genoeg voor goed contrast (ook bij kleurenblindheid of weinig licht) */
    --border: #d5dce6;
    --radius: 8px;
}

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

body {
    font-family: 'Open Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── Header ── */
header {
    background: var(--blue);
    color: #fff;
    padding: 1.2rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
}
header h1 { font-size: 1.4rem; font-weight: 700; letter-spacing: .02em; }
header .sub { font-size: .85rem; opacity: .8; }
header .brand { display: flex; align-items: center; gap: 1rem; color: #fff; text-decoration: none; }
header .brand img { height: 64px; width: auto; display: block; }
header .brand .titles { border-left: 1px solid rgba(255,255,255,.35); padding-left: 1rem; }
footer.site-footer {
    background: var(--blue); color: rgba(255,255,255,.85);
    text-align: center; padding: 1.4rem 1rem; margin-top: 3rem; font-size: .85rem;
}
footer.site-footer a { color: #fff; }
@media (max-width: 600px) {
    header { padding: .8rem 1rem; }
    header .brand img { height: 48px; }
    header h1 { font-size: 1.15rem; }
    header nav a { margin: 0 1rem 0 0; }
}
header nav a {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    margin-left: 1.2rem;
    font-size: .9rem;
    transition: color .15s;
}
header nav a:hover { color: #fff; }

/* ── Layout ── */
.container { max-width: 960px; margin: 2rem auto; padding: 0 1.2rem; }
.container.wide { max-width: 1200px; }

/* ── Cards ── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* ── Project grid ── */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
}
.project-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
}
.project-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid var(--border);
}
.project-card .no-img {
    height: 180px;
    background: linear-gradient(135deg, #e8eef5 0%, #d5dce6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 2.5rem;
}
.project-card .content { padding: 1.2rem; flex: 1; }
.project-card h3 { font-size: 1.05rem; margin-bottom: .4rem; color: var(--blue); }
.project-card .desc { font-size: .88rem; color: var(--muted); line-height: 1.5; }
.project-card .meta { padding: .8rem 1.2rem; border-top: 1px solid var(--border); font-size: .8rem; color: var(--muted); }

/* ── Voting card extras ── */
.vote-input-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: .8rem;
    padding-top: .8rem;
    border-top: 1px solid var(--border);
}
.vote-input-row label { font-size: .85rem; color: var(--text); white-space: nowrap; }
.vote-input-row input[type=number] {
    width: 100px;
    padding: .35rem .6rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: .95rem;
    text-align: right;
}
.vote-input-row .euro-sign { font-weight: 600; color: var(--blue); }

/* ── Budget bar ── */
.budget-bar-wrap {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 2px solid var(--border);
    padding: .8rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.budget-bar-wrap .label { font-size: .85rem; color: var(--muted); }
.budget-bar-wrap .amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--green);
    min-width: 90px;
}
.budget-bar-wrap .amount.over { color: var(--red); }
.budget-bar {
    flex: 1;
    min-width: 160px;
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}
.budget-bar .fill {
    height: 100%;
    background: var(--green);
    border-radius: 6px;
    transition: width .2s, background .2s;
}
.budget-bar .fill.over { background: var(--red); }

/* ── Forms ── */
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: .35rem; color: var(--text); }
.form-group input[type=text],
.form-group input[type=email],
.form-group input[type=password],
.form-group input[type=date],
.form-group input[type=number],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: .6rem .8rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: .95rem;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: border-color .15s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--blue2);
    box-shadow: 0 0 0 3px rgba(41,128,185,.12);
}
.form-group textarea { resize: vertical; min-height: 130px; }
.form-group .hint { font-size: .82rem; color: var(--muted); margin-top: .25rem; max-width: 70ch; line-height: 1.45; }

/* Fout bij een veld: rode rand, uitroepteken en uitleg direct onder het veld */
.form-group.has-error label { color: var(--red); }
.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select { border: 2px solid var(--red); background: #fdf3f2; }
.field-error { color: #922b21; font-size: .85rem; font-weight: 600; margin-top: .35rem; }
.field-note  { color: #1e7e45; font-size: .85rem; font-weight: 600; margin-top: .35rem; }
.char-count { font-size: .78rem; color: var(--muted); float: right; }
.char-count.warn { color: var(--orange); }
.char-count.over { color: var(--red); }

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: .6rem 1.4rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: .95rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-primary  { background: var(--blue);   color: #fff; }
.btn-secondary{ background: var(--blue2);  color: #fff; }
.btn-orange   { background: var(--orange); color: #fff; }
.btn-green    { background: var(--green);  color: #fff; }
.btn-red      { background: var(--red);    color: #fff; }
.btn-outline  { background: transparent; color: var(--blue); border: 1.5px solid var(--blue); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:hover:not(:disabled) { opacity: .88; }

/* ── Alerts ── */
.alert {
    padding: .8rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .9rem;
    border-left: 4px solid;
}
.alert-success { background: #eafaf1; border-color: var(--green); color: #1e8449; }
.alert-error   { background: #fdedec; border-color: var(--red);   color: #922b21; }
.alert-info    { background: #eaf4fb; border-color: var(--blue2); color: #1a5276; }
.alert-warn    { background: #fef9e7; border-color: var(--orange); color: #9a7d0a; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { background: var(--blue); color: #fff; padding: .6rem .9rem; text-align: left; font-weight: 600; }
td { padding: .6rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f7f9fc; }
.badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 700;
}
.badge-green  { background: #d5f5e3; color: #1e8449; }
.badge-orange { background: #fef3cd; color: #9a6700; }
.badge-red    { background: #fde8e8; color: #922b21; }
.badge-blue   { background: #dbeafe; color: #1e40af; }

/* ── Results bar ── */
.result-bar-wrap { margin-top: .5rem; }
.result-bar {
    height: 22px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: .3rem;
}
.result-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue2), var(--blue));
    border-radius: 4px;
    transition: width .6s ease;
    display: flex;
    align-items: center;
    padding-left: .4rem;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}

/* ── Status banner ── */
.status-banner {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue2) 100%);
    color: #fff;
    padding: 1.2rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
.status-banner .status-icon { font-size: 2rem; }
.status-banner h2 { font-size: 1.1rem; margin-bottom: .2rem; }
.status-banner p  { font-size: .88rem; opacity: .88; }

/* ── Admin tabs ── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; flex-wrap: wrap; }
.tab-btn {
    padding: .65rem 1.3rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 600;
    color: var(--muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color .15s;
}
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Misc ── */
.text-muted   { color: var(--muted); }
.text-right   { text-align: right; }
.mt-1  { margin-top: .5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mb-1  { margin-bottom: .5rem; }
.flex  { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.page-title { font-size: 1.5rem; color: var(--blue); margin-bottom: .3rem; }
.page-sub   { color: var(--muted); margin-bottom: 1.5rem; font-size: .9rem; }

footer {
    text-align: center;
    padding: 2rem;
    color: var(--muted);
    font-size: .8rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
    .project-grid { grid-template-columns: 1fr; }
    header { flex-direction: column; align-items: flex-start; }
    .budget-bar-wrap { flex-direction: column; align-items: flex-start; }
}
