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

/* inlyn walkthrough — overrides bovenop framework.css. Voor walkthrough-specific UI. */

/* ============ INLYN BRAND OVERRIDE ============ */
:root {
    --brand: #2563eb;
    --brand-rgb: 37, 99, 235;
    --bg: #f0f4f8;
}

body { background: linear-gradient(180deg, #eef2f6 0%, #e2e8f0 100%); }

/* ============ TOP DEMO HEADER (buiten app) ============ */
.demo-header {
    background: #0f172a;
    color: #fff;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 22px;
    position: sticky;
    top: 0;
    z-index: 100;
    font-size: 13px;
}
.demo-back {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.demo-back:hover { color: #fff; opacity: 1; }
.demo-branche-tabs {
    display: flex;
    gap: 4px;
    flex: 1;
    justify-content: center;
}
.demo-tab {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #334155;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
}
.demo-tab:hover:not(:disabled) { color: #fff; border-color: #64748b; }
.demo-tab.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.demo-tab:disabled { opacity: .35; cursor: not-allowed; }

/* ============ EMBED MODE ============ */
body.embed .demo-header { display: none; }
body.embed .browser-frame { margin: 0; border-radius: 0; box-shadow: none; border: none; max-width: none; }
body.embed { background: transparent; }
body.embed .app-shell { min-height: 600px; }
body.embed .app-main { max-height: 700px; }

.demo-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: #94a3b8;
}
.demo-toggle {
    background: transparent;
    border: 1px solid #334155;
    color: #cbd5e1;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.demo-toggle:hover { background: #1e293b; color: #fff; }
.demo-toggle.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.demo-toggle .dot-anim {
    width: 6px; height: 6px; border-radius: 50%; background: currentColor;
    opacity: .4;
}
.demo-toggle.on .dot-anim {
    opacity: 1;
    animation: pulseDot 1.2s ease-in-out infinite;
}
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.demo-reset {
    background: transparent;
    border: 1px solid #334155;
    color: #cbd5e1;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    cursor: pointer;
}
.demo-reset:hover { background: #1e293b; color: #fff; }

/* ============ BROWSER FRAME ============ */
.browser-frame {
    max-width: 1280px;
    margin: 22px auto;
    border-radius: 12px;
    background: var(--card);
    box-shadow: 0 30px 60px rgba(15, 23, 42, .15), 0 8px 20px rgba(15, 23, 42, .08);
    overflow: hidden;
    border: 1px solid var(--border);
}
.browser-chrome {
    background: #e2e8f0;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #cbd5e1;
}
.browser-dots { display: flex; gap: 6px; }
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }
.browser-url {
    flex: 1;
    background: #fff;
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 11px;
    color: var(--muted);
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #cbd5e1;
}
.browser-url svg { color: var(--green); }

/* ============ APP SHELL (binnen browser frame) ============ */
.app-shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 720px;
    background: var(--bg);
}

.app-sidebar {
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 14px 0;
    display: flex;
    flex-direction: column;
}
.app-logo {
    padding: 0 18px 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}
.app-logo img {
    height: 22px;
    width: auto;
    display: block;
}
.app-nav {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0 8px;
    gap: 2px;
}
.nav-group-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    padding: 12px 10px 4px;
    opacity: .65;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    text-decoration: none;
    transition: background .12s;
}
.nav-item:hover { background: var(--subtle); opacity: 1; }
.nav-item.active {
    background: rgba(var(--brand-rgb), .1);
    color: var(--brand);
    font-weight: 600;
}
.nav-item svg { flex-shrink: 0; opacity: .8; }
.nav-item.active svg { opacity: 1; }
.nav-count {
    margin-left: auto;
    background: rgba(var(--brand-rgb), .15);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    color: var(--brand);
}

.app-user {
    margin-top: auto;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 9px;
}
.user-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 11px;
    flex-shrink: 0;
}
.user-name { font-size: 12px; font-weight: 500; color: var(--text); }
.user-role { color: var(--muted); font-size: 10px; }

/* ============ MAIN CONTENT ============ */
.app-main {
    padding: 22px 26px;
    overflow: auto;
    max-height: 820px;
}
.step { display: none; animation: fadeIn .25s ease; }
.step.active { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
    gap: 14px;
}
.page-header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
}
.page-header h1 .badge { font-size: 10px !important; }
.breadcrumb {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 4px;
}
.page-actions { display: flex; gap: 6px; align-items: center; }

.btn-active { background: rgba(var(--brand-rgb), .08) !important; color: var(--brand) !important; }

/* ============ KANBAN — gebruikt framework, alleen done state aanvullen ============ */
.kanban-card-done { opacity: .55; }
.kanban-card { position: relative; }
.kanban-card-target { position: relative; }

/* ============ CARD / TABLES ============ */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
    position: relative;
}
.card-header {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
}
.card-header h2 { margin: 0; font-size: 13px; font-weight: 600; color: var(--text); }
.card-body { padding: 14px 16px; }

.meta-table { width: 100%; border-collapse: collapse; }
.meta-table td { padding: 4px 0; font-size: 12px; vertical-align: top; }
.meta-label {
    color: var(--muted);
    font-weight: 600;
    width: 130px;
    white-space: nowrap;
    padding-right: 10px;
}
.meta-table a { color: var(--brand); text-decoration: none; }

.line-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.line-table th {
    text-align: left;
    color: var(--muted);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
}
.line-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); }
.line-table .num { text-align: right; }
.line-table tfoot td { background: var(--card2); padding: 7px 8px; font-weight: 500; }
.line-table tfoot tr.grand td {
    background: var(--card2);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    border-top: 2px solid var(--border2);
}

.rich-content { font-size: 12px; line-height: 1.6; color: var(--text); }
.rich-content p { margin: 0 0 6px; }

/* ============ MODAL ============ */
.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(2px);
    padding: 22px;
}
.modal {
    background: var(--card);
    border-radius: var(--radius);
    width: 100%;
    max-width: 460px;
    overflow: hidden;
    animation: modalIn .2s ease;
    box-shadow: 0 30px 60px rgba(0,0,0,.25);
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(10px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-title { font-weight: 600; font-size: 14px; color: var(--text); }
.modal-body { padding: 16px 18px; }
.modal-foot {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    justify-content: flex-end;
    gap: 7px;
}
.row-sub { font-size: 11px; color: var(--muted); }

.meta-mini {
    background: var(--card2);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.meta-mini > div { display: flex; flex-direction: column; }
.meta-mini span { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
.meta-mini strong { font-size: 12px; color: var(--text); margin-top: 2px; }

.sig-canvas-mock {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    height: 100px;
    position: relative;
    overflow: hidden;
}
.sig-canvas-mock svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sig-label {
    position: absolute;
    bottom: 6px;
    right: 10px;
    font-size: 9px;
    color: var(--muted);
    font-style: italic;
}
.check-row {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    font-size: 11px;
    color: var(--text);
}

/* ============ STAP 4: TOASTS + SIGNED BLOCK ============ */
.toast-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.toast {
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 9px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
    animation: toastIn .3s ease;
}
.toast-success { border-left-color: var(--green); }
.toast-success svg { color: var(--green); }
.toast-info { border-left-color: var(--brand); }
.toast-info svg { color: var(--brand); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

.signed-block {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}
.signed-label {
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: .03em;
    margin-bottom: 5px;
}
.signed-canvas {
    background: var(--card2);
    border-radius: var(--radius-sm);
    padding: 10px;
    height: 100px;
    position: relative;
    max-width: 340px;
}
.signed-canvas svg { width: 100%; height: 70px; }
.signed-meta {
    font-size: 9px;
    color: var(--muted);
    margin-top: 3px;
    text-align: right;
}

/* ============ Bridge naar volgende stap (subtiel, geen sales-CTA) ============ */
.bridge-row {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 18px;
    background: var(--card2);
    border: 1px dashed var(--border2);
    border-radius: var(--radius);
    margin-top: 14px;
    position: relative;
}
.bridge-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin-bottom: 3px;
}
.bridge-text { font-size: 12px; color: var(--text); flex: 1; }
.bridge-row > div:first-child { flex: 1; }
.bridge-row .btn { white-space: nowrap; }

/* ============ STAP 5: KLANTPORTAAL ============ */
.portal-frame {
    background: linear-gradient(180deg, rgba(var(--brand-rgb), .06) 0%, var(--card) 60%);
    border-radius: var(--radius);
    padding: 22px;
    margin: -6px -10px;
}
.portal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
}
.portal-header h1 { margin: 4px 0 5px; font-size: 22px; color: var(--text); }
.portal-tag {
    display: inline-block;
    background: var(--brand);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 3px;
}
.portal-sub { color: var(--muted); font-size: 12px; }
.portal-account .user-avatar { width: 36px; height: 36px; font-size: 12px; }
.portal-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}
.portal-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(15,23,42,.04);
}
.portal-card-head {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.portal-card-head h3 { margin: 0; font-size: 13px; color: var(--text); }
.portal-row {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.portal-row:last-child { border-bottom: none; }
.portal-row-fresh { background: rgba(34, 197, 94, .05); }
.portal-row-title { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.portal-row-sub { font-size: 10px; color: var(--muted); }
.portal-empty { padding: 18px 14px; text-align: center; }
.portal-empty p { color: var(--muted); font-size: 12px; margin: 0 0 10px; }

.walkthrough-end {
    max-width: 1280px;
    margin: 22px auto 40px;
    padding: 0 16px;
    text-align: center;
}
.end-stamp {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
    letter-spacing: -.01em;
}
.end-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.walkthrough-end .btn { padding: 10px 18px; font-size: 13px; }
.walkthrough-end .btn-primary-alt {
    background: #0f172a;
    color: #fff;
    border: 1px solid #0f172a;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.walkthrough-end .btn-primary-alt:hover { background: #1e293b; }

/* ============ HOTSPOTS ============ */
.hotspot {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--brand);
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .25);
    animation: pulse 1.6s ease-in-out infinite;
    top: -6px;
    right: -6px;
    pointer-events: none;
}
.hotspot::before {
    content: '';
    position: absolute;
    inset: 4px;
    background: #fff;
    border-radius: 50%;
}
.hotspot-inline {
    top: 50%;
    right: -7px;
    transform: translateY(-50%);
    animation: pulse-inline 1.6s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 5px rgba(var(--brand-rgb), .3); transform: scale(1); }
    50% { box-shadow: 0 0 0 10px rgba(var(--brand-rgb), .1); transform: scale(1.1); }
}
@keyframes pulse-inline {
    0%, 100% { box-shadow: 0 0 0 5px rgba(var(--brand-rgb), .3); transform: translateY(-50%) scale(1); }
    50% { box-shadow: 0 0 0 10px rgba(var(--brand-rgb), .1); transform: translateY(-50%) scale(1.1); }
}

.kanban-card-target { cursor: pointer; position: relative; }
.btn-target { cursor: pointer; position: relative; overflow: visible; }

/* ============ HOTSPOT TOOLTIP ============ */
.hotspot-tooltip {
    position: fixed;
    background: #0f172a;
    color: #fff;
    padding: 9px 13px;
    border-radius: 8px;
    font-size: 12px;
    box-shadow: 0 8px 22px rgba(15,23,42,.35);
    z-index: 999;
    max-width: 240px;
    line-height: 1.45;
    animation: tipIn .25s ease;
    pointer-events: none;
}
.hotspot-tooltip[hidden] { display: none; }
.hotspot-tooltip-text { font-weight: 500; }
.hotspot-tooltip-progress {
    height: 2px;
    background: rgba(255,255,255,.15);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}
.hotspot-tooltip-progress-fill {
    height: 100%;
    background: var(--brand);
    width: 0;
    transition: width .1s linear;
}
.hotspot-tooltip.no-bar .hotspot-tooltip-progress { display: none; }
/* Pijltje wijzend naar de dot */
.hotspot-tooltip::before {
    content: '';
    position: absolute;
    width: 0; height: 0;
    border: 6px solid transparent;
}
/* Tooltip rechts naast dot */
.hotspot-tooltip[data-pos="right"]::before {
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: #0f172a;
}
/* Tooltip onder dot */
.hotspot-tooltip[data-pos="below"]::before {
    top: -12px;
    left: 24px;
    border-bottom-color: #0f172a;
}
/* Tooltip boven dot */
.hotspot-tooltip[data-pos="above"]::before {
    bottom: -12px;
    left: 24px;
    border-top-color: #0f172a;
}
/* Tooltip links van dot */
.hotspot-tooltip[data-pos="left"]::before {
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: #0f172a;
}
@keyframes tipIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .app-shell { grid-template-columns: 64px 1fr; }
    .app-sidebar { padding: 10px 0; }
    .app-logo { padding: 0 12px 10px; }
    .nav-item { padding: 8px 12px; font-size: 0; gap: 0; justify-content: center; }
    .nav-item svg { width: 16px; height: 16px; }
    .nav-count, .app-user { display: none; }
    .kanban-board { grid-template-columns: 1fr 1fr; }
    .portal-grid { grid-template-columns: 1fr; }
    .demo-branche-tabs { overflow-x: auto; }
    .browser-frame { margin: 10px 8px; }
    .app-main { padding: 16px; }
}
@media (max-width: 600px) {
    .kanban-board { grid-template-columns: 1fr; }
    .demo-progress { display: none; }
    .page-header { flex-direction: column; align-items: stretch; }
    .page-actions { flex-wrap: wrap; }
}
