/* Caliber Event Capture
   Self contained. No web fonts, no external requests, ~8KB.
   Everything is scoped under .cc-scope and uses element+class selectors so a
   theme's own button and input styling cannot bleed through. */

/* --- Let the capture page breathe: the theme's title and container step aside */

.caliber-capture-page .page-header,
.caliber-capture-page .entry-title,
.caliber-capture-page .page-title {
	display: none !important;
}

.caliber-capture-page .site-main,
.caliber-capture-page .page-content,
.caliber-capture-page .entry-content {
	max-width: none !important;
	width: auto !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* --------------------------------------------------------------- the stage */

/* Palette: one deep navy for the header, one blue accent for anything actionable,
   warm-neutral greys for everything else, and a single green reserved for success.
   Four hues total, which is what keeps it from looking busy. */

.cc-scope {
	--cc-ink: #0b1220;
	--cc-ink-2: #313c4f;
	--cc-muted: #5b6577;
	--cc-faint: #98a2b3;
	--cc-line: #e4e9f2;
	--cc-bg: #f6f8fb;
	--cc-err: #d92d20;
	--cc-ok: #059669;
	--cc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	display: block;
	width: 100%;
	padding: 24px 16px 44px;
	background: linear-gradient(180deg, var(--cc-brand-soft, #eef4fe) 0, var(--cc-bg) 180px, var(--cc-bg) 100%);
	font-family: var(--cc-font);
	font-size: 16px;
	line-height: 1.5;
	color: var(--cc-ink);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.cc-scope,
.cc-scope *,
.cc-scope *::before,
.cc-scope *::after { box-sizing: border-box; }

.cc-scope button,
.cc-scope input,
.cc-scope select,
.cc-scope textarea {
	font-family: inherit;
	color: inherit;
	margin: 0;
}

/* The !important flags below are deliberate. Themes and page builders routinely
   set button and input styling with !important of their own, which is what turns
   a widget like this magenta on hover. This block has to win on any theme. */

.cc-scope button {
	padding: 0;
	background: transparent !important;
	border: 0;
	text-align: left;
	-webkit-appearance: none;
	appearance: none;
}

/* Text inside buttons and labels MUST be allowed to wrap. Plenty of themes set
   white-space: nowrap on every button to keep short labels on one line; inside a
   two-line option tile that forces the text straight out through the right edge
   of the card. This is the single most important rule in the file. */

.cc-scope button,
.cc-scope button *,
.cc-scope label,
.cc-scope label * {
	white-space: normal !important;
	overflow-wrap: break-word;
	text-transform: none !important;
	letter-spacing: normal !important;
	min-width: 0;
	max-width: 100%;
}

/* ...except the chosen filename, which ellipsises on purpose. */
.cc-scope .cc-file-name {
	white-space: nowrap !important;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cc-scope img { max-width: 100%; height: auto; }

.cc-shell {
	max-width: 540px;
	margin: 0 auto;
	background: #fff;
	border: 1px solid var(--cc-line);
	border-radius: 18px;
	box-shadow: 0 1px 2px rgba(11, 18, 32, .03), 0 12px 28px -16px rgba(11, 18, 32, .18);
	overflow: hidden;
}

/* ---------------------------------------------------------------- the head */

.cc-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 18px;
	/* Navy, not the accent blue. The accent is saved for things you can tap. */
	background: linear-gradient(135deg, var(--cc-brand-deep, #0e2456) 0, var(--cc-brand-mid, #15398c) 100%) !important;
	color: #fff;
}

.cc-head-brand {
	min-width: 0;
	overflow: hidden;
}

.cc-wordmark {
	display: block;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -.01em;
	color: #fff;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cc-logo {
	display: block;
	height: 32px;
	width: auto;
	max-width: 170px;
	object-fit: contain;
}

.cc-event {
	flex: 0 1 auto;
	min-width: 0;
	max-width: 55%;
	padding: 5px 11px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .14);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: .01em;
	color: #fff;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cc-body { padding: 22px 18px 24px; }

/* -------------------------------------------------------------- typography */

.cc-h {
	margin: 0 0 6px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -.015em;
	color: var(--cc-ink);
}

.cc-sub {
	margin: 0 0 20px;
	font-size: 14.5px;
	line-height: 1.55;
	color: var(--cc-muted);
}

/* ------------------------------------------------------------ choice tiles */

.cc-scope button.cc-tile {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	min-height: 72px;
	margin: 0 0 10px;
	padding: 14px !important;
	background: #fff !important;
	border: 1.5px solid var(--cc-line) !important;
	border-radius: 14px !important;
	cursor: pointer;
	transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .1s ease;
}

.cc-scope button.cc-tile:last-of-type { margin-bottom: 0; }

/* Calm hover: a soft tint of the brand plus a brand border. No colour flip, no
   jump. Phones never see hover, so :active carries the tap feedback instead. */

.cc-scope button.cc-tile:hover,
.cc-scope button.cc-tile:focus-visible {
	background: var(--cc-brand-soft, #eef4fe) !important;
	border-color: var(--cc-brand, #2563eb) !important;
	box-shadow: 0 6px 16px -12px rgba(11, 18, 32, .3);
	outline: none;
}

.cc-scope button.cc-tile:focus-visible {
	box-shadow: 0 0 0 3.5px var(--cc-ring, rgba(37, 99, 235, .16));
}

.cc-scope button.cc-tile:active {
	background: var(--cc-brand-soft, #eef4fe) !important;
	border-color: var(--cc-brand, #2563eb) !important;
	transform: scale(.99);
}

.cc-tile-ico {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: var(--cc-brand-soft, #eef3fd) !important;
	color: var(--cc-brand-dark, #1541ae);
	transition: background-color .16s ease, color .16s ease;
}

.cc-tile-ico svg { width: 22px; height: 22px; }

.cc-scope button.cc-tile:hover .cc-tile-ico,
.cc-scope button.cc-tile:focus-visible .cc-tile-ico,
.cc-scope button.cc-tile:active .cc-tile-ico {
	background: var(--cc-brand, #2563eb) !important;
	color: #fff;
}

.cc-tile-txt { flex: 1 1 auto; min-width: 0; }

.cc-tile-title {
	display: block;
	font-size: 15.5px !important;
	font-weight: 700;
	line-height: 1.35;
	color: var(--cc-ink) !important;
}

.cc-tile-sub {
	display: block;
	margin-top: 3px;
	font-size: 13.5px !important;
	line-height: 1.45;
	color: var(--cc-muted) !important;
}

.cc-tile-go {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	color: var(--cc-faint);
	transition: color .16s ease, transform .16s ease;
}

.cc-tile-go svg { width: 18px; height: 18px; }

.cc-scope button.cc-tile:hover .cc-tile-go,
.cc-scope button.cc-tile:focus-visible .cc-tile-go,
.cc-scope button.cc-tile:active .cc-tile-go {
	color: var(--cc-brand, #2563eb);
	transform: translateX(2px);
}

/* ------------------------------------------------------------- back button */

.cc-scope button.cc-back {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin: 0 0 14px;
	padding: 6px 11px 6px 7px;
	border-radius: 8px;
	/* !important because a theme colouring every button's text white would make
	   this label invisible against the card. */
	color: var(--cc-muted) !important;
	font-size: 13.5px !important;
	font-weight: 600;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
}

.cc-scope button.cc-back:hover {
	background: var(--cc-bg) !important;
	color: var(--cc-ink) !important;
}

.cc-back svg { width: 15px; height: 15px; }

/* -------------------------------------------------------------- the fields */

.cc-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 15px 12px;
}

.cc-field { grid-column: 1 / -1; min-width: 0; }
.cc-field.cc-half { grid-column: span 1; }

/* Block, not flex: the "Optional" badge then flows as part of the sentence and
   wraps with it, instead of being squeezed into its own column and breaking
   mid-word on a narrow screen. */

.cc-label {
	display: block;
	margin: 0 0 6px;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--cc-ink-2);
	text-decoration: none;
	cursor: pointer;
}

.cc-scope .cc-opt {
	display: inline;
	margin-left: 6px;
	font-size: 11.5px;
	font-weight: 500;
	color: var(--cc-faint);
	white-space: nowrap !important;
}

.cc-scope .cc-field input[type="text"],
.cc-scope .cc-field input[type="email"],
.cc-scope .cc-field input[type="tel"],
.cc-scope .cc-field select,
.cc-scope .cc-field textarea {
	display: block;
	width: 100%;
	padding: 12px 13px !important;
	/* 16px is the floor that stops iOS zooming the page on focus, so a theme
	   must not be allowed to shrink it. */
	font-size: 16px !important;
	font-weight: 400;
	line-height: 1.4;
	color: var(--cc-ink) !important;
	background: #fff !important;
	border: 1.5px solid var(--cc-line) !important;
	border-radius: 10px !important;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.cc-scope .cc-field textarea {
	min-height: 86px;
	resize: vertical;
}

.cc-scope .cc-field input:focus,
.cc-scope .cc-field select:focus,
.cc-scope .cc-field textarea:focus {
	outline: none;
	border-color: var(--cc-brand, #1a4fd6) !important;
	box-shadow: 0 0 0 3.5px var(--cc-ring, rgba(26, 79, 214, .18)) !important;
}

.cc-scope .cc-field ::placeholder {
	color: var(--cc-faint);
	opacity: 1;
}

/* select */

.cc-select { position: relative; }
.cc-select select { padding-right: 40px !important; cursor: pointer; }

.cc-select-arrow {
	position: absolute;
	top: 50%;
	right: 16px;
	width: 9px;
	height: 9px;
	margin-top: -6px;
	border-right: 2px solid var(--cc-muted);
	border-bottom: 2px solid var(--cc-muted);
	transform: rotate(45deg);
	pointer-events: none;
}

/* file */

.cc-file { position: relative; }

.cc-file-input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
}

.cc-file-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 13px;
	background: var(--cc-brand-soft, #eef3fd) !important;
	border: 1.5px dashed var(--cc-brand-line, #b9caf4) !important;
	border-radius: 10px !important;
	color: var(--cc-brand-dark, #1541ae) !important;
	font-size: 14.5px;
	font-weight: 600;
	cursor: pointer;
	transition: border-color .15s ease;
}

.cc-file-btn:hover { border-color: var(--cc-brand, #1a4fd6); }
.cc-file-btn svg { flex: 0 0 auto; width: 18px; height: 18px; }

.cc-file-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cc-file-input:focus-visible + .cc-file-btn {
	border-color: var(--cc-brand, #1a4fd6);
	box-shadow: 0 0 0 3.5px var(--cc-ring, rgba(26, 79, 214, .18));
}

.cc-file.cc-has-file .cc-file-btn { border-style: solid; }

/* hints and errors */

.cc-hint {
	margin: 6px 0 0;
	font-size: 12.5px;
	line-height: 1.45;
	color: var(--cc-muted);
}

.cc-err {
	margin: 6px 0 0;
	font-size: 12.8px;
	font-weight: 600;
	color: var(--cc-err);
}

.cc-invalid input,
.cc-invalid select,
.cc-invalid textarea { border-color: var(--cc-err) !important; }

.cc-alert {
	margin: 0 0 18px;
	padding: 12px 14px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-left-width: 4px;
	border-radius: 9px;
	color: #991b1b;
	font-size: 14px;
}

/* ----------------------------------------------------------------- consent */

.cc-consent {
	display: flex;
	align-items: flex-start;
	gap: 11px;
	margin: 20px 0 0;
	padding: 13px 14px;
	background: var(--cc-bg);
	border-radius: 10px;
	font-size: 13.8px;
	line-height: 1.5;
	color: var(--cc-ink-2);
	cursor: pointer;
}

.cc-consent input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.cc-consent-box {
	position: relative;
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin-top: 1px;
	background: #fff !important;
	border: 1.5px solid #cbd5e1 !important;
	border-radius: 6px;
	transition: background-color .15s ease, border-color .15s ease;
}

.cc-consent-box::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 2px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg) scale(0);
	transition: transform .15s ease;
}

.cc-consent input:checked + .cc-consent-box {
	background: var(--cc-brand, #1a4fd6) !important;
	border-color: var(--cc-brand, #1a4fd6) !important;
}

.cc-consent input:checked + .cc-consent-box::after { transform: rotate(45deg) scale(1); }

.cc-consent input:focus-visible + .cc-consent-box {
	box-shadow: 0 0 0 3.5px var(--cc-ring, rgba(26, 79, 214, .18));
}

.cc-consent.cc-invalid .cc-consent-box { border-color: var(--cc-err); }

/* ------------------------------------------------------------------ submit */

.cc-scope button.cc-submit {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	margin-top: 18px;
	padding: 15px 18px !important;
	background: var(--cc-brand, #1a4fd6) !important;
	border-radius: 11px !important;
	color: #fff !important;
	font-size: 16px !important;
	font-weight: 700;
	text-align: center;
	cursor: pointer;
	box-shadow: 0 10px 20px -10px rgba(15, 23, 42, .45);
	transition: background-color .15s ease, transform .12s ease;
}

.cc-scope button.cc-submit:hover { background: var(--cc-brand-dark, #1541ae) !important; }
.cc-scope button.cc-submit:active { transform: translateY(1px); }

.cc-scope button.cc-submit[disabled] {
	opacity: .8;
	cursor: progress;
}

.cc-spin {
	display: none;
	width: 17px;
	height: 17px;
	border: 2.5px solid rgba(255, 255, 255, .45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: ccSpin .7s linear infinite;
}

.cc-submit.is-busy .cc-spin { display: block; }

@keyframes ccSpin { to { transform: rotate(360deg); } }

/* honeypot: off screen, never announced, never focusable */

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

/* ------------------------------------------------------------- transitions */

.cc-step[hidden] { display: none !important; }

.cc-step { animation: ccIn .3s cubic-bezier(.2, .7, .3, 1) both; }

@keyframes ccIn {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------- thank you */

.cc-done { text-align: center; padding: 6px 0 2px; }

.cc-check {
	width: 74px;
	height: 74px;
	margin: 0 auto 16px;
	color: var(--cc-ok);
}

.cc-check svg { width: 100%; height: 100%; }

.cc-check-ring {
	stroke-dasharray: 176;
	stroke-dashoffset: 176;
	animation: ccDraw .5s ease-out .05s forwards;
}

.cc-check-tick {
	stroke-dasharray: 40;
	stroke-dashoffset: 40;
	animation: ccDraw .35s ease-out .45s forwards;
}

@keyframes ccDraw { to { stroke-dashoffset: 0; } }

.cc-done-h {
	margin: 0 0 10px;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -.015em;
}

.cc-done-p {
	margin: 0 auto 12px;
	max-width: 420px;
	font-size: 14.8px;
	line-height: 1.6;
	color: var(--cc-muted);
}

.cc-done-nudge {
	padding: 11px 14px;
	background: var(--cc-brand-soft, #eef3fd);
	border-radius: 10px;
	color: var(--cc-brand-deep, #0d2a73);
	font-weight: 500;
}

.cc-chip {
	display: inline-block;
	margin: 6px 0 20px;
	padding: 6px 13px;
	background: var(--cc-bg);
	border-radius: 999px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--cc-ink-2);
}

.cc-scope a.cc-ghost {
	display: block;
	padding: 13px 18px;
	background: #fff !important;
	border: 1.5px solid var(--cc-line) !important;
	border-radius: 11px;
	color: var(--cc-brand-dark, #1541ae) !important;
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	text-decoration: none !important;
	transition: border-color .15s ease, background-color .15s ease;
}

.cc-scope a.cc-ghost:hover {
	border-color: var(--cc-brand, #1a4fd6) !important;
	background: var(--cc-brand-soft, #eef3fd) !important;
}

/* ---------------------------------------------------------------- footnote */

.cc-footnote {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	max-width: 560px;
	margin: 14px auto 0;
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--cc-muted);
	text-align: center;
}

.cc-footnote svg { flex: 0 0 auto; width: 14px; height: 14px; }

/* ------------------------------------------------- leave-without-sending modal */

.cc-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.cc-modal[hidden] { display: none !important; }

.cc-modal-veil {
	position: absolute;
	inset: 0;
	background: rgba(11, 18, 32, .58);
	animation: ccFade .2s ease both;
}

.cc-modal-card {
	position: relative;
	width: 100%;
	max-width: 400px;
	padding: 26px 22px 18px;
	background: #fff;
	border-radius: 18px;
	text-align: center;
	box-shadow: 0 24px 60px -18px rgba(11, 18, 32, .55);
	animation: ccPop .26s cubic-bezier(.2, .8, .3, 1) both;
}

.cc-modal-ico {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	margin: 0 auto 14px;
	border-radius: 50%;
	background: #fef3c7;
	color: #b45309;
}

.cc-modal-ico svg { width: 26px; height: 26px; }

.cc-modal-title {
	margin: 0 0 8px;
	font-size: 18.5px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--cc-ink);
}

.cc-modal-text {
	margin: 0 0 20px;
	font-size: 14.5px;
	line-height: 1.55;
	color: var(--cc-muted);
}

.cc-scope button.cc-modal-stay {
	display: block;
	width: 100%;
	margin: 0 0 6px;
	padding: 14px 18px !important;
	background: var(--cc-brand, #2563eb) !important;
	border-radius: 11px !important;
	color: #fff !important;
	font-size: 15.5px !important;
	font-weight: 700;
	text-align: center;
	cursor: pointer;
	transition: background-color .15s ease;
}

.cc-scope button.cc-modal-stay:hover { background: var(--cc-brand-dark, #1f53c5) !important; }

.cc-scope button.cc-modal-leave {
	display: block;
	width: 100%;
	padding: 11px 18px !important;
	border-radius: 10px !important;
	color: var(--cc-muted) !important;
	font-size: 14px !important;
	font-weight: 600;
	text-align: center;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
}

.cc-scope button.cc-modal-leave:hover {
	background: var(--cc-bg) !important;
	color: var(--cc-ink) !important;
}

@keyframes ccFade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes ccPop {
	from { opacity: 0; transform: translateY(14px) scale(.97); }
	to   { opacity: 1; transform: none; }
}

/* -------------------------------------------------------------- responsive */

@media (min-width: 600px) {
	.cc-scope { padding: 44px 20px 64px; }
	.cc-head  { padding: 19px 30px; }
	.cc-body  { padding: 30px 30px 32px; }
	.cc-h     { font-size: 22px; }
	.cc-done-h { font-size: 25px; }
}

/* Small phones (320-374px). Claw back horizontal room for the text: tighter
   gutters, a smaller icon, and drop the chevron, which is decoration - the whole
   tile is the tap target anyway. The event name stays; it ellipsises instead. */

@media (max-width: 374px) {
	.cc-scope { padding-left: 12px; padding-right: 12px; }
	.cc-body { padding: 20px 15px 22px; }
	.cc-head { padding: 14px 15px; }

	.cc-h { font-size: 19px; }
	.cc-field.cc-half { grid-column: 1 / -1; }

	.cc-tile-go { display: none; }
	.cc-scope button.cc-tile { gap: 12px; padding: 13px !important; }
	.cc-tile-ico { width: 38px; height: 38px; border-radius: 10px; }
	.cc-tile-ico svg { width: 19px; height: 19px; }

	.cc-wordmark { font-size: 15px; }
	.cc-event { font-size: 11px; padding: 4px 9px; }

	.cc-modal { padding: 16px; }
	.cc-modal-card { padding: 22px 18px 16px; }
	.cc-modal-title { font-size: 17.5px; }
}

@media (prefers-reduced-motion: reduce) {
	.cc-scope *,
	.cc-scope *::before,
	.cc-scope *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
	.cc-check-ring,
	.cc-check-tick { stroke-dashoffset: 0; }
}
