/* Checkpoint floating widget ([checkpoint_portal] shortcode / site-wide via wp_footer).
   Self-contained so it reads consistently regardless of the active theme. Futuristic dark-glass
   aesthetic (2026-08-19): glassmorphism panel, gradient/glow accents, pill buttons -- while
   keeping the underlying tone calm and reassurance-first (spec 1.2), not alarm-styled: glow color
   is teal/cyan, never red, except the logout hover and error states, which intentionally read as
   "leaving"/"wrong". */

.chkp-widget {
	--chkp-primary: #14b8a6;
	--chkp-primary-2: #22d3ee;
	--chkp-primary-dark: #0d9488;
	--chkp-ink: #e2e8f0;
	--chkp-ink-strong: #f8fafc;
	--chkp-muted: #94a3b8;
	--chkp-border: rgba(148, 163, 184, 0.18);
	--chkp-border-strong: rgba(148, 163, 184, 0.32);
	--chkp-field: rgba(255, 255, 255, 0.04);
	--chkp-glow: rgba(20, 184, 166, 0.35);
	--chkp-success-bg: rgba(16, 185, 129, 0.12);
	--chkp-success-border: rgba(52, 211, 153, 0.5);

	position: fixed;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--chkp-ink);
}

.chkp-widget--top-right { top: 20px; right: 20px; }
.chkp-widget--top-left  { top: 20px; left: 20px; }
.chkp-widget--bottom-right { bottom: 20px; right: 20px; }
.chkp-widget--bottom-left  { bottom: 20px; left: 20px; }

/* -- Details/summary shell: opening/closing works with ZERO JavaScript (native browser behavior).
   assets/portal.js only adds auto-open/outside-click/Escape as an enhancement on top. -- */

.chkp-widget-details {
	position: relative;
}

.chkp-widget-details summary {
	list-style: none;
}

.chkp-widget-details summary::-webkit-details-marker,
.chkp-widget-details summary::marker {
	display: none;
	content: "";
}

/* -- Toggle button: circular, gradient, glowing, rotates into a close affordance when open -- */

.chkp-widget-toggle {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--chkp-primary), var(--chkp-primary-2));
	color: #06251f;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 10px 30px -6px var(--chkp-glow), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
	transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.15s ease;
	position: relative;
	z-index: 2;
	outline: none;
}

.chkp-widget-toggle:hover {
	transform: scale(1.06);
	filter: brightness(1.06);
	box-shadow: 0 14px 36px -6px var(--chkp-glow), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.chkp-widget-toggle__icon {
	font-size: 22px;
	font-weight: 700;
	line-height: 1;
	transition: transform 0.25s ease;
}

.chkp-widget-details[open] .chkp-widget-toggle__icon {
	transform: rotate(45deg);
}

/* -- Panel: hidden/collapsed by default, animates open via [open] -- */

.chkp-widget-panel {
	/* Overrides the browser's native details-content "display: none when closed" -- that can't be
	   transitioned, so visibility is handled entirely by our own opacity/pointer-events instead. */
	display: block;
	position: absolute;
	top: 68px;
	right: 0;
	width: min(400px, calc(100vw - 40px));
	max-height: min(600px, calc(100vh - 100px));
	overflow-y: auto;
	opacity: 0;
	pointer-events: none;
	transform: translateY(-8px) scale(0.97);
	transform-origin: top right;
	transition: opacity 0.18s ease, transform 0.18s ease;
}

.chkp-widget--top-left .chkp-widget-panel,
.chkp-widget--bottom-left .chkp-widget-panel {
	right: auto;
	left: 0;
	transform-origin: top left;
}

.chkp-widget--bottom-right .chkp-widget-panel,
.chkp-widget--bottom-left .chkp-widget-panel {
	top: auto;
	bottom: 68px;
	transform-origin: bottom right;
}

.chkp-widget--bottom-left .chkp-widget-panel {
	transform-origin: bottom left;
}

.chkp-widget-details[open] .chkp-widget-panel {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0) scale(1);
}

.chkp-card {
	background: rgba(19, 27, 46, 0.82);
	backdrop-filter: blur(18px) saturate(140%);
	-webkit-backdrop-filter: blur(18px) saturate(140%);
	border: 1px solid var(--chkp-border-strong);
	border-radius: 20px;
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.03) inset,
		0 20px 50px rgba(2, 6, 23, 0.55),
		0 0 40px -10px var(--chkp-glow);
	padding: 30px 26px;
}

.chkp-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 26px;
}

.chkp-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 26px;
}

.chkp-header .chkp-brand {
	margin-bottom: 0;
}

.chkp-brand__mark {
	width: 34px;
	height: 34px;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--chkp-primary), var(--chkp-primary-2));
	color: #06251f;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 17px;
	font-weight: 700;
	flex-shrink: 0;
	box-shadow: 0 0 18px -2px var(--chkp-glow);
}

.chkp-brand__name {
	font-size: 1.14em;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: var(--chkp-ink-strong);
}

.chkp-logout-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid var(--chkp-border);
	color: var(--chkp-muted);
	font-size: 0.82em;
	font-weight: 500;
	cursor: pointer;
	padding: 7px 14px;
	border-radius: 999px;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.chkp-logout-link::before {
	content: "⏻";
	font-size: 0.95em;
	line-height: 1;
}

.chkp-logout-link:hover {
	background: rgba(248, 113, 113, 0.1);
	border-color: rgba(248, 113, 113, 0.4);
	color: #fca5a5;
	box-shadow: 0 0 16px -4px rgba(248, 113, 113, 0.5);
}

.chkp-card h2 {
	font-size: 1.28em;
	font-weight: 600;
	margin: 0 0 6px;
	color: var(--chkp-ink-strong);
	letter-spacing: -0.01em;
}

.chkp-subtext {
	color: var(--chkp-muted);
	font-size: 0.92em;
	margin: 0 0 22px;
	line-height: 1.5;
}

.chkp-flash {
	background: var(--chkp-success-bg);
	border: 1px solid var(--chkp-success-border);
	color: #6ee7b7;
	border-radius: 12px;
	padding: 12px 16px;
	margin-bottom: 20px;
	font-size: 0.92em;
}

.chkp-flash--error {
	background: rgba(248, 113, 113, 0.1);
	border-color: rgba(248, 113, 113, 0.4);
	color: #fca5a5;
}

/* -- Login form -- */

.chkp-card #loginform {
	border: none;
	padding: 0;
	margin-top: 4px;
}

.chkp-card #loginform p {
	margin: 0 0 16px;
}

.chkp-card #loginform label {
	display: block;
	font-size: 0.8em;
	font-weight: 600;
	color: var(--chkp-muted);
	margin-bottom: 7px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.chkp-card #loginform input[type="text"],
.chkp-card #loginform input[type="password"] {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 15px;
	border: 1px solid var(--chkp-border-strong);
	border-radius: 12px;
	font-size: 1em;
	background: var(--chkp-field);
	color: var(--chkp-ink-strong);
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.chkp-card #loginform input[type="text"]::placeholder,
.chkp-card #loginform input[type="password"]::placeholder {
	color: #64748b;
}

.chkp-card #loginform input[type="text"]:focus,
.chkp-card #loginform input[type="password"]:focus {
	outline: none;
	border-color: var(--chkp-primary);
	background: rgba(20, 184, 166, 0.06);
	box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}

.chkp-card #loginform .forgetmenot {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.9em;
	color: var(--chkp-muted);
}

.chkp-card #loginform .forgetmenot input[type="checkbox"] {
	accent-color: var(--chkp-primary);
	width: 15px;
	height: 15px;
}

.chkp-card #loginform .forgetmenot label {
	display: inline;
	text-transform: none;
	font-weight: 400;
	margin: 0;
}

.chkp-card .login-submit {
	margin-top: 6px !important;
}

/* -- Buttons: pill-shaped, gradient fill, glow on hover -- */

.chkp-card input[type="submit"],
.chkp-button {
	display: inline-block;
	width: 100%;
	box-sizing: border-box;
	background: linear-gradient(135deg, var(--chkp-primary), var(--chkp-primary-2));
	color: #06251f;
	border: none;
	border-radius: 999px;
	padding: 13px 18px;
	font-size: 1em;
	font-weight: 700;
	letter-spacing: 0.01em;
	cursor: pointer;
	transition: box-shadow 0.2s ease, transform 0.15s ease, filter 0.15s ease;
	text-align: center;
	box-shadow: 0 8px 24px -8px var(--chkp-glow);
}

.chkp-card input[type="submit"]:hover,
.chkp-button:hover {
	filter: brightness(1.08);
	box-shadow: 0 10px 30px -6px var(--chkp-glow);
	transform: translateY(-1px);
}

.chkp-card input[type="submit"]:active,
.chkp-button:active {
	transform: translateY(0);
}

/* -- "My devices" list -- */

.chkp-device-list {
	list-style: none;
	margin: 0 0 20px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.chkp-device-list li {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 13px 15px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid var(--chkp-border);
	border-radius: 14px;
	transition: border-color 0.15s ease;
}

.chkp-device-list li:hover {
	border-color: var(--chkp-border-strong);
}

.chkp-device-list .chkp-device-icon {
	width: 34px;
	height: 34px;
	border-radius: 10px;
	background: rgba(20, 184, 166, 0.12);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.05em;
	flex-shrink: 0;
}

.chkp-device-list .chkp-device-name {
	font-weight: 600;
	font-size: 0.95em;
	color: var(--chkp-ink-strong);
}

.chkp-device-list .chkp-device-meta {
	color: var(--chkp-muted);
	font-size: 0.82em;
}

.chkp-empty {
	color: var(--chkp-muted);
	font-size: 0.92em;
	margin: 0 0 20px;
}

/* -- Pairing code + QR result -- */

.chkp-pair-result {
	display: flex;
	gap: 18px;
	align-items: center;
	background: linear-gradient(160deg, rgba(20, 184, 166, 0.08), rgba(34, 211, 238, 0.04));
	border: 1px solid var(--chkp-border-strong);
	border-radius: 16px;
	padding: 18px;
	margin-top: 20px;
}

.chkp-pair-result img {
	border-radius: 10px;
	background: #fff; /* QR must stay on a light tile to keep scanning contrast, regardless of theme */
	padding: 8px;
	flex-shrink: 0;
	box-shadow: 0 0 20px -4px var(--chkp-glow);
}

.chkp-pair-code {
	font-size: 1.5em;
	font-weight: 700;
	letter-spacing: 0.14em;
	font-family: "SF Mono", Consolas, monospace;
	background: linear-gradient(135deg, var(--chkp-primary-2), var(--chkp-primary));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.chkp-pair-hint {
	color: var(--chkp-muted);
	font-size: 0.85em;
	margin: 6px 0 0;
	line-height: 1.4;
}

.chkp-footnote {
	color: var(--chkp-muted);
	font-size: 0.8em;
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid var(--chkp-border);
	line-height: 1.5;
}

@media (max-width: 480px) {
	.chkp-widget--top-right, .chkp-widget--top-left,
	.chkp-widget--bottom-right, .chkp-widget--bottom-left {
		top: auto; bottom: 16px; left: 16px; right: 16px;
	}
	.chkp-widget-toggle { margin-left: auto; }
	.chkp-widget-panel { left: 0; right: 0; width: 100%; top: auto; bottom: 68px; transform-origin: bottom center; }
	.chkp-card { padding: 24px 20px; }
	.chkp-pair-result { flex-direction: column; text-align: center; }
}
