/* Inburgering A1 – complete application layout (single source of truth) */

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

body.auth-page {
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

h1, h2, h3, h4 { color: var(--text); font-weight: 600; line-height: 1.25; margin: 0 0 0.75rem; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.125rem; }
p { color: var(--text-muted); margin: 0 0 1rem; }

/* Hide legacy navbar */
.navbar,
.mobile-menu-toggle { display: none !important; }

/* App shell */
.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

.app-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: linear-gradient(180deg, #1e3530 0%, var(--text) 42%, #152622 100%);
    color: #e8f0ed;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    padding: 1.25rem 0;
}

.app-sidebar.pn-line-pattern--on-green::before {
    opacity: 0.75;
}

.app-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1rem;
}

.app-sidebar__logo-link {
    display: flex;
    flex-shrink: 0;
    line-height: 0;
}

.app-sidebar__brand .app-logo--mark {
    height: 40px;
    width: 40px;
    display: block;
}

/* Nova Digital Solutions logo (square button) */
.app-logo--nova {
    object-fit: contain;
    border-radius: 10px;
}

.app-logo--nova-full {
    width: auto;
    max-width: 160px;
    height: auto;
    object-fit: contain;
}

.app-logo--footer.app-logo--nova {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

/* Site logo */
.app-logo {
    display: block;
    max-width: 100%;
    height: auto;
}

.dash-hero__logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-logo--hero {
    width: 88px;
    height: 88px;
    filter: drop-shadow(0 4px 12px rgba(15, 107, 86, 0.12));
}

body.auth-page .footer {
    margin-left: 0 !important;
    width: 100%;
    flex-shrink: 0;
}

.app-sidebar__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

.app-sidebar__subtitle {
    font-size: 0.75rem;
    color: #a8bdb6;
}

.app-nav {
    flex: 1;
    padding: 0 0.75rem;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.app-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    margin-bottom: 0.25rem;
    border-radius: 8px;
    color: #cfe0da !important;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: background 0.15s;
}

.app-nav a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff !important;
}

.app-nav a.active {
    background: var(--primary);
    color: #fff !important;
}

.app-nav a i { width: 1.25rem; text-align: center; opacity: 0.9; }

.app-sidebar__foot {
    padding: 1rem 1.25rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.8125rem;
    color: #a8bdb6;
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    max-width: 100%;
}

.app-topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    overflow: visible;
    box-sizing: border-box;
    container-type: inline-size;
    container-name: app-topbar;
}

.app-topbar__left {
    font-size: 0.875rem;
    color: var(--text-muted);
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-topbar__welcome-short {
    display: none;
}

/* Smalle topbar: korte welkomst; ruim genoeg: volledige tekst */
@container app-topbar (max-width: 480px) {
    .app-topbar__welcome-full {
        display: none !important;
    }

    .app-topbar__welcome-short {
        display: inline !important;
    }
}

@container app-topbar (min-width: 481px) {
    .app-topbar__welcome-full {
        display: inline;
    }

    .app-topbar__welcome-short {
        display: none !important;
    }
}

/* Fallback zonder container queries */
@media (max-width: 480px) {
    .app-topbar__welcome-full {
        display: none !important;
    }

    .app-topbar__welcome-short {
        display: inline !important;
    }
}

.app-topbar__right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lang-select,
.lang-picker-wrap,
.lang-picker {
    position: relative;
}

.lang-picker__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.4rem 0.55rem;
    font-size: 0.875rem;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    line-height: 1.2;
    min-height: 36px;
}

.lang-picker__toggle:hover,
.lang-picker__toggle:focus-visible {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent);
}

.lang-picker__flag {
    width: 1.35rem;
    height: 1rem;
    border-radius: 2px;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 12%, transparent);
    flex-shrink: 0;
    line-height: 1;
    object-fit: cover;
    display: block;
}

.lang-picker__flag:not(svg) {
    object-fit: cover;
}

svg.lang-picker__flag {
    overflow: hidden;
}

.lang-picker__flag--fallback {
    display: inline-block;
    width: 1.35rem;
    height: 1rem;
    border-radius: 2px;
    background: var(--surface-muted);
    box-shadow: 0 0 0 1px var(--border);
}

.lang-picker__code {
    font-weight: 600;
    letter-spacing: 0.03em;
    font-size: 0.8125rem;
}

.lang-picker__chevron {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-inline-start: 0.1rem;
}

.lang-picker__chevron i {
    transition: transform 0.15s ease;
}

.lang-picker.is-open .lang-picker__chevron i {
    transform: rotate(180deg);
}

.app-topbar .lang-picker__menu {
    z-index: 10500;
}

.lang-picker__menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    inset-inline-end: 0;
    z-index: 200;
    min-width: 7.5rem;
    margin: 0;
    padding: 0.35rem;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: min(70vh, 20rem);
    overflow-y: auto;
}

.lang-picker__option {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.55rem;
    border-radius: 7px;
    text-decoration: none;
    color: var(--text) !important;
    font-size: 0.875rem;
}

.lang-picker__option:hover,
.lang-picker__option:focus-visible {
    background: var(--surface-muted);
    outline: none;
}

.lang-picker__option.is-active {
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
    font-weight: 600;
}

.lang-select select {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.4rem 0.65rem;
    font-size: 0.875rem;
    background: var(--surface);
    color: var(--text);
}

.app-user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-user-menu a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--text) !important;
}

.app-user-menu a:hover {
    border-color: var(--primary);
    color: var(--primary) !important;
}

.app-content,
.main-content {
    flex: 1;
    padding: 1.5rem;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: clip;
}

/* Auth layout (login, register, start) */
.auth-page-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
}

.auth-page-main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    box-sizing: border-box;
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
    gap: 2.5rem;
    align-items: start;
    width: 100%;
}

.auth-layout--login {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
}

.auth-form-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 12px);
    padding: 2rem;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.08));
    min-width: 0;
}

.auth-form-panel--compact {
    padding: 1.5rem 1.35rem;
}

.auth-form-panel__title {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.auth-welcome {
    padding: 0.5rem 0;
    min-width: 0;
}

.auth-welcome__brand {
    margin: 0 0 0.35rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.auth-welcome h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 1rem;
    line-height: 1.25;
}

.auth-welcome__lead {
    font-size: 1.125rem;
    color: var(--primary);
    font-weight: 600;
    margin: 0 0 1.25rem;
    line-height: 1.5;
}

.auth-welcome__story-heading {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.auth-welcome__story {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider--tight {
    margin: 1rem 0;
}

.auth-register-link {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.9rem;
}

.auth-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    width: 100%;
}

.auth-top {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.auth-top__brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--text);
    min-width: 0;
}

.auth-top__title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.auth-top__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-left: auto;
}

.auth-top .lang-select select {
    min-width: 11rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.9375rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}

.auth-card--wide { max-width: 520px; }

.auth-card h2 { margin-bottom: 1.25rem; }

/* Cards & panels */
.panel,
.card,
.page-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.page-header {
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.page-header h1 { margin: 0; }
.page-header p { margin: 0.35rem 0 0; }

.card { margin-bottom: 1.25rem; }
.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--text);
    font-weight: 600;
}
.card-body { padding: 1.25rem; color: var(--text); }

/* Buttons */
.btn,
button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary,
button[type="submit"].btn-primary {
    background: var(--primary);
    color: #fff !important;
    border-color: var(--primary);
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
    background: var(--surface);
    color: var(--text) !important;
    border-color: var(--border);
}

.btn-outline {
    background: transparent;
    color: var(--primary) !important;
    border-color: var(--primary);
}

/* Forms */
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-label,
label {
    display: block;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.35rem;
    font-size: 0.9375rem;
}

.form-group { margin-bottom: 1rem; }

/* Alerts */
.alert,
.error {
    padding: 1rem 1.15rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid;
}

.alert-danger,
.alert-error,
.error {
    background: #fef3f2;
    border-color: #fecdca;
    color: #912018 !important;
}

.alert-success {
    background: #ecfdf3;
    border-color: #abefc6;
    color: #067647 !important;
}

/* Home dashboard */
.dash-hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.dash-hero__eyebrow {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.dash-hero h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 0.75rem;
}

.dash-hero__lead {
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--text);
    margin: 0 0 0.65rem;
    max-width: 42rem;
}

.dash-hero__access-hint {
    font-size: 0.9rem;
    color: var(--text-muted, #5c6f68);
    margin: 0.75rem 0 0;
    padding: 0.65rem 0.85rem;
    background: var(--primary-soft, #e8f5f0);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.dash-hero__scope {
    margin: 0.5rem 0 0;
    font-size: 0.95rem;
    color: var(--text-muted, #5c6f68);
}

.dash-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dash-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.15s, border-color 0.15s;
}

.dash-tile:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.dash-tile__icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    margin-bottom: 0.85rem;
}

.dash-tile h3 { margin-bottom: 0.35rem; font-size: 1.05rem; }
.dash-tile p { margin: 0; font-size: 0.9rem; }

.dash-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.stat-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem;
    text-align: center;
}

.stat-box strong {
    display: block;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.stat-box span {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.app-footer {
    padding: 1rem 1.5rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
    width: 100%;
    box-sizing: border-box;
}

.app-footer p { margin: 0; color: var(--text-muted); }

.guest-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--surface-muted);
    color: var(--text-muted);
    border-radius: 4px;
    vertical-align: middle;
}

.guest-chat-readonly-note {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Footer — compact */
.footer {
    background: var(--text);
    color: #b8ccc6;
    margin-top: auto;
    padding: 0;
    margin-left: 0;
    width: 100%;
    box-sizing: border-box;
    font-size: 0.8125rem;
}

.footer a {
    color: #9fd4c8;
    text-decoration: none;
}

.footer a:hover {
    color: #c8ebe2;
    text-decoration: underline;
}

body:not(.auth-page) .footer {
    margin-left: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w));
}

body.auth-page .footer {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: none;
}

.footer-compact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
    width: 100%;
    box-sizing: border-box;
}

.footer-compact__brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.footer-compact__identity {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.footer-compact__site {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.footer-compact__tagline {
    font-size: 0.75rem;
    color: #8fa8a0;
    line-height: 1.3;
}

.footer-compact__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}

.footer-compact__email {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #9fd4c8 !important;
    font-size: 0.75rem;
    white-space: nowrap;
}

.footer-compact__email i {
    font-size: 0.7rem;
    opacity: 0.85;
}

.footer .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

.footer-bottom-content--compact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.55rem 1.25rem;
    width: 100%;
    box-sizing: border-box;
}

.footer-copyright,
.footer-credit {
    margin: 0;
    color: #8fa8a0;
    font-size: 0.75rem;
    line-height: 1.4;
}

.footer-credit {
    color: #7d9a92;
}

.footer-bottom-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .footer-compact {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 1rem;
    }

    .footer-compact__links {
        gap: 0.5rem 0.85rem;
    }

    .footer-bottom-content--compact {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.5rem 1rem;
    }
}

.footer::before, .footer::after { display: none !important; }

/* Tables & admin */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    color: var(--text);
}

th, td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    color: var(--text);
}

th {
    background: var(--surface-muted);
    font-weight: 600;
    color: var(--text);
}

/* Mobile */
@media (max-width: 900px) {
    .auth-layout,
    .auth-layout--login {
        grid-template-columns: 1fr;
    }

    .dash-hero { grid-template-columns: 1fr; }
    .dash-hero__logo { order: -1; margin-bottom: 0.5rem; }
    .app-logo--hero { width: 72px; height: 72px; }
    .dash-stats { grid-template-columns: repeat(2, 1fr); }
}

/* Smalle tablet: icon-zijbalk */
@media (min-width: 769px) and (max-width: 900px) {
    .app-sidebar {
        width: 72px;
        padding: 1rem 0;
    }
    .app-sidebar__brand span,
    .app-sidebar__title,
    .app-sidebar__subtitle,
    .app-nav a span,
    .app-sidebar__foot { display: none; }
    .app-sidebar__brand { justify-content: center; padding: 0 0.5rem 1rem; }
    .app-nav a { justify-content: center; padding: 0.75rem; }
    .app-main,
    body:not(.auth-page) .footer {
        margin-left: 72px;
    }
    body:not(.auth-page) .footer {
        width: calc(100% - 72px);
    }
}

@media (max-width: 600px) {
    .app-content, .main-content { padding: 1rem; }
    .dash-stats { grid-template-columns: 1fr; }
    .auth-page-main { padding: 1.25rem 1rem; }
    .auth-form-panel { padding: 1.5rem; }
    .auth-top { padding: 0.75rem 1rem; }
}

/* Mobiel: onderbalk i.p.v. smalle zijbalk */
.app-mobile-nav {
    display: none;
}

@media (max-width: 768px) {
    .app-sidebar {
        display: none;
    }

    .app-main,
    body:not(.auth-page) .footer {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }

    :root {
        --app-mobile-nav-core-h: 3.35rem;
        --app-mobile-nav-safe: 0px;
        --app-mobile-nav-h: var(--app-mobile-nav-core-h);
        --app-fab-offset: 0.65rem;
        --app-fab-inset-left: max(12px, env(safe-area-inset-left, 0px));
        --app-fab-inset-right: max(12px, env(safe-area-inset-right, 0px));
        --app-fab-size: 50px;
    }

    /* Firefox: geen dynamische safe-area (toolbar bij scroll → dubbele hoogte + groene band) */
    @supports (-moz-appearance: none) {
        :root {
            --app-mobile-nav-safe: 0px;
            --app-mobile-nav-h: var(--app-mobile-nav-core-h);
        }
    }

    /* iOS home-indicator: safe-area alleen op WebKit */
    @supports (-webkit-touch-callout: none) {
        :root {
            --app-mobile-nav-safe: env(safe-area-inset-bottom, 0px);
            --app-mobile-nav-h: calc(var(--app-mobile-nav-core-h) + var(--app-mobile-nav-safe));
        }
    }

    .app-content,
    .main-content {
        padding:
            0.85rem
            max(0.85rem, env(safe-area-inset-right, 0px))
            calc(var(--app-mobile-nav-h) + 0.75rem)
            max(0.85rem, env(safe-area-inset-left, 0px));
    }

    body:has(.chat-buttons-container) .app-content,
    body:has(.chat-buttons-container) .main-content {
        padding-bottom: calc(var(--app-mobile-nav-h) + 6.75rem);
    }

    .app-mobile-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10350;
        width: 100%;
        box-sizing: border-box;
        background: linear-gradient(0deg, #152622 0%, var(--text) 55%, #1e3530 100%);
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        height: var(--app-mobile-nav-h);
        min-height: var(--app-mobile-nav-h);
        max-height: var(--app-mobile-nav-h);
        padding: 0.2rem 0.15rem var(--app-mobile-nav-safe);
        justify-content: stretch;
        align-items: stretch;
        overflow: hidden;
        gap: 0.1rem;
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    .app-mobile-nav.pn-line-pattern--on-green::before {
        opacity: 0.7;
    }

    .app-mobile-nav a {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        max-width: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.1rem;
        padding: 0.15rem 0.1rem;
        color: #a8bdb6;
        font-size: 0.62rem;
        line-height: 1.1;
        text-decoration: none;
        border-radius: 8px;
        text-align: center;
    }

    .app-mobile-nav--admin a.app-nav__back {
        margin-left: 0;
        border-left: 1px solid rgba(255, 255, 255, 0.12);
        padding-left: 0.1rem;
    }

    .app-mobile-nav a i {
        font-size: 1rem;
        line-height: 1;
        flex-shrink: 0;
    }

    .app-mobile-nav a span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }

    .app-mobile-nav a.active {
        color: #fff;
        background: rgba(255, 255, 255, 0.08);
    }

    .app-footer {
        display: none;
    }

    .app-topbar {
        padding:
            0
            max(0.65rem, env(safe-area-inset-right, 0px))
            0
            max(0.65rem, env(safe-area-inset-left, 0px));
    }

    .app-topbar__left {
        font-size: 0.78rem;
    }

    .app-topbar__user {
        font-weight: 700;
    }

    .app-topbar__guest-badge {
        display: none;
    }

    .app-topbar__right {
        gap: 0.25rem;
        flex-shrink: 0;
    }

    .app-user-menu {
        gap: 0.25rem;
    }

    .app-user-menu a {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }

    .app-topbar .lang-picker__toggle {
        padding: 0.3rem;
        min-width: 32px;
        min-height: 32px;
        justify-content: center;
        gap: 0;
    }

    .app-topbar .lang-picker__toggle .lang-picker__code,
    .app-topbar .lang-picker__toggle .lang-picker__chevron {
        display: none;
    }

    .app-topbar .lang-picker__flag {
        margin: 0;
    }

    body:not(.auth-page) .footer {
        width: 100%;
    }

    .app-content input,
    .app-content select,
    .app-content textarea,
    .auth-page input,
    .auth-page select,
    .auth-page textarea {
        font-size: 16px;
    }
}

/* Landingspagina (start) */
.auth-page-body--landing {
    width: 100%;
}

.auth-page-main--landing {
    max-width: 1040px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 2rem;
    box-sizing: border-box;
}

body.auth-page:has(.auth-page-main--landing) .auth-top {
    padding-left: max(1.5rem, calc((100% - 1040px) / 2));
    padding-right: max(1.5rem, calc((100% - 1040px) / 2));
}

.auth-page-body--legal {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.auth-page-main--legal {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 2rem;
    box-sizing: border-box;
}

body.auth-page:has(.auth-page-main--legal) .auth-top {
    padding-left: max(1.5rem, calc((100% - 800px) / 2));
    padding-right: max(1.5rem, calc((100% - 800px) / 2));
}

/* Proefles (gast) — les vult viewport, submit-knop altijd zichtbaar */
html:has(body.auth-page--lesson-demo) {
    height: 100%;
    overflow: hidden;
}

body.auth-page--lesson-demo {
    height: 100dvh;
    height: 100svh;
    max-height: 100dvh;
    max-height: 100svh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.auth-page--lesson-demo .auth-page-body--trial {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.auth-page-main--lesson-demo {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: min(1040px, 100%);
    margin: 0 auto;
    padding: 0.25rem clamp(0.5rem, 2vw, 1rem) 0.35rem;
    box-sizing: border-box;
    min-height: 0;
    overflow: hidden;
}

body.auth-page--lesson-demo .auth-top {
    flex-shrink: 0;
    padding: 0.45rem clamp(0.5rem, 2vw, 1rem);
}

body.auth-page--lesson-demo .auth-top__title {
    font-size: 0.95rem;
}

body.auth-page--lesson-demo .demo-lesson-shell {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 0.2rem;
    overflow: hidden;
}

body.auth-page--lesson-demo .demo-lesson-intro__title {
    font-size: 0.92rem;
}

body.auth-page--lesson-demo .demo-lesson-intro__cta {
    padding: 0.35rem 0.65rem;
    font-size: 0.8125rem;
}

body.auth-page--lesson-demo .lesson-player {
    flex: 1;
    width: 100%;
    max-width: none;
    margin: 0;
    min-height: 0;
    height: auto;
    max-height: none;
    display: flex;
    flex-direction: column;
}

body.auth-page--lesson-demo .lesson-player--aanvul-layout {
    max-width: none;
}

body.auth-page--lesson-demo .lesson-player__top {
    padding: 0.2rem 0;
    gap: 0.35rem;
}

body.auth-page--lesson-demo .lesson-player__body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 0;
}

body.auth-page--lesson-demo .footer.footer--demo {
    display: none;
}

body.auth-page .footer.footer--demo {
    flex-shrink: 0;
    margin-top: 0;
    width: 100%;
}

body.auth-page .footer.footer--demo .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

body.auth-page .footer.footer--demo .footer-bottom-content {
    max-width: min(1100px, 100%);
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

@media (max-width: 720px) {
    .auth-top__actions .btn-sm {
        padding: 0.22rem 0.4rem;
        font-size: 0.65rem;
        line-height: 1.15;
        border-radius: 6px;
    }

    .auth-top .lang-select select {
        min-width: 0;
        max-width: 6rem;
        padding: 0.22rem 0.38rem;
        font-size: 0.68rem;
    }

    body.auth-page--lesson-demo {
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
    }

    body.auth-page--lesson-demo .auth-top--lesson-demo,
    body.auth-page--lesson-demo .auth-top {
        padding: 0.22rem 0.4rem;
        gap: 0.35rem;
        min-height: 0;
    }

    body.auth-page--lesson-demo .auth-top__brand {
        gap: 0.35rem;
    }

    body.auth-page--lesson-demo .auth-top__title {
        display: none;
    }

    body.auth-page--lesson-demo .auth-top .app-logo--auth {
        width: 24px;
        height: 24px;
    }

    body.auth-page--lesson-demo .auth-top__actions {
        gap: 0.28rem;
    }

    body.auth-page--lesson-demo .auth-top__actions .btn-sm {
        padding: 0.2rem 0.38rem;
        font-size: 0.62rem;
        line-height: 1.15;
        border-radius: 6px;
        min-height: 0;
    }

    body.auth-page--lesson-demo .auth-top .lang-select select {
        min-width: 0;
        max-width: 5.5rem;
        padding: 0.2rem 0.35rem;
        font-size: 0.65rem;
        border-radius: 6px;
    }

    body.auth-page--lesson-demo .auth-page-body--trial {
        padding: 0;
    }

    body.auth-page--lesson-demo .auth-page-main--lesson-demo {
        padding: 0 0.2rem 0;
        flex: 1;
        min-height: 0;
    }

    /* Proefles-banner boven de les: weg op mobiel — alle ruimte voor de oefening */
    body.auth-page--lesson-demo .demo-lesson-intro {
        display: none !important;
    }

    body.auth-page--lesson-demo .demo-lesson-shell {
        gap: 0;
        flex: 1;
        min-height: 0;
    }

    body.auth-page--lesson-demo .lesson-player {
        flex: 1 1 0;
        min-height: 0;
        height: auto;
        overflow: hidden;
    }

    body.auth-page--lesson-demo .lesson-player--aanvul-actions-bar {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
    }

    body.auth-page--lesson-demo .lesson-player--aanvul-actions-bar .lesson-player__footer {
        flex-shrink: 0;
    }
}

@media (min-width: 900px) {
    body.auth-page--lesson-demo .lesson-aanvul-split {
        min-height: 0;
    }
}

@media (max-width: 640px) {
    body.auth-page--lesson-demo .lesson-player {
        min-height: 0;
    }
}

.landing-page {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0.75rem 0 2.5rem;
    position: relative;
}

.landing-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(900px 480px at 20% 0%, rgba(15, 107, 86, 0.08), transparent 60%),
        radial-gradient(700px 420px at 80% 25%, rgba(196, 92, 38, 0.06), transparent 55%);
    pointer-events: none;
}

.landing-page > * { position: relative; }

.landing-hero {
    text-align: center;
    margin: 0 auto 1.75rem;
    padding: 1.25rem 1.25rem 1.5rem;
    background: rgba(255,255,255,0.75);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.06));
    backdrop-filter: blur(6px);
}

.landing-hero .app-logo--welcome {
    display: block;
    margin: 0 auto 0.75rem;
    width: 84px;
    height: 84px;
    filter: drop-shadow(0 6px 14px rgba(15, 107, 86, 0.12));
}

.landing-hero__top .app-logo--welcome {
    margin: 0;
    flex-shrink: 0;
}

.landing-hero__brand {
    font-weight: 800;
    letter-spacing: 0.01em;
    font-size: 1.05rem;
    color: var(--primary);
    margin: 0 0 0.35rem;
}

.landing-hero h1 {
    font-size: clamp(1.6rem, 4.2vw, 2.6rem);
    margin: 0.35rem 0 0.75rem;
    line-height: 1.15;
}

.landing-hero__sub {
    max-width: 56rem;
    margin: 0 auto 1.25rem;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.landing-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.9rem;
}

.landing-hero__actions .btn {
    min-height: 44px;
    padding: 0.75rem 1.25rem;
}

.landing-beta-note {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: rgba(15, 107, 86, 0.08);
    color: var(--text);
    border: 1px solid rgba(15, 107, 86, 0.18);
    font-size: 0.95rem;
}

.landing-how {
    margin: 0 0 1.5rem;
    padding: 1.1rem 1.2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.landing-how__title {
    margin: 0 0 0.85rem;
    font-size: 1.15rem;
}

.landing-how__steps {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.65rem;
}

.landing-how__steps li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--text-muted);
    line-height: 1.45;
    font-size: 0.95rem;
}

.landing-how__num {
    flex-shrink: 0;
    width: 1.65rem;
    height: 1.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    background: var(--primary);
    border-radius: 50%;
}

.landing-exam {
    margin: 0 0 1.75rem;
    padding: 1.35rem 1.35rem 1.2rem;
    background: linear-gradient(145deg, rgba(15, 107, 86, 0.08) 0%, rgba(255, 255, 255, 0.95) 55%);
    border: 1px solid rgba(15, 107, 86, 0.2);
    border-radius: 16px;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.06));
}

.landing-exam__badge {
    display: inline-block;
    margin: 0 0 0.65rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--primary);
    background: rgba(15, 107, 86, 0.1);
    border-radius: 999px;
}

.landing-exam h2 {
    margin: 0 0 0.65rem;
    font-size: 1.45rem;
    line-height: 1.25;
    color: var(--text);
}

.landing-exam__intro {
    margin: 0 0 1.15rem;
    max-width: 52rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.landing-exam__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin: 0 0 1rem;
}

.landing-exam__card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1rem 0.9rem;
    min-width: 0;
}

.landing-exam__icon {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 0.55rem;
    border-radius: 10px;
    background: rgba(15, 107, 86, 0.12);
    color: var(--primary);
    font-size: 1.05rem;
}

.landing-exam__card h3 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
    line-height: 1.3;
}

.landing-exam__card p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.landing-exam__note {
    margin: 0;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text);
    background: rgba(15, 107, 86, 0.06);
    border-radius: 10px;
    border-left: 3px solid var(--primary);
}

.landing-exam__note i {
    color: var(--primary);
    margin-right: 0.35rem;
}

@media (max-width: 900px) {
    .landing-exam__grid {
        grid-template-columns: 1fr;
    }
}

.landing-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
    margin: 0 0 1.75rem;
}

.landing-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem 1.25rem 1.15rem;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.06));
    min-width: 0;
}

.landing-card h2 {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.1rem;
    margin: 0 0 0.75rem;
}

.landing-card h2 i { color: var(--primary); }

.landing-card ul {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text-muted);
}

.landing-card li { margin: 0.35rem 0; }

.landing-card--free { grid-column: span 7; }
.landing-card--premium { grid-column: span 5; }

.landing-card--premium p { margin: 0 0 1rem; }

.landing-card .btn-accent,
.landing-card a.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.landing-card .btn-accent:hover,
.landing-card a.btn-accent:hover {
    filter: brightness(0.95);
    color: #fff;
}

.landing-tracks {
    margin: 0 0 1.75rem;
    padding: 1.25rem 1.25rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.landing-tracks h2 { margin-bottom: 0.85rem; }

.landing-tracks__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.6rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.landing-tracks__list li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.8rem 0.95rem;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    min-width: 0;
}

.landing-tracks__list li i { color: var(--primary); }

.landing-story {
    background: rgba(15, 107, 86, 0.06);
    border: 1px solid rgba(15, 107, 86, 0.14);
    border-radius: 14px;
    padding: 1.25rem;
}

.landing-story h2 { margin-bottom: 0.5rem; }
.landing-story p { margin: 0; color: var(--text-muted); }

@media (max-width: 900px) {
    .landing-card--free,
    .landing-card--premium { grid-column: span 12; }
}

@media (max-width: 640px) {
    .landing-hero { padding: 1.05rem 1rem 1.2rem; }
    .landing-hero .app-logo--welcome { width: 76px; height: 76px; }
    .landing-hero__sub { font-size: 1rem; }
    .landing-tracks__list { grid-template-columns: 1fr; }
}

