/* MoneyWise Advies - videoadvies (advies.moneywise.nl)
   House palette reused from MijnCore (mijn.css). UI texts are Dutch. */

:root {
	--primary: #1aa7e6;
	--primary-hover: #0e8fc6;
	--primary-dark: #1f5da8;
	--primary-light: #d6effa;
	--primary-soft: #edf8fd;

	--accent: #f58220;
	--accent-hover: #d96e10;

	--text: #1e293b;
	--text-secondary: #64748b;
	--text-muted: #94a3b8;
	--bg: #eaf4fb;
	--bg-light: #f8fafc;
	--white: #ffffff;
	--border: #d8e6f0;
	--border-light: #eef4f8;

	--success: #10b981;
	--danger: #ef4444;
	--warning: #f59e0b;

	--radius: 10px;
	--shadow: 0 1px 3px rgba(0,0,0,0.08);
	--shadow-lg: 0 8px 28px rgba(16,42,67,0.18);
	--font-base: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: var(--font-base); }
body {
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	color: var(--text);
	background: var(--bg);
	line-height: 1.55;
	min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.hideMe { display: none !important; }

/* Header */
.appHeader {
	display: flex; align-items: center; justify-content: space-between;
	padding: 12px 20px; background: var(--white);
	border-bottom: 1px solid var(--border-light);
	box-shadow: 0 2px 0 0 var(--primary), 0 3px 8px rgba(26,167,230,0.10);
	position: sticky; top: 0; z-index: 50;
}
.appLogo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.appLogo:hover { text-decoration: none; }
.appLogoMark {
	display: inline-flex; align-items: center; justify-content: center;
	width: 34px; height: 34px; border-radius: 8px;
	background: var(--primary); color: #fff; font-weight: 700; font-size: 0.85rem;
}
.appLogoText { font-size: 1.05rem; }
.appHeaderRight { font-size: 0.9rem; color: var(--text-secondary); }

.appMain { max-width: 1100px; margin: 0 auto; padding: 24px 20px 48px; }

/* Page heads */
.pageTitle { font-size: 1.5rem; margin-bottom: 4px; }
.pageSubtitle { color: var(--text-secondary); margin-bottom: 20px; }

/* Cards */
.card {
	background: var(--white); border: 1px solid var(--border-light);
	border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px;
}
.cardHeader {
	display: flex; align-items: center; justify-content: space-between;
	padding: 14px 18px; border-bottom: 1px solid var(--border-light);
}
.cardTitle { font-size: 1.05rem; font-weight: 600; }
.cardBody { padding: 18px; }
.cardBody.noPadding { padding: 0; }

/* Buttons (house naming: .bttn .small .primary etc.) */
.bttn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	border: 1px solid transparent; border-radius: 8px; cursor: pointer;
	font: inherit; font-weight: 600; padding: 10px 16px; min-height: 44px;
	transition: background .12s, border-color .12s, opacity .12s;
}
.bttn:disabled { opacity: .5; cursor: not-allowed; }
.bttn.small { padding: 7px 12px; min-height: 38px; font-size: .9rem; }
.bttn.primary { background: var(--primary); color: #fff; }
.bttn.primary:hover:not(:disabled) { background: var(--primary-hover); }
.bttn.secondary { background: #fff; color: var(--text); border-color: var(--border); }
.bttn.secondary:hover:not(:disabled) { background: var(--bg-light); }
.bttn.accent { background: var(--accent); color: #fff; }
.bttn.accent:hover:not(:disabled) { background: var(--accent-hover); }
.bttn.danger { background: var(--danger); color: #fff; }
.bttn.danger:hover:not(:disabled) { filter: brightness(.95); }
.bttn.success { background: var(--success); color: #fff; }
.bttn.block { width: 100%; }

/* Badges */
.badge {
	display: inline-block; padding: 2px 10px; border-radius: 999px;
	font-size: .78rem; font-weight: 600;
}
.badgeBlue { background: var(--primary-light); color: var(--primary-dark); }
.badgeGreen { background: #d1fae5; color: #065f46; }
.badgeGray { background: #e2e8f0; color: #475569; }
.badgeOrange { background: #ffe7cc; color: #9a4a06; }
.badgeRed { background: #fee2e2; color: #991b1b; }

/* Forms */
.formGroup { margin-bottom: 14px; }
.formLabel { display: block; font-weight: 600; margin-bottom: 5px; font-size: .92rem; }
.formInput, .formSelect {
	width: 100%; padding: 10px 12px; min-height: 44px;
	border: 1px solid var(--border); border-radius: 8px; font: inherit; background: #fff;
}
.formInput:focus, .formSelect:focus { outline: 2px solid var(--primary-light); border-color: var(--primary); }
.formHint { font-size: .82rem; color: var(--text-muted); margin-top: 4px; }

/* Tables / lists */
.gesprekTabel { width: 100%; border-collapse: collapse; }
.gesprekTabel th, .gesprekTabel td {
	text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border-light);
	font-size: .92rem; vertical-align: middle;
}
.gesprekTabel th { color: var(--text-secondary); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .02em; }
.gesprekTabel tr:last-child td { border-bottom: none; }
.linkVeld { display: flex; gap: 6px; align-items: center; }
.linkVeld input { flex: 1; font-size: .82rem; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-light); }

.emptyState { text-align: center; color: var(--text-muted); padding: 40px 20px; }

/* Modal (house pattern) */
.fiModalOverlay {
	position: fixed; inset: 0; background: rgba(15,42,67,.45);
	display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 1000;
}
.fiModal {
	background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg);
	max-width: 480px; width: 100%; padding: 22px 24px;
}
.fiModal h3 { margin-bottom: 8px; }
.fiModal p { color: var(--text-secondary); }
.fiModalWarning { border: 2px solid var(--warning); background: #fffbeb; }
.modalActies { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* Splash / landing */
.splashHero { text-align: center; max-width: 720px; margin: 4vh auto 28px; }
.splashHero h1 { font-size: 1.9rem; margin-bottom: 10px; }
.splashHero p { color: var(--text-secondary); font-size: 1.05rem; }
.splashGrid {
	display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px;
	max-width: 860px; margin: 0 auto;
}
.splashCard { padding: 26px 24px; text-align: center; }
.splashCard h2 { font-size: 1.2rem; margin-bottom: 8px; }
.splashCard p { color: var(--text-secondary); margin-bottom: 16px; }
.splashCard .formGroup { text-align: left; }
.splashIcon {
	width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px;
	display: flex; align-items: center; justify-content: center; font-size: 1.7rem;
}
.splashIcon.klant { background: var(--primary-soft); }
.splashIcon.adviseur { background: #ffe7cc; }
.codeInput { text-transform: uppercase; letter-spacing: .18em; font-size: 1.15rem; text-align: center; font-weight: 600; }
a.bttn { text-decoration: none; }
a.bttn:hover { text-decoration: none; }

@media (max-width: 640px) {
	.splashGrid { grid-template-columns: 1fr; }
	.splashHero h1 { font-size: 1.5rem; }
}

/* Waiting room / pre-check */
.midPaneel {
	max-width: 560px; margin: 8vh auto 0; background: #fff;
	border-radius: var(--radius); box-shadow: var(--shadow-lg);
	padding: 32px 28px; text-align: center;
}
.midPaneel h1 { font-size: 1.45rem; margin-bottom: 8px; }
.midPaneel p { color: var(--text-secondary); margin-bottom: 18px; }
.midPaneel .formGroup { text-align: left; }
.statusPil {
	display: inline-flex; align-items: center; gap: 8px;
	background: var(--primary-soft); color: var(--primary-dark);
	padding: 10px 16px; border-radius: 999px; font-weight: 600; margin: 8px 0 16px;
}
.statusPil.fout { background: #fee2e2; color: #991b1b; }
.spinDot { width: 12px; height: 12px; border-radius: 50%; background: var(--primary);
	animation: pulseDot 1.1s infinite ease-in-out; }
.statusPil.fout .spinDot { background: #991b1b; }
@keyframes pulseDot { 0%,100% { opacity: .35; transform: scale(.8);} 50% { opacity: 1; transform: scale(1);} }

.precheckVideo {
	width: 100%; max-width: 360px; aspect-ratio: 4/3; background: #0b1220;
	border-radius: var(--radius); margin: 0 auto 16px; object-fit: cover; transform: scaleX(-1);
}

/* Video stage */
.gesprekStage {
	position: relative; width: 100%; height: calc(100vh - 60px);
	background: #0b1220; border-radius: 0; overflow: hidden;
}
.appMain.fullbleed { max-width: none; padding: 0; }
.videoRemote { width: 100%; height: 100%; object-fit: contain; background: #0b1220; }
.videoLocal {
	position: absolute; right: 16px; top: 16px; width: 160px; max-width: 32vw;
	aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; border: 2px solid rgba(255,255,255,.7);
	background: #111; transform: scaleX(-1); box-shadow: 0 4px 14px rgba(0,0,0,.4); z-index: 4;
}
.videoLocal.delend { transform: none; }

.verbindingMelding {
	position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
	background: rgba(15,23,42,.82); color: #fff; padding: 8px 16px; border-radius: 999px;
	font-size: .88rem; display: flex; align-items: center; gap: 8px;
}
.naamLabel {
	position: absolute; left: 16px; top: 16px; background: rgba(15,23,42,.66);
	color: #fff; padding: 5px 12px; border-radius: 8px; font-size: .9rem; z-index: 4;
}

/* Controls bar */
.controlBar {
	position: absolute; left: 0; right: 0; bottom: 0;
	display: flex; align-items: center; justify-content: center; gap: 12px;
	padding: 16px; background: linear-gradient(to top, rgba(11,18,32,.85), rgba(11,18,32,0));
}
.ctrlBtn {
	width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
	background: rgba(255,255,255,.16); color: #fff; display: flex; align-items: center; justify-content: center;
	font-size: 1.3rem; transition: background .12s;
}
.ctrlBtn:hover { background: rgba(255,255,255,.28); }
.ctrlBtn.uit { background: #fff; color: var(--text); }
.ctrlBtn.ophangen { background: var(--danger); color: #fff; width: 64px; }
.ctrlBtn.ophangen:hover { filter: brightness(.95); }
.ctrlLabel { position: absolute; bottom: 6px; font-size: .62rem; }

/* Co-browse (samen invullen) */
.cbPanel { position: absolute; inset: 0; padding-bottom: 84px; z-index: 5; display: flex; flex-direction: column; background: #fff; }
.cbBar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-light); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cbTitle { font-weight: 600; font-size: .9rem; color: var(--text); }
.cbUrlInput { flex: 1; min-width: 160px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: .85rem; }
.cbUrlInput[readonly] { background: var(--bg-light); color: var(--text-secondary); }
.cbDriver { font-size: .82rem; color: var(--text-secondary); white-space: nowrap; }
.cbFrame { flex: 1; width: 100%; border: 0; background: #fff; }

/* During co-browse the form is primary; both videos become small PiPs in the bottom
   corners (above the control bar) so they never cover the bar buttons or the cbBar. */
.gesprekStage.cobrowsing .videoRemote {
	position: absolute; left: 16px; bottom: 96px; right: auto; top: auto;
	width: 150px; height: 112px; z-index: 6;
	border-radius: 10px; border: 2px solid rgba(255,255,255,.85); background: #0b1220; object-fit: cover;
}
.gesprekStage.cobrowsing .videoLocal { top: auto; bottom: 96px; right: 16px; width: 130px; z-index: 6; }
.gesprekStage.cobrowsing .naamLabel { display: none; }
.gesprekStage.cobrowsing .controlBar { z-index: 7; }
@media (max-width: 640px) {
	.gesprekStage.cobrowsing .videoRemote { width: 96px; height: 72px; left: 10px; bottom: 92px; }
	.gesprekStage.cobrowsing .videoLocal { width: 84px; right: 10px; bottom: 92px; }
}

/* Fullscreen */
.gesprekStage:fullscreen, .gesprekStage:-webkit-full-screen { width: 100vw; height: 100vh; }

/* Co-browse in a separate window */
.cbPoppedNote { padding: 28px 20px; text-align: center; color: var(--text-secondary); font-size: 1rem; }

/* Waiting room list on advisor side */
.wachtkamer { display: flex; align-items: center; gap: 10px; padding: 12px 16px;
	background: var(--primary-soft); border: 1px solid var(--primary-light); border-radius: 8px; margin-bottom: 14px; }
.wachtkamer .naam { font-weight: 600; }
.wachtkamer.fout { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.wachtkamer.fout .spinDot { background: #991b1b; }

/* Responsive */
@media (max-width: 640px) {
	.appLogoText { display: none; }
	.appMain { padding: 16px 12px 32px; }
	.midPaneel { margin-top: 4vh; padding: 24px 18px; }
	.gesprekStage { height: calc(100vh - 56px); }
	.videoLocal { width: 120px; bottom: 96px; right: 12px; }
	.ctrlBtn { width: 52px; height: 52px; }
	.gesprekTabel thead { display: none; }
	.gesprekTabel, .gesprekTabel tbody, .gesprekTabel tr, .gesprekTabel td { display: block; width: 100%; }
	.gesprekTabel tr { border: 1px solid var(--border-light); border-radius: 8px; margin-bottom: 10px; padding: 6px 4px; }
	.gesprekTabel td { border: none; padding: 6px 12px; }
}
