/* ============================================================
   COOUDER.NL — Volledig responsive stylesheet
   Breakpoints: desktop 1024+, tablet 768-1023, mobiel <768
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --blauw:        #4A7FD4;
  --blauw-donker: #2D2D5E;
  --oranje:       #E8650A;
  --oranje-licht: #FDF0E8;
  --blauw-licht:  #EBF2FC;
  --tekst:        #1A1A2E;
  --tekst-zacht:  #6B7280;
  --achtergrond:  #F7F8FA;
  --wit:          #FFFFFF;
  --rand:         #E5E7EB;
  --rand-actief:  #C5D5ED;
  --succes:       #16A34A;
  --succes-licht: #DCFCE7;
  --gevaar:       #DC2626;
  --gevaar-licht: #FEE2E2;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.12);
  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    16px;
  --radius-xl:    24px;
}

/* ============================================================
   RESET & BASIS
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--achtergrond);
  color: var(--tekst);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--blauw); text-decoration: none; }
a:hover { color: var(--blauw-donker); }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* ============================================================
   NAVIGATIE
   ============================================================ */
.topnav {
  background: var(--wit);
  border-bottom: 1px solid var(--rand);
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow-sm);
}

.topnav .logo img { height: 36px; width: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 24px;
  flex: 1;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--tekst-zacht);
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  min-height: 44px;
}

.nav-links a:hover, .nav-links a.actief {
  background: var(--blauw-licht);
  color: var(--blauw-donker);
}
.nav-links a.actief { font-weight: 600; }

.nav-rechts {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.nav-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blauw), var(--oranje));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 14px;
  cursor: pointer; flex-shrink: 0;
  transition: opacity .15s;
}
.nav-avatar:hover { opacity: 0.85; }

/* Hamburger — verborgen op desktop */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px; height: 44px;
  background: none; border: none;
  cursor: pointer; padding: 8px;
  border-radius: var(--radius-sm);
  margin-left: auto;
}

.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--tekst); border-radius: 2px;
  transition: all .25s;
}

.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobiel menu */
.nav-mobiel {
  display: none;
  position: fixed;
  top: 64px; left: 0; right: 0; bottom: 0;
  background: var(--wit);
  z-index: 190;
  overflow-y: auto;
  padding: 12px;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--rand);
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.nav-mobiel.open { display: flex; }

.nav-mobiel a {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 16px; font-weight: 500;
  color: var(--tekst);
  border: 1px solid transparent;
  transition: all .15s;
  min-height: 52px;
}

.nav-mobiel a:hover, .nav-mobiel a.actief {
  background: var(--blauw-licht);
  color: var(--blauw-donker);
  border-color: var(--rand-actief);
}

.nav-mobiel-scheiding {
  height: 1px; background: var(--rand); margin: 4px 0;
}

/* ============================================================
   CONTAINER
   ============================================================ */
.container      { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
.container-smal { max-width: 640px; margin: 0 auto; padding: 32px 24px; }

/* ============================================================
   GRIDS
   ============================================================ */
.tegel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.grid-2     { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3     { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4     { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stats-grid  { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.acties-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.twee-kolommen { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

/* ============================================================
   TEGELS
   ============================================================ */
.tegel {
  background: var(--wit); border: 1px solid var(--rand);
  border-radius: var(--radius-lg); padding: 20px;
  transition: all .2s; cursor: pointer;
  text-decoration: none; color: var(--tekst); display: block;
}
.tegel:hover { box-shadow: var(--shadow-md); border-color: var(--rand-actief); transform: translateY(-2px); color: var(--tekst); }
.tegel:active { transform: scale(0.98); }

.tegel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

.tegel-icoon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.tegel-icoon.blauw  { background: var(--blauw-licht); }
.tegel-icoon.oranje { background: var(--oranje-licht); }
.tegel-icoon.groen  { background: var(--succes-licht); }
.tegel-icoon.rood   { background: var(--gevaar-licht); }
.tegel-icoon.paars  { background: #F3E8FF; }

.tegel-badge { background: var(--oranje); color: white; border-radius: 20px; padding: 2px 10px; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.tegel-titel { font-size: 13px; color: var(--tekst-zacht); font-weight: 500; margin-bottom: 4px; }
.tegel-waarde { font-size: 26px; font-weight: 800; color: var(--tekst); line-height: 1.2; }
.tegel-sub    { font-size: 13px; color: var(--tekst-zacht); margin-top: 6px; }

.tegel-actie { background: linear-gradient(135deg, var(--blauw-donker), var(--blauw)); color: white; border: none; }
.tegel-actie:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(74,127,212,0.35); color: white; }
.tegel-actie .tegel-titel  { color: rgba(255,255,255,0.7); }
.tegel-actie .tegel-waarde { color: white; }
.tegel-actie .tegel-sub    { color: rgba(255,255,255,0.6); }

.tegel-actie-oranje { background: linear-gradient(135deg, var(--oranje), #F4930A); color: white; border: none; }
.tegel-actie-oranje:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(232,101,10,0.35); color: white; }

/* ============================================================
   KAARTEN & FORMULIEREN
   ============================================================ */
.kaart { background: var(--wit); border: 1px solid var(--rand); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 16px; }
.kaart-titel { font-size: 16px; font-weight: 700; color: var(--tekst); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.form-groep { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; font-weight: 600; color: var(--tekst); margin-bottom: 6px; }

.form-input, .form-select, .form-textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--rand); border-radius: var(--radius-sm);
  font-size: 16px; /* BELANGRIJK: 16px voorkomt zoom op iOS! */
  font-family: inherit; color: var(--tekst); background: var(--wit);
  transition: border-color .15s, box-shadow .15s; outline: none;
  -webkit-appearance: none; appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--blauw); box-shadow: 0 0 0 3px rgba(74,127,212,0.15);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-hulp { font-size: 13px; color: var(--tekst-zacht); margin-top: 4px; }

/* ============================================================
   KNOPPEN
   ============================================================ */
.knop {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer; border: none; transition: all .15s;
  text-decoration: none; white-space: nowrap;
  min-height: 44px; /* iOS minimum touch target */
  -webkit-tap-highlight-color: transparent;
}
.knop:active { transform: scale(0.97); }

.knop-primair       { background: var(--blauw); color: white; }
.knop-primair:hover  { background: var(--blauw-donker); color: white; }
.knop-oranje        { background: var(--oranje); color: white; }
.knop-oranje:hover   { background: #C8540A; color: white; }
.knop-gradient      { background: linear-gradient(135deg, var(--blauw-donker), var(--oranje)); color: white; }
.knop-gradient:hover { opacity: 0.9; color: white; }
.knop-wit           { background: var(--wit); color: var(--tekst); border: 1.5px solid var(--rand); }
.knop-wit:hover      { border-color: var(--blauw); color: var(--blauw); background: var(--blauw-licht); }
.knop-gevaar        { background: var(--gevaar); color: white; }
.knop-gevaar:hover   { background: #B91C1C; color: white; }

.knop-groot { padding: 14px 28px; font-size: 16px; border-radius: var(--radius-md); min-height: 52px; }
.knop-klein { padding: 7px 14px; font-size: 13px; min-height: 36px; }
.knop-breed { width: 100%; }

/* ============================================================
   ALERTS, BADGES, LIJSTEN
   ============================================================ */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; }
.alert-succes { background: var(--succes-licht); color: #166534; border: 1px solid #BBF7D0; }
.alert-fout   { background: var(--gevaar-licht); color: #991B1B; border: 1px solid #FECACA; }
.alert-info   { background: var(--blauw-licht); color: var(--blauw-donker); border: 1px solid #BFDBFE; }
.alert-oranje { background: var(--oranje-licht); color: #9A3412; border: 1px solid #FED7AA; }

.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-blauw  { background: var(--blauw-licht); color: var(--blauw-donker); }
.badge-oranje { background: var(--oranje-licht); color: #9A3412; }
.badge-groen  { background: var(--succes-licht); color: #166534; }
.badge-rood   { background: var(--gevaar-licht); color: #991B1B; }
.badge-grijs  { background: #F3F4F6; color: #4B5563; }

.lijst-item { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rand); gap: 12px; min-height: 52px; }
.lijst-item:last-child { border-bottom: none; }
.lijst-item-icoon { width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--blauw-licht); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.lijst-item-tekst { flex: 1; min-width: 0; }
.lijst-item-titel { font-size: 14px; font-weight: 600; color: var(--tekst); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lijst-item-sub   { font-size: 13px; color: var(--tekst-zacht); }

/* ============================================================
   PAGINA HEADER
   ============================================================ */
.pagina-header { margin-bottom: 24px; }
.pagina-header h1 { font-size: 24px; font-weight: 800; }
.pagina-header p  { font-size: 15px; color: var(--tekst-zacht); }
.pagina-header-rij { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }

.leeg { text-align: center; padding: 48px 24px; color: var(--tekst-zacht); }
.leeg-icoon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.leeg h3    { font-size: 18px; font-weight: 700; color: var(--tekst); margin-bottom: 8px; }
.leeg p     { font-size: 14px; margin-bottom: 20px; }

/* ============================================================
   CHAT
   ============================================================ */
.chat-wrapper { display: flex; flex-direction: column; height: calc(100dvh - 64px); }
.chat-berichten { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; -webkit-overflow-scrolling: touch; }
.chat-bericht { max-width: 75%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.5; word-break: break-word; }
.chat-bericht.van-mij    { background: var(--blauw); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-bericht.van-ander  { background: var(--wit); border: 1px solid var(--rand); color: var(--tekst); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-invoer { background: var(--wit); border-top: 1px solid var(--rand); padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); display: flex; gap: 12px; align-items: flex-end; }
.chat-invoer textarea { flex: 1; border: 1.5px solid var(--rand); border-radius: var(--radius-md); padding: 10px 14px; font-family: inherit; font-size: 16px; resize: none; outline: none; max-height: 120px; min-height: 44px; -webkit-appearance: none; }
.chat-invoer textarea:focus { border-color: var(--blauw); }

/* Tooncoach indicator */
.tooncoach-wrap { padding: 0 16px 8px; }
.tooncoach { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13px; animation: fadeIn .2s ease; }
.tooncoach.goed    { background: var(--succes-licht); color: #166534; }
.tooncoach.waarsch { background: var(--oranje-licht); color: #9A3412; }
.tooncoach.slecht  { background: var(--gevaar-licht); color: #991B1B; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   LANDINGSPAGINA
   ============================================================ */
.hero { background: linear-gradient(135deg, var(--blauw-donker) 0%, #3A5FA8 50%, var(--blauw) 100%); color: white; padding: 72px 24px; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -30%; right: -15%; width: 500px; height: 500px; background: radial-gradient(circle, rgba(232,101,10,0.15) 0%, transparent 70%); pointer-events: none; }
.hero h1 { font-size: clamp(28px, 5vw, 52px); font-weight: 800; line-height: 1.15; margin-bottom: 20px; max-width: 700px; margin-left: auto; margin-right: auto; }
.hero h1 span { background: linear-gradient(135deg, #FFB347, var(--oranje)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { font-size: clamp(16px, 2.5vw, 20px); opacity: 0.85; max-width: 540px; margin: 0 auto 36px; line-height: 1.6; }
.hero-knoppen { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.feature-kaart { background: var(--wit); border: 1px solid var(--rand); border-radius: var(--radius-lg); padding: 28px; transition: all .2s; }
.feature-kaart:hover { box-shadow: var(--shadow-md); border-color: var(--rand-actief); }
.feature-icoon { font-size: 36px; margin-bottom: 16px; }
.feature-kaart h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.feature-kaart p  { font-size: 14px; color: var(--tekst-zacht); line-height: 1.6; }

.stats-balk { background: var(--blauw-donker); color: white; padding: 28px 24px; }
.stats-balk-inner { max-width: 900px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; text-align: center; }

.prijs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 960px; margin: 0 auto; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrapper { min-height: 100dvh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--blauw-donker) 0%, #3A5FA8 60%, var(--blauw) 100%); padding: 24px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.login-kaart { background: var(--wit); border-radius: var(--radius-xl); padding: clamp(24px, 5vw, 48px); max-width: 420px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.2); text-align: center; }
.login-logo { height: 44px; margin: 0 auto 24px; }
.login-kaart h1 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.login-kaart p  { font-size: 15px; color: var(--tekst-zacht); margin-bottom: 28px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--wit); border-top: 1px solid var(--rand); padding: 24px; padding-bottom: max(24px, env(safe-area-inset-bottom)); text-align: center; font-size: 13px; color: var(--tekst-zacht); }

/* ============================================================
   TABLET (768-1023px)
   ============================================================ */
@media (max-width: 1023px) {
  .grid-4, .stats-grid, .acties-grid { grid-template-columns: repeat(2, 1fr); }
  .prijs-grid { grid-template-columns: 1fr; max-width: 480px; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .container { padding: 24px 16px; }
}

/* ============================================================
   MOBIEL (<768px)
   ============================================================ */
@media (max-width: 767px) {
  .grid-2, .grid-3, .grid-4, .stats-grid, .acties-grid,
  .twee-kolommen, .tegel-grid { grid-template-columns: 1fr; }

  .features-grid { grid-template-columns: 1fr; }
  .stats-balk-inner { grid-template-columns: 1fr; gap: 16px; }

  .hero { padding: 48px 20px; }
  .hero-knoppen { flex-direction: column; align-items: center; }
  .hero-knoppen .knop { width: 100%; max-width: 320px; }

  .container { padding: 16px; }
  .container-smal { padding: 16px; }

  .pagina-header-rij { flex-direction: column; align-items: flex-start; }
  .pagina-header-rij > div:last-child { width: 100%; display: flex; gap: 8px; }
  .pagina-header-rij > div:last-child .knop { flex: 1; }

  .kaart { padding: 16px; }
  .tegel { padding: 16px; }
  .tegel-waarde { font-size: 22px; }

  .chat-bericht { max-width: 85%; }
  .login-kaart { padding: 24px 16px; }
  .topnav { padding: 0 16px; }
  .topnav .logo img { height: 30px; }

  .knop-groep-mobiel { flex-direction: column !important; }
  .knop-groep-mobiel .knop { width: 100%; }
}

/* ============================================================
   KLEIN MOBIEL (<400px)
   ============================================================ */
@media (max-width: 399px) {
  .tegel-waarde { font-size: 20px; }
  .hero h1 { font-size: 26px; }
  .container { padding: 12px; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .topnav, .nav-hamburger, .nav-mobiel, .site-footer, .knop { display: none !important; }
  .container { padding: 0; max-width: 100%; }
  body { background: white; }
  .kaart { box-shadow: none; border: 1px solid #ddd; }
}
