/* =========================================================
   BASE — reset, typografie, layout-shell
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--c-ink);
  background: var(--c-bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
button, input, textarea, select {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5 { margin: 0; line-height: var(--lh-tight); font-weight: var(--fw-bold); }
p { margin: 0; }

/* Focus — zichtbaar voor toegankelijkheid */
*:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Selectie */
::selection { background: var(--c-primary); color: #fff; }

/* Scrollbar — subtiel maar zichtbaar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--c-line-2); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* =========================================================
   APP LAYOUT — phone-frame op desktop, full-screen op mobile
   ========================================================= */

.stage {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
}
.stage > .demo-rail { background: linear-gradient(160deg, #2f6b4a 0%, #214e36 100%); color: #fff; }
.theme-dark .stage > .demo-rail { background: linear-gradient(160deg, #1a3525 0%, #0d1c14 100%); }

@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; }
  .stage > .demo-rail { position: sticky; top: 0; z-index: 100; }
  .stage > .canvas { padding: 0 !important; }
  .phone {
    width: 100% !important;
    height: 100vh !important;
    max-height: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: var(--c-bg) !important;
    box-shadow: none !important;
  }
  .phone::after { display: none !important; }
  .screen { border-radius: 0 !important; }
}

.canvas {
  padding: var(--space-6);
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 600px at 30% -10%, rgba(232, 215, 183, .5) 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 100%, rgba(207, 220, 210, .5) 0%, transparent 60%),
    var(--c-bg-page);
  min-height: 100vh;
}
.theme-dark .canvas {
  background:
    radial-gradient(1200px 600px at 30% -10%, rgba(50, 45, 30, .35) 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 100%, rgba(35, 50, 40, .35) 0%, transparent 60%),
    var(--c-bg-page);
}

.phone {
  width: 400px;
  height: 820px;
  max-height: calc(100vh - 48px);
  background: #1a2733;
  border-radius: 44px;
  padding: 14px;
  box-shadow: var(--shadow-3);
  position: relative;
  overflow: hidden;
}
.phone::after {
  content: "";
  position: absolute;
  top: 14px; left: 50%; transform: translateX(-50%);
  width: 130px; height: 28px;
  background: #1a2733;
  border-radius: 0 0 18px 18px;
  z-index: 4;
}
.screen {
  background: var(--c-bg);
  border-radius: 32px;
  height: 100%;
  width: 100%;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.status-bar {
  padding: 14px 24px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--c-ink);
  flex-shrink: 0;
}
.status-bar .icons { opacity: .8; }

@media (max-width: 900px) {
  .status-bar { display: none; }
}

.app-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

#screen-mount {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 var(--space-5) var(--space-5);
  scroll-behavior: smooth;
}

/* =========================================================
   DEMO-RAIL — control panel om snel rol te wisselen
   ========================================================= */
.demo-rail {
  padding: var(--space-6) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  color: #fff;
}
.demo-rail h4 {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1.2px;
  margin: var(--space-2) 0 var(--space-1);
  opacity: .75;
  font-weight: var(--fw-semibold);
}

.demo-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.demo-brand-mark {
  width: 44px; height: 44px;
  background: #fff;
  color: var(--c-primary-dark);
  border-radius: 12px;
  display: grid; place-items: center;
  font-weight: var(--fw-extra);
  font-size: 22px;
}
.demo-brand-text {
  font-weight: var(--fw-bold);
  font-size: 22px;
  letter-spacing: -.3px;
}
.demo-brand-text small {
  display: block;
  font-weight: var(--fw-normal);
  font-size: 13px;
  opacity: .8;
}

.demo-info {
  background: rgba(255,255,255,.08);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: 13px;
  line-height: 1.55;
}
.demo-info strong { display: block; margin-bottom: 4px; }

.demo-roles { display: flex; flex-direction: column; gap: var(--space-2); }
.demo-role {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: #fff;
  padding: var(--space-3);
  border-radius: 14px;
  text-align: left;
  font-size: 14px;
  transition: background .15s, transform .12s;
}
.demo-role:hover { background: rgba(255,255,255,.12); }
.demo-role:active { transform: scale(.98); }
.demo-role.active {
  background: #fff;
  color: var(--c-primary-dark);
  border-color: #fff;
  font-weight: var(--fw-semibold);
}
.demo-role .ico {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.15);
  display: grid; place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.demo-role.active .ico { background: var(--c-primary-soft); }
.demo-role small { display: block; font-size: 12px; opacity: .85; font-weight: var(--fw-normal); }

.demo-actions { display: flex; flex-direction: column; gap: var(--space-2); }
.demo-link {
  background: none;
  border: none;
  color: #fff;
  text-align: left;
  padding: var(--space-2) 0;
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: .85;
}
.demo-link:hover { opacity: 1; }

.demo-foot {
  margin-top: auto;
  font-size: 12px;
  opacity: .65;
  line-height: 1.5;
}
