/* Fonts zoals op myebox.be: Roboto voor tekst, Barlow voor koppen (lokaal gehost) */
@font-face { font-family: "Roboto"; src: url("../fonts/roboto-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("../fonts/roboto-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("../fonts/roboto-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  /* Standaard = officiële ENGIE-kleuren (engie.be licht thema).
     applyTheme() overschrijft dit met de waarden uit js/config.js. */
  --primary: #0079cc;
  --primary-dark: #005288;
  --cta: #d04800;
  --cta-hover: #9a3500;
  --accent: #63add5;
  --accent-strong: #0079cc;
  --hero-bg: #ebf9fd;
  --page-bg: #ebf9fd;
  --surface: #ffffff;
  --field-bg: #f5f5f5;
  --text: #212121;
  --muted: #616161;
  --border: #e0e0e0;
  --error: #cc0033;
  --success: #009934;
  --focus-ring: rgba(0, 121, 204, 0.30);
  --shadow: 0 12px 28px rgba(0, 82, 136, 0.12);
  --shadow-small: 0 1px 2px rgba(0, 82, 136, 0.08);
  --radius: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* ---------- Beveiliging: geen selectie, geen kopie-hint, geen lang-drukken ---------- */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;      /* lang-drukken (iOS/Android contextmenu) uit */
}
/* Invoervelden blijven functioneel: typen en cursor bewegen moet kunnen */
input, textarea, select, [contenteditable] {
  -webkit-user-select: text;
  user-select: text;
}
::selection { background: transparent; }

/* DevTools open? Pagina-inhoud afdekken (klasse wordt door security.js gezet) */
body.devtools-open::after {
  content: "⛔ Inspecteren is niet toegestaan op deze pagina";
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  background: #14181d; color: #fff;
  font-family: sans-serif; font-size: 1.1rem; text-align: center;
}

body {
  margin: 0;
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  color: var(--muted);
  background: var(--page-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Barlow", "Roboto", sans-serif;
  color: var(--text);
  line-height: 1.25;
  margin-top: 0;
}
strong { color: var(--text); }

img { max-width: 100%; display: block; }
code { font-size: 0.88em; background: var(--page-bg); padding: 0.1rem 0.3rem; border-radius: 5px; }

.container { width: min(1280px, calc(100% - 48px)); margin-inline: auto; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

/* ---------- Welkomst-kaartje: gecentreerd, compact, geen fullscreen ---------- */
.welcome {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%);   /* centraal op het scherm */
  z-index: 100;
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 16px;
  box-shadow: 0 22px 54px rgba(0, 82, 136, 0.24);
  padding: 26px 28px 22px;
  text-align: left;
  opacity: 1; visibility: visible;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  animation: welcomeIn 0.5s cubic-bezier(.2,.8,.2,1) backwards;
}
.welcome.is-hidden {
  opacity: 0; visibility: hidden; pointer-events: none; animation: none;
}
.welcome__x {
  position: absolute; top: 8px; right: 8px;
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); font-size: 1.45rem; line-height: 1; cursor: pointer;
}
.welcome__x:hover { background: var(--page-bg); color: var(--text); }
.welcome__x:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus-ring); }
.welcome__logo {
  width: 112px; height: auto; object-fit: contain;
  margin: 0 0 16px;
}
.welcome__rule {
  width: 52px; height: 4px; margin: 0 0 18px; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--cta));
}
.welcome__kicker {
  margin: 0 0 6px; font-family: "Barlow", sans-serif; font-size: 0.76rem;
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-strong);
}
.welcome__kicker strong { color: var(--text); }
.welcome__title { font-size: 1.55rem; font-weight: 700; margin: 0 0 12px; }
.welcome__text { margin: 0 0 22px; }
.welcome__p {
  margin: 0 0 12px; color: var(--muted);
  font-size: 1rem; line-height: 1.6;
}
.welcome__p:last-child { margin-bottom: 0; }

/* Groene vinkjes vóór elke alinea; kleur volgt het thema (--success). */
.welcome__text--checks .welcome__p { position: relative; padding-left: 30px; }
.welcome__text--checks .welcome__p::before {
  content: "";
  position: absolute; left: 0; top: 0.2em;
  width: 20px; height: 20px; border-radius: 50%;
  background-color: var(--success);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.4 6.3 11.7 13 5' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
}
.welcome__btn { width: 100%; }
.welcome__hint { margin: 12px 0 0; font-size: 0.76rem; color: var(--muted); }
/* Alleen opacity/scale animeren: transform blijft voor de centrering. */
@keyframes welcomeIn {
  from { opacity: 0; scale: .97; }
  to   { opacity: 1; scale: 1; }
}

/* ---------- Header: alleen het (grotere) logo, gecentreerd ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-inner { min-height: 100px; display: flex; align-items: center; justify-content: center; }
.brand { display: flex; align-items: center; text-decoration: none; color: var(--text); margin-inline: auto; }
.brand-logo { width: auto; height: 78px; max-width: 320px; object-fit: contain; object-position: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  font-family: "Barlow", sans-serif; font-size: 1rem; font-weight: 600; text-decoration: none;
  padding: 12px 20px; transition: background 0.15s ease, border-color 0.15s ease;
}
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: none; box-shadow: 0 0 0 4px var(--focus-ring);
}
.btn--primary { background: var(--cta, var(--primary)); color: #fff; }
.btn--primary:hover { background: var(--cta-hover, var(--primary-dark)); }
.btn--secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn--small { padding: 9px 16px; }
.btn--large { padding: 14px 26px; }

/* ---------- Hero: panorama (1920x680), met fade naar pagina zodat formulier niet opgeplakt lijkt ---------- */
.hero {
  width: 100%;
  height: clamp(300px, 34vw, 440px);
  overflow: hidden;
  background: var(--hero-bg);
  border-bottom: none;
  position: relative;
}
.hero img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 32%;
  display: block;
}
/* zachte overgang hero -> pagina-achtergrond */
.hero::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 130px;
  background: linear-gradient(to bottom, rgba(235,249,253,0) 0%, var(--page-bg) 88%);
  pointer-events: none;
}
.eyebrow {
  margin: 0 0 10px; color: var(--accent); font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.eyebrow--dark { color: var(--accent-strong); }

/* ---------- Layout ---------- */
.content-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; column-gap: 36px;
  align-items: start; padding: 0 0 64px;
  position: relative; z-index: 2;
  margin-top: -72px;
}
.form-intro {
  display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 28px;
  border-top: 4px solid var(--accent);
}
.form-intro h2 { font-size: 2.1rem; font-weight: 700; margin: 0; }
.form-intro p:not(.eyebrow) { color: var(--muted); font-size: 1rem; margin: 8px 0 0; max-width: 58ch; }
.progress-box {
  min-width: 250px; background: var(--page-bg); border: none;
  border-radius: var(--radius); padding: 16px 18px; box-shadow: none;
  color: var(--text); font-size: 0.95rem; font-weight: 700;
  flex-shrink: 0;
}
.progress-track { height: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; margin-top: 9px; }
.progress-track span { display: block; height: 100%; width: 0; background: var(--cta, var(--accent)); border-radius: inherit; transition: width 0.25s ease; }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px; border: none; }
.alert p { margin: 4px 0 0; }
.alert--error { background: #fef3f2; color: #7a271a; }
.alert--success { background: #ecfdf3; color: #05603a; }

/* ---------- Form sections: blokken zonder border ---------- */
.form-section {
  background: var(--surface); border: none; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 36px 40px 40px; margin: 0 0 24px;
}
.section-head {
  display: flex; gap: 16px; align-items: flex-start;
  padding-bottom: 20px; margin-bottom: 26px;
  border-bottom: 1px solid var(--border);
}
.step-label {
  display: block; margin-bottom: 3px;
  font-family: "Barlow", sans-serif; font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent-strong);
}
.section-head h3 { margin: 0; font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.5; }

/* Honeypot: onzichtbaar voor mensen, zichtbaar voor bots */
.hp-field {
  position: absolute; left: -9999px; width: 1px; height: 1px;
  overflow: hidden; opacity: 0; pointer-events: none;
}

.fields-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px; row-gap: 22px; align-items: start;
}
.field { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: 1rem; color: var(--text); line-height: 1.35; }
.required { color: var(--error); }
.field input, .field select {
  width: 100%; height: 52px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--field-bg); color: var(--text); font: inherit; font-size: 1rem; padding: 0 14px;
}
.field input::placeholder { color: #9a9dab; }
.field input:hover, .field select:hover { border-color: var(--accent-strong); }
.field input:focus, .field select:focus { border-color: var(--accent-strong); background: var(--surface); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--error); }
.field-help { color: var(--muted); font-size: 0.83rem; }
.field-error { color: var(--error); font-size: 0.85rem; font-weight: 600; }

.form-actions {
  background: var(--surface); border: none; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px 32px;
}
.consent { display: flex; gap: 11px; align-items: flex-start; font-weight: 500; color: var(--text); cursor: pointer; }
.consent input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--cta, var(--primary)); flex: 0 0 auto; }
.action-row { display: flex; justify-content: space-between; gap: 14px; margin-top: 22px; }
.privacy-note { color: var(--muted); font-size: 0.85rem; margin: 14px 0 0; }

/* ---------- Sidebar: blokken zonder border ---------- */
.sidebar { display: grid; gap: 24px; position: sticky; top: 92px; }
.side-card {
  background: var(--surface); border: none; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px;
}
.side-card h3 { margin: 0 0 14px; font-size: 1.2rem; font-weight: 700; }
.side-card p { margin: 0; }
.side-card--dark {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--text);
  box-shadow: none;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.side-card--dark h3 { color: var(--text); }
.side-card--dark p { color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.83rem; margin-top: 10px !important; }
.section-links { display: grid; }
.section-links a {
  display: flex; align-items: center; gap: 12px;
  font-family: "Barlow", sans-serif; font-size: 1.02rem;
  color: var(--text); text-decoration: none; font-weight: 600;
  padding: 11px 2px; border-bottom: 1px solid var(--border);
}
.section-links a:last-child { border-bottom: none; }
.section-links a:hover { color: var(--accent-strong); }

/* ---------- Footer: dynamisch, zoals een website-footer ---------- */
.site-footer { background: var(--primary-dark); color: rgba(255,255,255,0.78); margin-top: 8px; }
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 40px;
  padding: 48px 0 36px;
}
.footer-col h4 { color: #fff; font-size: 1.05rem; font-weight: 600; margin: 0 0 16px; }
.footer-logo {
  width: auto; height: 56px; max-width: 230px; object-fit: contain; object-position: left center;
  background: #fff; border-radius: 8px; padding: 6px 10px; margin-bottom: 16px;
}
.footer-desc { margin: 0; max-width: 34ch; line-height: 1.55; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-links a { color: rgba(255,255,255,0.78); text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-contact { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-contact span { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.55); }
.footer-contact a { color: #fff; text-decoration: none; font-weight: 500; }
.footer-contact a:hover { text-decoration: underline; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.14); padding: 20px 0 24px; font-size: 0.88rem;
}
.footer-legal { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-legal a { color: rgba(255,255,255,0.78); text-decoration: none; }
.footer-legal a:hover { color: #fff; text-decoration: underline; }

/* ---------- Responsive ---------- */
/* Tablet + mobiel: app-weergave met één witte achtergrond voor het formulier */
@media (max-width: 940px) {
  body { background: var(--surface); }
  .header-inner { min-height: 84px; }
  .brand-logo { height: 60px; max-width: 250px; }
  .hero { height: clamp(220px, 38vw, 320px); }
  .hero img { object-position: 24% 30%; }
  .hero::after {
    height: 80px;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, var(--surface) 88%);
  }
  .sidebar { display: none; }
  .content-grid {
    grid-template-columns: minmax(0, 1fr);
    width: 100%; padding: 0 0 48px;
    margin-top: -46px;
  }
  .form-intro { padding: 24px 24px 20px; margin: 0 16px 16px; border-radius: var(--radius); }
  .progress-box { background: var(--page-bg); box-shadow: none; }
  .alert { margin: 0 24px 16px; }
  .form-section {
    border-radius: 0; box-shadow: none; margin: 0;
    padding: 30px 24px 34px;
    border-bottom: 1px solid #e9edf1;
  }
  .form-actions { border-radius: 0; box-shadow: none; padding: 30px 24px 8px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 640px) {
  .container { width: min(100% - 24px, 1180px); }
  .welcome { padding: 18px 20px 16px; }
  .welcome__logo { width: 92px; margin-bottom: 10px; }
  .welcome__rule { margin-bottom: 14px; }
  .welcome__title { font-size: 1.35rem; margin-bottom: 10px; }
  .welcome__text { margin-bottom: 16px; }
  .welcome__p { font-size: 0.92rem; line-height: 1.55; margin-bottom: 10px; }
  .welcome__text--checks .welcome__p { padding-left: 28px; }
  .welcome__text--checks .welcome__p::before { width: 18px; height: 18px; background-size: 11px 11px; }
  .header-inner { min-height: 78px; }
  .header-inner > .btn { display: none; }
  .brand-logo { height: 52px; max-width: 215px; }
  .hero { height: 210px; }
  .hero img { object-position: 18% 28%; }
  .form-intro { display: block; padding: 22px 20px 20px; margin: 0 12px 16px; }
  .progress-box { margin-top: 18px; }
  .alert { margin: 0 20px 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; padding: 36px 0 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .form-section { padding: 26px 20px 30px; }
  .form-actions { padding: 26px 20px 8px; }
  .section-head { align-items: flex-start; }
  .section-head h3 { font-size: 1.35rem; }
  .fields-grid, .sidebar { grid-template-columns: 1fr; }
  .field--full { grid-column: auto; }
  .action-row { flex-direction: column-reverse; }
  .action-row .btn { width: 100%; }
}

/* === VALIDATIE-FLITS === */
.field input.is-flash,
.field select.is-flash,
.field textarea.is-flash,
.consent.is-flash {
  animation: fieldFlash 2.4s ease-out forwards;
}

@keyframes fieldFlash {
  0%   { border-color: var(--error); box-shadow: 0 0 0 4px rgba(180,35,24,.22); background-color: rgba(180,35,24,.06); }
  55%  { border-color: var(--error); box-shadow: 0 0 0 3px rgba(180,35,24,.10); background-color: var(--field-bg); }
  100% { border-color: var(--border); box-shadow: none; background-color: var(--field-bg); }
}

.field-error { display: block; margin-top: 6px; font-size: .85rem; color: var(--error); }
.field-error[hidden] { display: none; }

.consent input[aria-invalid="true"] {
  outline: 2px solid var(--error);
  outline-offset: 3px;
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .field input.is-flash,
  .field select.is-flash,
  .field textarea.is-flash,
  .consent.is-flash { animation-duration: .01s; }
}

/* === VALIDATIE-V2 === */
.field input.is-flash,
.field select.is-flash,
.field textarea.is-flash {
  animation: fieldFlashStrong 2.4s cubic-bezier(.36,.07,.19,.97) forwards;
}

@keyframes fieldFlashStrong {
  0%   { border-color: var(--error); box-shadow: 0 0 0 6px rgba(180,35,24,.30); background-color: rgba(180,35,24,.12); transform: translateX(-4px); }
  10%  { transform: translateX(4px); }
  20%  { transform: translateX(-3px); }
  30%  { transform: translateX(3px); }
  40%  { transform: translateX(0); }
  70%  { border-color: var(--error); box-shadow: 0 0 0 3px rgba(180,35,24,.14); background-color: var(--field-bg); }
  100% { border-color: var(--border); box-shadow: none; background-color: var(--field-bg); }
}

.field-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 7px;
  font-size: .86rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--error);
}
.field-error::before { content: "⚠"; font-weight: 700; line-height: 1; }
.field-error[hidden] { display: none; }

.consent.is-flash {
  animation: consentFlash 2.4s ease-out forwards;
}
@keyframes consentFlash {
  0%   { outline: 3px solid var(--error); outline-offset: 4px; background-color: rgba(180,35,24,.10); }
  70%  { outline: 3px solid var(--error); outline-offset: 4px; background-color: transparent; }
  100% { outline: 3px solid transparent; outline-offset: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .field input.is-flash, .field select.is-flash,
  .field textarea.is-flash, .consent.is-flash { animation-duration: .01s; }
  .welcome { animation: none; transition-duration: .01s; }
}
