/* CaseTransfer Early Access — front end + editor canvas.
   Everything is scoped to .ct-page or to the plugin's own blocks so theme styles don't leak in or out. */

.ct-page,
.wp-block-casetransfer-signup-form,
.wp-block-casetransfer-dashboard-preview,
.wp-block-casetransfer-logo,
body.ct-blank-canvas {
	/* Light design only: keeps native form controls and autofill light even when the device uses dark mode. */
	color-scheme: light;
	--ct-bg: #f5f7fb;
	--ct-surface: #ffffff;
	--ct-ink: #13213a;
	--ct-ink-soft: #55627a;
	--ct-line: #dfe5ef;
	--ct-blue: #1f6fe0;
	--ct-blue-ink: #ffffff;
	--ct-teal: #2ec4b6;
	--ct-orange: #e8693a;
	--ct-chip: #e8f0fd;
	--ct-stage: #edf1f7;
	--ct-stage-ink: #7a869c;
	--ct-shadow: 0 24px 60px -32px rgba(19, 33, 58, .28);
	--ct-display: "Outfit", "Segoe UI", system-ui, sans-serif;
	--ct-body: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;

	/* Product mockup palette: fixed, like a screenshot. */
	--m-bg: #f4f6fa; --m-card: #ffffff; --m-ink: #13213a; --m-soft: #6b7890; --m-line: #e6eaf1;
	--m-blue: #2a73dc; --m-orange: #e86a37; --m-green: #1f9d55; --m-greenbg: #e6f6ec; --m-side: #13213a;
}

body.ct-blank-canvas { margin: 0; background: var(--ct-bg); }
body.ct-blank-canvas .wp-site-blocks { padding: 0; }
body.ct-blank-canvas .wp-site-blocks > * { margin-block: 0; }

/* ---------------------------------------------------------------- Page */

.ct-page,
.ct-page * { box-sizing: border-box; }

.wp-block-group.ct-page,
.ct-page {
	min-height: 100vh;
	min-height: 100svh;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
	margin-block: 0;
	background: var(--ct-bg);
	color: var(--ct-ink);
	font-family: var(--ct-body);
	font-size: 15px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}
.admin-bar .ct-page { min-height: calc(100vh - 32px); }

.ct-page > .ct-left,
.ct-page > .ct-right,
.ct-page .ct-left > *,
.ct-page .ct-body > *,
.ct-page .ct-right > * { margin-block: 0; }

.ct-page .ct-left {
	display: flex;
	flex-direction: column;
	gap: clamp(14px, 2.4vh, 28px);
	padding-inline: clamp(16px, 4vw, 64px);
	padding-block: clamp(16px, 3vh, 32px);
	min-width: 0;
}
.ct-page .ct-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: clamp(14px, 2.4vh, 24px);
	max-width: 520px;
}

/* Logo */
.wp-block-casetransfer-logo { display: inline-flex; align-items: center; align-self: flex-start; color: var(--ct-ink); text-decoration: none; line-height: 0; }
.wp-block-casetransfer-logo .ct-logo-svg { width: var(--ct-logo-w, 212px); height: auto; aspect-ratio: 254 / 48; display: block; }
a.wp-block-casetransfer-logo:focus-visible { outline: 3px solid color-mix(in srgb, var(--ct-blue) 45%, transparent); outline-offset: 4px; border-radius: 6px; }

/* Headline */
.ct-page h1.ct-title {
	font-family: var(--ct-display);
	font-weight: 700;
	font-size: clamp(34px, min(4.2vw, 6.4vh), 58px);
	line-height: 1.02;
	letter-spacing: -.025em;
	color: var(--ct-ink);
	text-wrap: balance;
	margin: 0;
	text-transform: none;
}
.ct-page h1.ct-title em {
	font-style: normal;
	background: linear-gradient(90deg, var(--ct-blue), var(--ct-teal));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.ct-page p.ct-lede { font-size: 16px; color: var(--ct-ink-soft); margin: -4px 0 0; }

/* Check list */
.ct-page ul.ct-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ct-page ul.ct-points li { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 14.5px; margin: 0; padding: 0; }
.ct-page ul.ct-points li::before {
	content: "✓"; flex: none; width: 20px; height: 20px; border-radius: 50%;
	background: var(--ct-chip); color: var(--ct-blue); font-size: 11px; font-weight: 800;
	display: grid; place-items: center;
}

.ct-page p.ct-foot { font-size: 12px; color: var(--ct-ink-soft); margin: 0; }

/* ---------------------------------------------------------------- Form */

.wp-block-casetransfer-signup-form { color: var(--ct-ink); font-family: var(--ct-body); }
.ct-signup[hidden] { display: none; }
.ct-signup { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.ct-signup .ct-signup__title { grid-column: 1 / -1; font-family: var(--ct-display); font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: 0; color: var(--ct-ink); margin: 0 0 2px; text-transform: none; }
.ct-signup .ct-f { display: grid; gap: 4px; min-width: 0; margin: 0; }
.ct-signup .ct-f--full { grid-column: 1 / -1; }
.ct-signup .ct-f label { font-size: 12.5px; font-weight: 600; color: var(--ct-ink-soft); margin: 0; line-height: 1.4; }
.ct-signup .ct-f input {
	width: 100%; height: 42px; margin: 0;
	border: 1px solid var(--ct-line); border-radius: 10px;
	background: var(--ct-surface); color: var(--ct-ink);
	font: inherit; font-size: 15px; line-height: normal; padding: 0 12px;
	box-shadow: none; outline: none;
	transition: border-color .15s, box-shadow .15s;
}
.ct-signup .ct-f input::placeholder { color: var(--ct-ink-soft); opacity: .7; }
.ct-signup .ct-f input:focus { border-color: var(--ct-blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ct-blue) 16%, transparent); outline: none; }
.ct-signup .ct-f input[aria-invalid="true"] { border-color: var(--ct-orange); }

.ct-signup .ct-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.ct-signup .ct-btn {
	grid-column: 1 / -1; height: 46px; margin: 4px 0 0; padding: 0 16px;
	border: 0; border-radius: 10px; cursor: pointer;
	background: var(--ct-blue); color: var(--ct-blue-ink);
	font: inherit; font-weight: 700; font-size: 15px; line-height: 1; letter-spacing: 0; text-transform: none;
	box-shadow: none;
	transition: filter .15s ease, transform .15s ease;
}
.ct-signup .ct-btn:hover,
.ct-signup .ct-btn:focus { background: var(--ct-blue); color: var(--ct-blue-ink); filter: brightness(1.08); }
.ct-signup .ct-btn:active { transform: translateY(1px); }
.ct-signup .ct-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--ct-blue) 45%, transparent); outline-offset: 2px; }
.ct-signup .ct-btn[disabled] { cursor: progress; filter: saturate(.6) brightness(1.05); }

.ct-signup .ct-hint { grid-column: 1 / -1; font-size: 12.5px; color: var(--ct-ink-soft); margin: 0; }
.ct-signup .ct-hint.is-error { color: var(--ct-orange); font-weight: 600; }

.ct-thanks { display: flex; gap: 12px; align-items: flex-start; background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: 14px; padding: 16px 18px; }
.ct-thanks[hidden] { display: none; }
.ct-thanks:focus { outline: none; }
.ct-thanks .ct-thanks__check { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--ct-teal); color: #fff; display: grid; place-items: center; font-weight: 800; }
.ct-thanks p { margin: 0; color: var(--ct-ink-soft); }
.ct-thanks strong { color: var(--ct-ink); }

/* ------------------------------------------------------ Right / preview */

.ct-page .ct-right {
	position: relative;
	background: var(--ct-stage);
	border-left: 1px solid var(--ct-line);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: clamp(20px, 4vh, 48px) 0 clamp(20px, 4vh, 48px) clamp(24px, 3.5vw, 56px);
	min-width: 0;
}

.wp-block-casetransfer-dashboard-preview { margin: 0; min-width: 0; }
.wp-block-casetransfer-dashboard-preview .ct-cap { color: var(--ct-stage-ink); font-size: 13px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; font-family: var(--ct-body); }
.wp-block-casetransfer-dashboard-preview .ct-cap b { font-weight: 600; }
.ct-frame { position: relative; border-radius: 14px 0 0 14px; box-shadow: var(--ct-shadow); overflow: hidden; background: #fff; border: 1px solid var(--ct-line); border-right: 0; opacity: .92; }
/* Outside .ct-right the frame gets all four corners. */
.wp-block-casetransfer-dashboard-preview:not(.ct-right *) .ct-frame { border-radius: 14px; border-right: 1px solid var(--ct-line); }
.ct-scaler { position: relative; overflow: hidden; aspect-ratio: 1080 / 700; }
.ct-scaler.is-fit { aspect-ratio: auto; }
.ct-scaler > .ct-dash { position: absolute; top: 0; left: 0; transform-origin: 0 0; transform: scale(var(--ct-scale, .5)); }

@media (max-width: 960px) {
	.wp-block-group.ct-page,
	.ct-page { grid-template-columns: minmax(0, 1fr); }
	.ct-page .ct-right { display: none; }
	.ct-page .ct-body { max-width: 560px; margin-inline: auto; width: 100%; }
}
@media (max-width: 420px) {
	.ct-signup { grid-template-columns: 1fr; }
}

/* ===== Dashboard mockup (laid out at 1080px, scaled to fit by view.js) ===== */
.ct-dash { width: 1080px; display: grid; grid-template-columns: 188px 1fr; background: var(--m-bg); color: var(--m-ink); font-family: var(--ct-body); font-size: 13px; line-height: 1.4; text-align: left; }
.ct-dash * { box-sizing: border-box; }
.ct-dash p, .ct-dash table { margin: 0; }
.ct-dash .bg-blue { background: var(--m-blue); }
.ct-dash .bg-orange { background: var(--m-orange); }
.ct-dash .d-side { background: var(--m-side); color: #c9d3e4; padding: 20px 12px; display: flex; flex-direction: column; gap: 4px; }
.ct-dash .d-logo { color: #fff; margin: 0 4px 20px; line-height: 0; }
.ct-dash .d-logo svg { width: 159px; height: 30px; }
.ct-dash .d-label { font-size: 10px; letter-spacing: .12em; font-weight: 700; color: #7f8ca6; margin: 0 8px 8px; }
.ct-dash .d-nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; font-weight: 500; }
.ct-dash .d-nav svg { width: 16px; height: 16px; opacity: .85; flex: none; }
.ct-dash .d-nav.on { background: #22324f; color: #fff; box-shadow: inset 2px 0 0 #3d8bf0; }
.ct-dash .d-nav .badge { margin-left: auto; background: #1d4e5c; color: #5fe0cf; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.ct-dash .d-nav .chev { margin-left: auto; opacity: .6; }
.ct-dash .d-user { margin-top: auto; border-top: 1px solid #22324f; padding: 14px 6px 0; display: flex; gap: 10px; align-items: center; font-size: 12px; }
.ct-dash .d-user .av { width: 30px; height: 30px; border-radius: 50%; background: #2a4f8f; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 11px; }
.ct-dash .d-user small { display: block; color: #7f8ca6; font-size: 10.5px; }

.ct-dash .d-main { padding: 22px 24px; display: grid; gap: 14px; }
.ct-dash .d-top { display: flex; justify-content: space-between; align-items: end; }
.ct-dash .d-top .firm { font-size: 10px; letter-spacing: .12em; font-weight: 700; color: var(--m-soft); }
.ct-dash .d-h3 { font-family: var(--ct-display); font-size: 26px; font-weight: 700; margin: 2px 0; letter-spacing: -.01em; line-height: 1.2; }
.ct-dash .d-top p { color: var(--m-soft); }
.ct-dash .d-actions { display: flex; gap: 8px; align-items: center; }
.ct-dash .d-ghost { border: 1px solid var(--m-line); background: #fff; border-radius: 9px; padding: 7px 12px; font-weight: 600; }
.ct-dash .d-cta { background: var(--m-blue); color: #fff; border-radius: 999px; padding: 8px 16px; font-weight: 700; }

.ct-dash .d-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ct-dash .d-card { background: var(--m-card); border: 1px solid var(--m-line); border-radius: 12px; padding: 15px; }
.ct-dash .d-kpi .t { display: flex; align-items: center; gap: 8px; color: var(--m-soft); font-weight: 600; }
.ct-dash .d-kpi .t i { width: 24px; height: 24px; border-radius: 7px; background: #e9f1fd; color: var(--m-blue); display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 12px; }
.ct-dash .d-kpi .v { font-family: var(--ct-display); font-size: 25px; font-weight: 700; margin: 8px 0 6px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ct-dash .d-kpi .v small { font-size: 14px; color: var(--m-soft); font-weight: 500; }
.ct-dash .d-kpi .s { color: var(--m-soft); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.ct-dash .up { background: var(--m-greenbg); color: var(--m-green); font-weight: 700; border-radius: 6px; padding: 1px 6px; font-size: 11.5px; }
.ct-dash .split { display: flex; gap: 3px; height: 5px; margin-bottom: 7px; }
.ct-dash .split b { border-radius: 3px; }
.ct-dash .sq { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }

.ct-dash .d-row { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; }
.ct-dash .d-h4 { margin: 0; font-size: 14px; font-weight: 700; }
.ct-dash .sub { color: var(--m-soft); font-size: 12px; }
.ct-dash .d-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 8px; }
.ct-dash .legend { display: flex; gap: 14px; color: var(--m-soft); font-size: 12px; }
.ct-dash .ct-chart-svg { width: 100%; height: auto; display: block; }
.ct-dash .flow { display: grid; gap: 14px; margin-top: 12px; }
.ct-dash .flow > div + div { border-top: 1px solid var(--m-line); padding-top: 14px; }
.ct-dash .flow .r { display: flex; justify-content: space-between; align-items: baseline; }
.ct-dash .flow .amt { font-family: var(--ct-display); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.ct-dash .flow .g { color: var(--m-green); font-weight: 700; font-size: 12px; }
.ct-dash .bar { height: 6px; border-radius: 3px; background: var(--m-line); margin: 8px 0 6px; overflow: hidden; }
.ct-dash .bar b { display: block; height: 100%; border-radius: 3px; }
.ct-dash .flow .meta { display: flex; justify-content: space-between; color: var(--m-soft); font-size: 12px; }

.ct-dash .d-table { padding: 0; overflow: hidden; }
.ct-dash .d-table .d-head { padding: 14px 15px 8px; margin: 0; }
.ct-dash .d-table table { width: 100%; border-collapse: collapse; border: 0; font-variant-numeric: tabular-nums; font-size: 13px; }
.ct-dash .d-table th { text-align: left; font-size: 10px; letter-spacing: .08em; color: var(--m-soft); font-weight: 700; background: #f7f9fc; padding: 8px 15px; border: 0; border-block: 1px solid var(--m-line); }
.ct-dash .d-table th.sort { color: var(--m-blue); }
.ct-dash .d-table td { padding: 9px 15px; border: 0; border-bottom: 1px solid var(--m-line); background: transparent; }
.ct-dash .d-table tr:last-child td { border-bottom: 0; }
.ct-dash .d-table .num { text-align: right; }
.ct-dash .d-table td.money { font-weight: 700; }
.ct-dash .who { display: flex; gap: 10px; align-items: center; }
.ct-dash .who .av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; background: #eaf1fb; color: #2a4f8f; }
.ct-dash .today { color: var(--m-green); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
	.ct-page *, .ct-signup * { transition: none !important; }
}
