/* gplanr: base styles (desktop first). No @media rules in this file:
   main_tablet.css (tablets and smaller) and main_gsm.css (phones) hold all of those and are loaded after this one. */

:root {
    --page: #1e2b58;
    --panel: #f3f2f7;
    --navy: #2f4495;
    --navy-hover: #263a82;
    --line: #c5c8cc;
    --focus: #8fb2ff;
    --text-dark: #222;
    --text-muted: #444;
    --text-faint: #555;
    --error: #b3261e;
    --error-on-dark: #ffb4b4;
    --ok: #1b6e3c;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--page);
    color: #fff;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

img { max-width: 100%; }

[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#main-content { min-height: 100vh; min-height: 100dvh; }

/* Every page's content sits in .divbody, centred on the screen. */
.divbody {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
}

.text-emphasis { color: #fff; font-weight: 700; }

/* ── Cards, forms and buttons (tenant pages) ───────────────────────────── */
.brand { width: min(420px, 80vw); height: auto; }
.brand-small { width: min(320px, 70vw); height: auto; }
.page-title { margin: 0; font-size: 1.8rem; font-weight: 600; text-align: center; }
.org-image { max-width: min(420px, 80vw); height: auto; border-radius: 8px; }

.card { width: min(380px, 100%); background: var(--panel); color: var(--text-dark); border-radius: 10px; padding: 1.5rem; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
.card h1, .card h2 { margin: 0 0 1rem; font-size: 1.2rem; color: var(--navy); }
.card p { margin: 0 0 .5rem; font-size: .9rem; color: var(--text-muted); }
.card label { display: block; margin: .8rem 0 .3rem; font-size: .85rem; font-weight: 600; }
.card input { width: 100%; height: 2.75rem; padding: 0 .9rem; background: #fff; color: var(--text-dark); border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.card input:focus-visible, .btn:focus-visible, .link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.btn {
    display: block; width: 100%; height: 2.75rem; margin-top: 1.2rem;
    background: var(--navy); color: #fff; border: 0; border-radius: 6px;
    font: inherit; font-weight: 700; text-transform: uppercase; text-align: center; line-height: 2.75rem;
    text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--navy-hover); }
.btn:disabled { opacity: .6; cursor: progress; }

.link { display: block; width: 100%; margin-top: .6rem; text-align: center; font: inherit; font-size: .9rem; color: var(--navy); cursor: pointer; background: none; border: 0; }
.link:hover { text-decoration: underline; }

/* A message only takes room when there is one, so the card grows on an error. */
.msg { margin: .8rem 0 0; font-size: .9rem; color: var(--error); }
.msg:empty { display: none; }
.ok { color: var(--ok); }
.help { margin: 0 0 .5rem; font-size: .9rem; color: var(--text-muted); }
.who { margin: 0 0 .3rem; font-size: 1.05rem; }
.level { margin: 0; color: var(--text-faint); font-size: .9rem; }

/* ── Landing page (bare gplanr.be) ─────────────────────────────────────── */
.page-landing .divbody { gap: 0; padding: 0; }

/* The picture already contains a painted sign-up box. The real form sits exactly on top of it
   (positions are percentages of the 1664 x 624 picture) and is opaque, so it covers the painted one. */
.stage { position: relative; width: 100%; max-width: 1664px; margin: 0 auto; container-type: inline-size; }
.stage img { display: block; width: 100%; height: auto; }

.signup { position: absolute; left: 56.1%; top: 91.27%; width: 32.93%; height: 6.49%; display: flex; gap: 1.64%; margin: 0; }
.signup input[type=email] {
    flex: 0 0 72.54%; min-width: 0; height: 100%; padding: 0 3.5%; background: #fff; color: var(--text-dark);
    border: 1px solid var(--line); border-radius: .5cqw; font: inherit; font-size: clamp(11px, .96cqw, 17px);
    box-shadow: 0 0 0 .25cqw var(--panel);
}
.signup input::placeholder { color: #767676; }
.signup button {
    flex: 1; min-width: 0; height: 100%; background: var(--navy); color: #fff; border: 0; border-radius: .5cqw;
    font: inherit; font-weight: 700; font-size: clamp(10px, .9cqw, 16px); text-transform: uppercase; cursor: pointer;
    box-shadow: 0 0 0 .25cqw var(--panel);
}
.signup button:hover { background: var(--navy-hover); }
.signup button:disabled { opacity: .6; cursor: progress; }
.signup input:focus-visible, .signup button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* On wide screens the messages hang below the picture without moving it, so the picture stays centred. */
.status { position: absolute; top: 100%; left: 0; right: 0; margin: .8rem 1rem 0; min-height: 1.6em; text-align: center; font-size: 1rem; }
.status.error { color: var(--error-on-dark); }
.privacy { position: absolute; top: 100%; left: 0; right: 0; margin: 4.2rem 1rem 0; text-align: center; font-size: .8rem; opacity: .7; }
.privacy2 { position: absolute; top: 100%; left: 0; right: 0; margin: 3.2rem 1rem 0; text-align: center; font-size: .8rem; opacity: .7; }

/* ── Footer and "about" box (include/footer.php) ───────────────────────── */
.footer {
    display: flex; align-items: center; gap: 5px;
    position: fixed; left: 5px; bottom: 5px; z-index: 1000;
    width: 150px; padding: 5px;
    background: var(--page); color: #c9cfe6; border: 1px solid var(--navy); border-radius: 6px;
    cursor: pointer;
}
.footer-logo { line-height: 1; }
.footer-logo img { display: block; width: 50px; height: auto; }
.footer-version { margin-left: 5px; font-family: Arial, sans-serif; font-size: 11px; }
.footer-version .text-emphasis { margin-left: 5px; }

#ct_about {
    display: none;
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 20000;
    width: 404px; max-width: calc(100vw - 20px); max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); overflow-y: auto;
    background: var(--page); color: #fff; border: 1px solid var(--navy); border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
#ct_about.visible { display: block; }
.ct_about_header { position: relative; padding: 15px 0 10px; text-align: center; }
.ct_about_header img { display: block; width: 90%; max-width: 100%; height: auto; margin: 0 auto; }
#closeAbout { position: absolute; right: 8px; top: 0; font-size: 30px; line-height: 1.2; cursor: pointer; }
#gotoGiTaC { display: flex; align-items: center; gap: 12px; width: 100%; padding: 5px 10px 5px 20px; background: var(--navy); color: #fff; border-radius: 0 0 10px 10px; cursor: pointer; }
#meerinfo { flex: 1; }
#gotoGiTaC img { width: 38%; height: auto; }

/* ── Beheer (beheer.php): configuration pages with a menu column on the right ───────────────────────────── */
.page-beheer .divbody { justify-content: flex-start; align-items: stretch; gap: 1rem; padding: 1.5rem 15.5rem 5rem 1.5rem; }
.beheer { min-width: 0; width: 100%; max-width: 1100px; }
.beheer-title { margin: 0 0 1rem; font-size: 1.8rem; font-weight: 600; }
#beheer-content { min-width: 0; background: var(--panel); color: var(--text-dark); border-radius: 10px; padding: 1.5rem; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
#beheer-content .help { margin: 0; }
#beheer-content .errors { margin: 0 0 1rem; padding: 0 0 0 1.2rem; color: var(--error); font-size: .9rem; }

/* Beheer sections: a list (with filter and "Nieuw") beside an edit form. Generic, reused by every section. */
.beheer-split { display: grid; grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.beheer-listside { min-width: 0; }
.beheer-listtools { display: flex; gap: .5rem; margin-bottom: .75rem; }
.beheer-filter { flex: 1; min-width: 0; height: 2.75rem; padding: 0 .9rem; background: #fff; color: var(--text-dark); border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.beheer-list { list-style: none; margin: 0; padding: 0; max-height: 32rem; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.beheer-list:empty { display: none; }
.beheer-list li + li { border-top: 1px solid var(--line); }
.beheer-item { display: block; width: 100%; padding: .65rem .9rem; background: none; border: 0; color: var(--text-dark); font: inherit; text-align: left; cursor: pointer; }
.beheer-item:hover { background: #e8eaf5; }
.beheer-item.selected { background: var(--navy); color: #fff; }
.beheer-item-name { display: block; overflow-wrap: anywhere; font-weight: 600; }
.beheer-item-sub { display: block; overflow-wrap: anywhere; font-size: .8rem; opacity: .8; }
.beheer-empty { margin: .5rem 0 0; }
.beheer-form { min-width: 0; padding: 1rem 1.25rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.beheer-formtitle { margin: 0 0 1rem; font-size: 1.2rem; color: var(--navy); }
.beheer-field { margin-bottom: 1rem; }
.beheer-field label { display: block; margin-bottom: .3rem; font-size: .85rem; font-weight: 600; }
.beheer-field input, .beheer-field select { width: 100%; height: 2.75rem; padding: 0 .9rem; background: #fff; color: var(--text-dark); border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.beheer-hint { display: block; margin-top: .25rem; font-size: .8rem; color: var(--text-faint); }
.beheer-checks { margin: 0 0 1rem; padding: 0; border: 0; min-width: 0; }
.beheer-checks legend { padding: 0; margin-bottom: .3rem; font-size: .85rem; font-weight: 600; }
.beheer-check { display: flex; align-items: center; gap: .6rem; min-height: 2.5rem; }
.beheer-check input { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; }
.beheer-check label { overflow-wrap: anywhere; }
.beheer-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.beheer-btn { height: 2.75rem; padding: 0 1.2rem; background: var(--navy); color: #fff; border: 0; border-radius: 6px; font: inherit; font-weight: 700; cursor: pointer; }
.beheer-btn:hover { background: var(--navy-hover); }
.beheer-btn:disabled { opacity: .6; cursor: progress; }
.beheer-btn-danger { background: #fff; color: var(--error); border: 1px solid var(--error); }
.beheer-btn-danger:hover { background: #fbe9e7; }
.beheer-error { margin-bottom: 1rem; padding: .6rem .9rem; background: #fbe9e7; border: 1px solid var(--error); border-radius: 6px; color: var(--error); }
.beheer-error[hidden], .beheer-empty[hidden] { display: none; }
.beheer-error .errors { margin: 0; }
.beheer-filter:focus-visible, .beheer-item:focus-visible, .beheer-btn:focus-visible, .beheer-field input:focus-visible, .beheer-field select:focus-visible, .beheer-check input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.sidemenu {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 900; width: 14rem; overflow-y: auto;
    display: flex; flex-direction: column; gap: .25rem; padding: 1.5rem 1rem;
    background: var(--panel); color: var(--text-dark); box-shadow: -4px 0 18px rgba(0, 0, 0, .25);
}
.sidemenu-title { margin: 0 0 .75rem; font-size: 1.1rem; font-weight: 700; color: var(--navy); }
.sidemenu a { display: block; padding: .7rem .9rem; border-radius: 6px; color: var(--navy); font-weight: 600; text-decoration: none; }
.sidemenu a:hover { background: #e3e5f1; }
.sidemenu a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sidemenu a.active { background: var(--navy); color: #fff; }
.sidemenu .sidemenu-back { margin-top: auto; font-weight: 400; font-size: .9rem; color: var(--text-muted); }

/* Beheer: groups screen (tabs, textarea, member picker with a scroll area) */
.beheer-field textarea { display: block; width: 100%; padding: .6rem .9rem; background: #fff; color: var(--text-dark); border: 1px solid var(--line); border-radius: 6px; font: inherit; resize: vertical; }
.beheer-field textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.beheer-tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: 1rem; border-bottom: 2px solid var(--line); }
.beheer-tab { height: 2.75rem; padding: 0 1.1rem; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; color: var(--text-dark); font: inherit; font-weight: 600; cursor: pointer; }
.beheer-tab:hover { background: #e8eaf5; }
.beheer-tab.active { border-bottom-color: var(--navy); color: var(--navy); }
.beheer-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.beheer-pane[hidden] { display: none; }
.beheer-membertools { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.beheer-count { flex: 0 0 auto; font-size: .85rem; color: var(--text-faint); }
.beheer-memberlist { max-height: 14rem; overflow-y: auto; padding: .25rem .6rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.beheer-member[hidden], .beheer-memberlist .help[hidden] { display: none; }
.beheer-memberlist .help { margin: .5rem 0; }
.beheer-groupfilter { display: block; width: 100%; height: 2.75rem; margin-bottom: .75rem; padding: 0 .6rem; background: #fff; color: var(--text-dark); border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.beheer-field textarea, .beheer-field select { max-width: 100%; }
.beheer-field input[type=time], .beheer-field input[type=date], .beheer-field input[type=number] { max-width: 16rem; }
.beheer-field[hidden], .beheer-herhaling-part[hidden], .beheer-hint[hidden], .beheer-pnone[hidden] { display: none; }
.beheer-duur-velden { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.beheer-duur-velden input { width: 6rem; }
.beheer-unit { font-size: .9rem; color: var(--text-faint); }
.beheer-days { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin: .6rem 0 .3rem; }
.beheer-day { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.5rem; }
.beheer-day input { width: 1.25rem; height: 1.25rem; }
.beheer-day label { margin: 0; font-weight: 400; }
.beheer-herhaling-part { margin-top: .6rem; }
.beheer-participants { margin: 0 0 1rem; padding: 0; border: 0; min-width: 0; }
.beheer-participants legend { padding: 0; margin-bottom: .3rem; font-size: .85rem; font-weight: 600; }
.beheer-prows { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .6rem; }
.beheer-prows:empty { display: none; }
.beheer-prow { display: grid; grid-template-columns: 9rem minmax(0, 1fr) 8.5rem auto; gap: .5rem; align-items: center; padding: .5rem; border: 1px solid var(--line); border-radius: 6px; background: #f8f8fc; }
.beheer-prow select, .beheer-prow input[type=text] { width: 100%; min-width: 0; height: 2.75rem; padding: 0 .6rem; background: #fff; color: var(--text-dark); border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.beheer-premove { padding: 0 .8rem; }
.beheer-btn-light { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.beheer-btn-light:hover { background: #e8eaf5; }
.beheer-prow select:focus-visible, .beheer-prow input:focus-visible, .beheer-groupfilter:focus-visible, .beheer-field input[type=time]:focus-visible, .beheer-field input[type=date]:focus-visible, .beheer-field input[type=number]:focus-visible, .beheer-field textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Beheer: rules screen (default rules block, own rules, JSON parameters) */
.beheer-defaults { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 2px solid var(--line); }
.beheer-subtitle { margin: 0 0 .6rem; font-size: 1.15rem; color: var(--navy); }
.beheer-defaults .beheer-field { max-width: 32rem; }
.beheer-saved { display: block; margin-top: .25rem; font-size: .8rem; color: var(--text-faint); }
.beheer-saved[hidden] { display: none; }
.beheer-stage { margin-bottom: 1rem; }
.beheer-field textarea.beheer-json { font-family: Consolas, "Courier New", monospace; line-height: 1.4; tab-size: 2; }
.beheer-field select:disabled { opacity: .6; cursor: progress; }
