/* Demo portal in the Frappe look: Inter + Espresso tokens (linked from /assets/frappe),
   Frappe's control styles, Lucide icons. Bizkwais appears only as the logo and the website doodles. */

:root {
	--font-stack: "InterVariable", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Arabic", "Geeza Pro", sans-serif;
	--page-bg: var(--surface-gray-1);
	--accent: var(--green-600);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font-stack); font-size: var(--text-base); color: var(--ink-gray-8); background: var(--page-bg);
	-webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; letter-spacing: 0.01em; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
.text-muted { color: var(--ink-gray-5); }
.small { font-size: var(--text-sm); }

/* ---------------------------------------------------------------- Frappe controls */
.icon { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.5;
	stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon-lg { width: 20px; height: 20px; }
html[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: var(--radius);
	font-size: var(--text-base); font-weight: var(--font-weight-medium); line-height: 1; white-space: nowrap;
	transition: background-color 0.12s, box-shadow 0.12s; }
.btn:focus-visible { outline: none; box-shadow: var(--focus-default); }
.btn-sm { height: 28px; padding: 0 10px; font-size: var(--text-sm); }
.btn-md { height: 32px; padding: 0 14px; }
.btn-default { background: var(--surface-gray-2); color: var(--ink-gray-8); }
.btn-default:hover { background: var(--surface-gray-3); }
.btn-primary { background: var(--gray-900); color: #fff; }
.btn-primary:hover { background: var(--gray-800); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }
.btn-ghost { background: transparent; color: var(--ink-gray-7); }
.btn-ghost:hover { background: var(--surface-gray-2); }
.icon-btn { width: 28px; padding: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--ink-gray-5); font-size: var(--text-sm); }
.link-btn:hover { color: var(--ink-gray-8); text-decoration: underline; }

.control-label { display: block; font-size: var(--text-sm); font-weight: var(--font-weight-medium); color: var(--ink-gray-7);
	margin: 0 0 8px; padding: 0; }
.form-control { width: 100%; height: 36px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--radius);
	background: var(--surface-gray-2); color: var(--ink-gray-9); font: inherit; direction: ltr; transition: background 0.12s, border-color 0.12s; }
html[dir="rtl"] .form-control { text-align: right; }
.form-control:hover { border-color: var(--outline-gray-2); }
.form-control:focus { outline: none; background: var(--surface-base); border-color: var(--outline-gray-4, #999); box-shadow: var(--focus-default); }
.help-box { margin: 6px 0 0; font-size: var(--text-xs); color: var(--ink-gray-5); line-height: 1.5; }
.form-error { color: var(--ink-red-4, #e03636); font-size: var(--text-sm); margin: 0 0 12px; }

.frappe-card { background: var(--surface-base); border: 1px solid var(--outline-gray-1); border-radius: var(--radius-xl);
	box-shadow: var(--elevation-sm); }


/* ---------------------------------------------------------------- doodles (bizkwais.com) */
.doodle { display: inline-block; pointer-events: none; background: currentColor; -webkit-mask: var(--shape) center / contain no-repeat; mask: var(--shape) center / contain no-repeat; }
/* the two hills of the bizkwais.com hero, along the bottom of the page */
.doodle-hill-back, .doodle-hill-front { position: fixed; z-index: 0; left: 0; right: 0; bottom: 0; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
.doodle-hill-back { --shape: url("../images/doodles/hill-back.svg"); height: 150px; color: var(--surface-gray-2); }
.doodle-hill-front { --shape: url("../images/doodles/hill-front.svg"); height: 110px; color: var(--surface-green-1); }
/* the website's dot grid, top corner */
.doodle-dots { position: fixed; z-index: 0; top: 88px; inset-inline-end: 6vw; width: 132px; height: 88px; background: none; -webkit-mask: none; mask: none;
	background-image: radial-gradient(var(--outline-gray-3) 1.6px, transparent 1.8px); background-size: 14px 14px; }
.doodle-scribble { --shape: url("../images/doodles/scribble.svg"); position: absolute; width: 104px; height: 64px; top: -40px; inset-inline-start: -78px;
	color: var(--green-500); opacity: 0.8; }
html[dir="rtl"] .doodle-scribble { transform: scaleX(-1); }
.doodle-swoosh { --shape: url("../images/doodles/swoosh.svg"); position: absolute; left: -2%; right: -2%; bottom: -9px; height: 12px;
	-webkit-mask-size: 100% 100%; mask-size: 100% 100%; color: var(--accent); }
.doodle-spark { --shape: url("../images/doodles/spark.svg"); width: 20px; height: 20px; color: var(--accent); vertical-align: top; margin-inline-start: 2px; }

/* ---------------------------------------------------------------- welcome: a three-step wizard */
.welcome { position: relative; min-height: 100vh; padding: 0 16px 160px; font-size: 15px; }
.welcome > *:not(.doodle) { position: relative; z-index: 1; }
.welcome-nav { max-width: 600px; margin: 0 auto; height: 72px; display: flex; align-items: center; justify-content: space-between; }
.welcome-nav .logo { height: 24px; }

.wizard { max-width: 600px; margin: 24px auto 0; padding: 28px 32px 24px; background: var(--surface-base);
	border: 1px solid var(--outline-gray-1); border-radius: var(--radius-xl); box-shadow: var(--elevation-sm); }
.wizard-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.step-label { font-size: var(--text-sm); color: var(--ink-gray-5); white-space: nowrap; font-variant-numeric: tabular-nums; }
.progress-track { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.progress-track span { height: 4px; border-radius: 2px; background: var(--surface-gray-3); transition: background-color 0.2s ease-out; }
.progress-track span.done { background: var(--accent); }

.slide { animation: slide-in 0.18s ease-out; }
@keyframes slide-in { from { opacity: 0; transform: translateY(4px); } }
.slide h1 { font-size: 32px; line-height: 1.2; letter-spacing: -0.015em; font-weight: var(--font-weight-semibold); color: var(--ink-gray-9); margin: 0 0 12px; }
.slide h2 { font-size: 24px; line-height: 1.25; letter-spacing: -0.01em; font-weight: var(--font-weight-semibold); color: var(--ink-gray-9); margin: 0 0 8px; }
.underlined { position: relative; white-space: nowrap; }
.lead { font-size: 16px; line-height: 1.6; color: var(--ink-gray-6); margin: 0 0 24px; max-width: 62ch; }
.slide .control-label { font-size: var(--text-base); }
.slide .form-control { height: 40px; font-size: 15px; }

/* choices: one divided list, not cards inside a card */
.option-list { border: 1px solid var(--outline-gray-2); border-radius: var(--radius-lg); overflow: hidden; }
.option { display: flex; align-items: center; gap: 14px; width: 100%; text-align: start; padding: 14px 16px; border: 0; background: var(--surface-base);
	color: inherit; transition: background-color 0.12s ease-out; }
.option + .option { border-top: 1px solid var(--outline-gray-1); }
.option:hover { background: var(--surface-gray-1); }
.option[aria-checked="true"] { background: var(--surface-green-1); }
.option:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.option-radio { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--outline-gray-3); flex-shrink: 0; display: grid; place-items: center; background: var(--surface-base); }
.option[aria-checked="true"] .option-radio { border-color: var(--accent); }
.option[aria-checked="true"] .option-radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.option-icon { color: var(--ink-gray-5); display: grid; place-items: center; }
.option-icon .icon { width: 20px; height: 20px; }
.option[aria-checked="true"] .option-icon { color: var(--green-700); }
.option-text { min-width: 0; flex: 1; }
.option-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: var(--font-weight-medium); color: var(--ink-gray-9); font-size: 15px; }
.option-desc { display: block; margin-top: 2px; font-size: var(--text-sm); color: var(--ink-gray-6); line-height: 1.5; }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: var(--radius-full); font-size: var(--text-xs);
	font-weight: var(--font-weight-medium); background: var(--surface-gray-2); color: var(--ink-gray-6); }
.badge.green { background: var(--surface-green-2); color: var(--green-700); }
.badge.amber { background: var(--surface-amber-2); color: var(--ink-amber-6); }
.alert-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: var(--radius);
	background: var(--surface-amber-1); color: var(--ink-amber-7); font-size: var(--text-sm); line-height: 1.5; }
.alert-note .icon { margin-top: 2px; }
.help-box.warn { color: var(--ink-amber-7); margin-top: 12px; }

.returning { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-top: 16px; border-radius: var(--radius-lg);
	background: var(--surface-green-1); color: var(--green-700); }
.returning-body { flex: 1; color: var(--ink-gray-8); }
.returning-title { font-weight: var(--font-weight-medium); }

.wizard-actions { display: flex; align-items: center; gap: 8px; margin-top: 28px; }
.wizard-actions .spacer { flex: 1; }
.wizard .form-error { margin: 16px 0 0; }

.welcome-foot { max-width: 600px; margin: 28px auto 0; display: flex; align-items: center; justify-content: center; gap: 8px;
	font-size: var(--text-sm); color: var(--ink-gray-5); }
.welcome-foot img { height: 15px; }
.welcome-foot a { color: var(--ink-gray-6); text-decoration: none; }
.welcome-foot a:hover { color: var(--ink-gray-9); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
	.slide { animation: none; }
}

/* ---------------------------------------------------------------- demo: full-screen app */
.demo { position: fixed; inset: 0; background: var(--surface-base); }
#app-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.frame-loading { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center;
	background: var(--surface-base); color: var(--ink-gray-5); font-size: var(--text-sm); text-align: center; padding: 16px; z-index: 5; }
.loader-mark { width: 40px; animation: spin 1.4s cubic-bezier(.6,.1,.4,.9) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* spotlight: dims the page except the element of the step */
.spotlight { position: fixed; z-index: 20; pointer-events: none; border-radius: var(--radius);
	box-shadow: 0 0 0 2px var(--accent), 0 0 0 6px #268c5c33, 0 0 0 100vmax #17171733; transition: all 0.25s ease; }

/* the tip: a Frappe popover pointing at the element */
.tour-tip { position: fixed; z-index: 30; width: 340px; max-width: calc(100vw - 24px); background: var(--surface-base);
	border-radius: var(--radius-lg); box-shadow: var(--elevation-xl); border: 1px solid var(--outline-gray-1); transition: top 0.25s ease, left 0.25s ease; }
.tip-arrow { position: absolute; width: 12px; height: 12px; background: var(--surface-base); border: 1px solid var(--outline-gray-1); transform: rotate(45deg); }
.tour-tip[data-side="bottom"] .tip-arrow { top: -7px; border-right: 0; border-bottom: 0; }
.tour-tip[data-side="top"] .tip-arrow { bottom: -7px; border-left: 0; border-top: 0; }
.tour-tip[data-side="right"] .tip-arrow { left: -7px; border-right: 0; border-top: 0; }
.tour-tip[data-side="left"] .tip-arrow { right: -7px; border-left: 0; border-bottom: 0; }
.tour-tip[data-side="center"] .tip-arrow { display: none; }
.tip-body { position: relative; padding: 14px 16px 12px; max-height: inherit; overflow-y: auto; overscroll-behavior: contain; }
/* phones: a sheet resting on the dock (bottom and max-height set by the script) */
.tour-tip.sheet { left: 8px; right: 8px; top: auto; width: auto; max-width: none; transition: none; }
.tour-tip.sheet .tip-arrow { display: none; }
.tip-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tip-tour { font-size: var(--text-xs); color: var(--ink-gray-5); font-weight: var(--font-weight-medium); display: inline-flex; align-items: center; gap: 6px; }
.tip-tour .icon { width: 14px; height: 14px; color: var(--accent); }
.tip-title { font-size: var(--text-lg); font-weight: var(--font-weight-semibold); color: var(--ink-gray-9); line-height: 1.35; margin: 0 0 6px; }
.tip-text { font-size: var(--text-sm); color: var(--ink-gray-6); line-height: 1.6; margin: 0; }
.tip-context { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 10px; padding: 8px 10px; border-radius: var(--radius);
	background: var(--surface-green-1); color: var(--ink-gray-7); font-size: var(--text-xs); line-height: 1.5; }
.tip-context .icon { width: 14px; height: 14px; color: var(--accent); margin-top: 1px; }
.tip-context.note { background: var(--surface-amber-1, #fffbeb); }
.tip-context.note .icon { color: var(--ink-amber-6, #8a5a00); }
.tip-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.tip-dots { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.tip-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--surface-gray-4); }
.tip-dots span.done { background: var(--ink-gray-6); }
.tip-dots span.current { width: 16px; border-radius: 3px; background: var(--accent); }

/* centered card: tour complete / finale */
.tour-sheet { position: fixed; inset: 0; z-index: 40; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; background: #17171740; padding: 16px; }
.sheet-body { width: min(420px, 100%); min-width: 0; background: var(--surface-base); border-radius: var(--radius-xl); box-shadow: var(--elevation-2xl, var(--elevation-xl));
	padding: 24px; position: relative; overflow: hidden auto; max-height: calc(100dvh - 32px); }
.sheet-body .doodle-scribble { --shape: url("../images/doodles/scribble.svg"); position: absolute; width: 120px; height: 74px; top: 12px; inset-inline-end: 12px; color: var(--surface-green-3); }
.sheet-mark { width: 36px; margin-bottom: 14px; }
.sheet-title { font-size: var(--text-2xl); font-weight: var(--font-weight-semibold); color: var(--ink-gray-9); margin: 0 0 8px; }
.sheet-text { color: var(--ink-gray-6); line-height: 1.6; margin: 0 0 18px; }
.sheet-actions { display: grid; gap: 8px; }
.sheet-actions .btn { height: 36px; }
.sheet-actions a.btn { text-decoration: none; }

/* dock: app switcher + tour + language, bottom corner */
.dock { position: fixed; z-index: 25; bottom: 16px; inset-inline-end: 16px; display: flex; align-items: center; gap: 6px; padding: 6px;
	background: var(--surface-base); border: 1px solid var(--outline-gray-2); border-radius: var(--radius-lg); box-shadow: var(--elevation-lg); }
.dock-mark { width: 22px; margin: 0 4px; }
.dock.compact { padding: 6px; }
.dock.compact > :not(.dock-mark-btn) { display: none; }
.dock-mark-btn { display: contents; }
.dock.compact .dock-mark-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 0; background: none; padding: 0; cursor: pointer; }
.dock.compact .dock-mark { display: block !important; margin: 0; }
.dock-apps { display: flex; gap: 2px; background: var(--surface-gray-2); border-radius: var(--radius); padding: 2px; }
.dock-app { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border: 0; border-radius: 6px; background: none;
	color: var(--ink-gray-6); font-size: var(--text-sm); font-weight: var(--font-weight-medium); }
.dock-app:hover { color: var(--ink-gray-9); }
.dock-app[aria-current="true"] { background: var(--surface-base); color: var(--ink-gray-9); box-shadow: var(--elevation-sm); }
.dock-sep { width: 1px; height: 20px; background: var(--outline-gray-2); margin: 0 2px; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; bottom: calc(100% + 8px); inset-inline-end: 0; min-width: 220px; padding: 4px; background: var(--surface-base);
	border: 1px solid var(--outline-gray-1); border-radius: var(--radius-lg); box-shadow: var(--elevation-xl); }
.dropdown-item { display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: none;
	color: var(--ink-gray-8); font-size: var(--text-sm); text-align: start; text-decoration: none; }
.dropdown-item:hover { background: var(--surface-gray-2); }
.dropdown-item .icon { color: var(--ink-gray-5); }
.dropdown-divider { height: 1px; background: var(--outline-gray-1); margin: 4px 0; }
.dropdown-header { padding: 6px 8px 4px; font-size: var(--text-xs); color: var(--ink-gray-5); }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 720px) {
	.wizard { padding: 20px 18px 18px; margin-top: 8px; }
	.slide h1 { font-size: 26px; }
	.slide h2 { font-size: 21px; }
	.doodle-scribble, .doodle-dots { display: none; }
	.dock { inset-inline: 8px; bottom: 8px; justify-content: space-between; }
	.dock-mark { display: none; }
	.dock-app .label { display: none; }
}

/* phones and short screens: a compact tip */
@media (max-width: 720px), (max-height: 560px) {
	.tip-body { padding: 12px 14px 10px; }
	.tip-head { margin-bottom: 6px; }
	.tip-title { font-size: 15px; margin-bottom: 4px; }
	.tip-text { font-size: 13px; line-height: 1.5; }
	.tip-context { font-size: 12px; padding: 6px 8px; margin-bottom: 8px; }
	.tip-foot { margin-top: 10px; }
	.tour-tip:not(.sheet) { width: 320px; }
}

