/**
 * Team Card styles. Design tokens first so a site can re-skin the card by
 * overriding the custom properties only.
 */

.tc-root {
	--tc-ink: #0c0d73;         /* deep indigo base */
	--tc-violet: #5d58cb;
	--tc-purple: #806bf6;      /* bright accent */
	--tc-paper: #ffffff;
	--tc-cream: #f7f7fb;
	--tc-line: rgba(12, 13, 115, 0.12);
	--tc-display: "Bricolage Grotesque", system-ui, sans-serif;
	--tc-body: "Inter", system-ui, sans-serif;

	font-family: var(--tc-body);
	color: var(--tc-ink);
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 16px 48px;
	box-sizing: border-box;
}

.tc-root *,
.tc-root *::before,
.tc-root *::after { box-sizing: inherit; }


/* -------------------------------------------------------- Elementor pieces */

.tc-elementor-title {
	font-family: "Bricolage Grotesque", system-ui, sans-serif;
	font-weight: 800;
	font-size: clamp(1.8rem, 5vw, 3.2rem);
	line-height: 1.05;
	color: #0c0d73;
	text-align: center;
	margin: 0;
}

.tc-elementor-about {
	--tc-ink: #0c0d73;
	--tc-violet: #5d58cb;
	--tc-purple: #806bf6;
	--tc-paper: #ffffff;
	--tc-display: "Bricolage Grotesque", system-ui, sans-serif;
	--tc-body: "Inter", system-ui, sans-serif;
	font-family: var(--tc-body);
	color: var(--tc-ink);
}

/* ------------------------------------------------------------------ chrome */

.tc-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 0;
	background: var(--tc-paper);
}

.tc-header__logo img { height: 40px; width: auto; display: block; }
.tc-header__logo--text { font-family: var(--tc-display); font-weight: 800; }

.tc-headline {
	font-family: var(--tc-display);
	font-weight: 800;
	font-size: clamp(1.8rem, 5vw, 3.2rem);
	line-height: 1.05;
	text-align: center;
	margin: 8px auto 24px;
}

.tc-layout {
	display: grid;
	gap: 28px;
	grid-template-columns: 1fr;
	align-items: start;
}

@media (min-width: 1024px) {
	.tc-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}

.tc-cardcol {
	position: relative;
	display: grid;
	grid-template-columns: 1fr;
	justify-items: center;
	min-width: 0;
}

.tc-stage-wrap {
	position: relative;
	width: 100%;
	max-width: var(--tc-stage-max-width, 620px);
}

/* Elementor containers sometimes apply overflow rules to widget wrappers. */
.elementor-widget-team-card .elementor-widget-container,
.elementor-widget-shortcode .elementor-widget-container {
	overflow: visible;
}

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

.tc-stage {
	position: relative;
	width: 100%;
	aspect-ratio: 210 / 297;          /* A4 portrait */
	perspective: 1600px;
	transform-style: preserve-3d;
}

.tc-page,
.tc-cover,
.tc-turn {
	position: absolute;
	inset: 0;
	border-radius: 10px;
	background:
		repeating-linear-gradient(
			to bottom,
			transparent 0,
			transparent 30px,
			var(--tc-line) 30px,
			var(--tc-line) 31px
		),
		var(--tc-cream);
	box-shadow: 0 18px 44px rgba(12, 13, 115, 0.18);
	overflow: hidden;
}

.tc-page.is-signable { cursor: crosshair; }

/* Optional inside cover is a dedicated image-only Page 1. */
.tc-page--image {
	padding: 0;
	background: var(--tc-cream);
	cursor: default;
}
.tc-page--image > img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.tc-page__blank {
	position: absolute;
	inset: auto 0 12% 0;
	text-align: center;
	font-size: 0.85rem;
	opacity: 0.55;
	margin: 0;
}

/* Cover sits above the notes while the card is closed. */
.tc-cover { z-index: 30; padding: 0; }
.tc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tc-stage.is-open .tc-cover { z-index: 1; }

/* ------------------------------------------------------- page turn animation */

@keyframes tc-turn-next {
	from { transform: rotateY(0deg) translateZ(1px); }
	to   { transform: rotateY(-168deg) translateZ(1px); }
}

@keyframes tc-turn-prev {
	from { transform: rotateY(-168deg) translateZ(1px); }
	to   { transform: rotateY(0deg) translateZ(1px); }
}

.tc-turn {
	z-index: 40;
	transform-origin: left center;      /* both directions sweep from the same fold */
	transform-style: preserve-3d;
	background: none;
	box-shadow: none;
}

.tc-turn--next { animation: tc-turn-next 0.9s cubic-bezier(0.55, 0.1, 0.35, 0.95) both; }
.tc-turn--prev { animation: tc-turn-prev 0.9s cubic-bezier(0.55, 0.1, 0.35, 0.95) both; }

.tc-turn__face {
	position: absolute;
	inset: 0;
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	border-radius: 10px;
	overflow: hidden;
	background:
		repeating-linear-gradient(to bottom, transparent 0, transparent 30px, var(--tc-line) 30px, var(--tc-line) 31px),
		var(--tc-cream);
}

.tc-turn__back {
	transform: rotateY(180deg) translateZ(1px);
	/* The reverse of a real sheet is opaque: never mirror front-side messages. */
	background:
		repeating-linear-gradient(to bottom, transparent 0, transparent 30px, var(--tc-line) 30px, var(--tc-line) 31px),
		var(--tc-cream);
}
.tc-turn__face--image { background: var(--tc-cream); }
.tc-turn__face--image > img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* --------------------------------------------------------------- arrows */

.tc-arrow {
	appearance: none;
	border: 2px solid var(--tc-ink);
	background: var(--tc-paper);
	color: var(--tc-ink);
	width: 46px;
	height: 46px;
	border-radius: 999px;
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
}

.tc-arrow:hover { background: var(--tc-purple); color: #fff; border-color: var(--tc-purple); }

.tc-arrow--prev,
.tc-arrow--next { position: absolute; top: 50%; transform: translateY(-50%); display: none; z-index: 45; }
.tc-arrow--prev { left: -58px; }
.tc-arrow--next { right: -58px; }

.tc-arrows-mobile { display: flex; gap: 12px; margin-top: 16px; }

@media (min-width: 1024px) {
	.tc-arrow--prev,
	.tc-arrow--next { display: grid; place-items: center; }
	.tc-arrows-mobile { display: none; }
}

@media (min-width: 1024px) and (max-width: 1180px) {
	.tc-arrow--prev { left: 12px; }
	.tc-arrow--next { right: 12px; }
}

/*
 * On desktop JavaScript also caps the stage against the full viewport height.
 * The separately placed Elementor title/About widgets are intentionally not
 * subtracted from the card height.
 */
.tc-stage-wrap,
.tc-thumbs {
	transition: max-width 120ms ease-out;
}

/* ------------------------------------------------------------------- notes */

.tc-note {
	position: absolute;
	user-select: none;
	padding: 6px;
	line-height: 1.15;
	z-index: 10;
}

.tc-note.is-selected,
.tc-note.is-editable.is-selected { z-index: 20; outline: 2px dashed currentColor; }

.tc-note__inner { width: 100%; height: 100%; overflow: hidden; }

/* Messages are plain text — deliberately no boxes, borders or shadows. */
.tc-note__message { margin: 0; font-size: 1em; overflow-wrap: anywhere; word-break: break-word; }
.tc-note__name { margin: 4px 0 0; font-size: 0.72em; font-weight: 700; text-transform: uppercase; opacity: 0.7; }

.tc-note__badge {
	position: absolute;
	top: -18px;
	left: 0;
	background: var(--tc-ink);
	color: #fff;
	font-size: 9px;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 2px 6px;
	border-radius: 4px;
	pointer-events: none;
	user-select: none;
}

.tc-note__actions {
	position: absolute;
	top: -46px;
	left: 0;
	display: flex;
	gap: 6px;
}

.tc-note.is-editable { touch-action: none; }

/* ----------------------------------------------------------------- handles */

.tc-handle {
	position: absolute;
	width: 32px;                 /* generous hit area for fingers */
	height: 32px;
	display: grid;
	place-items: center;
	touch-action: none;
	cursor: nwse-resize;
	opacity: 0;
}

.tc-note.is-selected > .tc-handle { opacity: 1; }

.tc-handle::after {
	content: "";
	width: 12px;
	height: 12px;
	border-radius: 999px;
	border: 2px solid currentColor;
	background: var(--tc-paper);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.tc-handle--nw { left: -16px; top: -16px; }
.tc-handle--n  { left: calc(50% - 16px); top: -16px; cursor: ns-resize; }
.tc-handle--ne { right: -16px; top: -16px; cursor: nesw-resize; }
.tc-handle--e  { right: -16px; top: calc(50% - 16px); cursor: ew-resize; }
.tc-handle--se { right: -16px; bottom: -16px; }
.tc-handle--s  { left: calc(50% - 16px); bottom: -16px; cursor: ns-resize; }
.tc-handle--sw { left: -16px; bottom: -16px; cursor: nesw-resize; }
.tc-handle--w  { left: -16px; top: calc(50% - 16px); cursor: ew-resize; }

.tc-handle--rotate {
	left: calc(50% - 22px);
	bottom: -46px;
	width: 44px;
	height: 44px;
	cursor: grab;
	font-size: 1rem;
	color: var(--tc-ink);
}

.tc-handle--rotate::after { display: none; }
.tc-handle--rotate {
	background: var(--tc-paper);
	border: 2px solid var(--tc-ink);
	border-radius: 999px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.tc-handle:focus-visible { outline: 3px solid var(--tc-purple); outline-offset: 2px; }

/* ------------------------------------------------------------------- draft */

.tc-draft__input {
	width: 100%;
	height: 100%;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 1em;
	overflow-wrap: anywhere;
	word-break: break-word;
	resize: none;
	outline: none;
}

.tc-draft__actions {
	position: absolute;
	left: 0;
	top: -76px;
	z-index: 40;
	display: flex;
	background: rgba(255, 255, 255, 0.96);
	padding: 4px 0;
	white-space: nowrap;
}
.tc-draft__actions[hidden] { display: none !important; }
.tc-draft--toolbar-below .tc-draft__actions { top: auto; bottom: -78px; }
.tc-draft--toolbar-below > .tc-handle--rotate { bottom: -120px; }

.tc-chip {
	appearance: none;
	border: 0;
	border-radius: 4px;
	background: var(--tc-ink);
	color: #fff;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 5px 9px;
	cursor: pointer;
}

.tc-chip--primary { background: var(--tc-purple); animation: tc-cta 1.2s ease-in-out infinite; }
.tc-chip--danger { background: #b31b4c; }

@keyframes tc-cta {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.06); }
}

/* ------------------------------------------------------------------ notice */

.tc-notice {
	position: absolute;
	left: 10px;
	right: 10px;
	top: 10px;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	background: var(--tc-purple);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	padding: 6px 10px;
	border-radius: 4px;
}

.tc-notice__close {
	appearance: none;
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 1rem;
	cursor: pointer;
}

/* -------------------------------------------------------------- thumbnails */

.tc-thumbs {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding: 18px 2px 6px;
	width: 100%;
	max-width: var(--tc-stage-max-width, 620px);
	scrollbar-width: thin;
}

.tc-thumb {
	appearance: none;
	border: 2px solid var(--tc-line);
	background: var(--tc-paper);
	border-radius: 6px;
	padding: 4px;
	flex: 0 0 auto;
	width: 66px;
	cursor: pointer;
}

.tc-thumb.is-current { border-color: var(--tc-purple); box-shadow: 0 0 0 3px rgba(128, 107, 246, 0.3); }

.tc-thumb img,
.tc-thumb__page {
	display: block;
	position: relative;
	width: 100%;
	aspect-ratio: 210 / 297;
	object-fit: cover;
	background:
		repeating-linear-gradient(to bottom, transparent 0, transparent 5px, var(--tc-line) 5px, var(--tc-line) 6px),
		var(--tc-cream);
	overflow: hidden;
}

.tc-thumb__page--image { background: var(--tc-cream); }
.tc-thumb__page--image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.tc-thumb__note {
	position: absolute;
	font-size: 3px;
	line-height: 1.1;
	overflow: hidden;
}

.tc-thumb__blank {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	font-size: 6px;
	opacity: 0.5;
}

.tc-thumb__label { display: block; font-size: 9px; text-transform: uppercase; font-weight: 700; margin-top: 3px; }

/* -------------------------------------------------------------- composer */

.tc-composer {
	background: var(--tc-cream);
	border-radius: 12px;
	padding: 18px;
	display: grid;
	gap: 12px;
}

.tc-composer__head { display: flex; align-items: center; gap: 10px; }
.tc-composer__head h2 { font-family: var(--tc-display); font-size: 1.15rem; margin: 0; }
.tc-hint { font-size: 0.82rem; opacity: 0.8; margin: 0; }

.tc-field input,
.tc-field select {
	width: 100%;
	padding: 10px 12px;
	border: 2px solid var(--tc-line);
	border-radius: 8px;
	font-family: var(--tc-body);
	font-size: 16px;
	line-height: 1.25;
	background: var(--tc-paper);
}

.tc-field__label { display: block; margin: 0 0 5px; font-size: 0.82rem; font-weight: 700; line-height: 1.2; }
.tc-custom-question { margin: 0; }
.tc-custom-question legend { padding: 0; margin: 0 0 6px; font-size: 0.82rem; font-weight: 700; line-height: 1.2; }
.tc-custom-question__choices { display: grid; gap: 6px; }
.tc-custom-question__choices label, .tc-custom-question--checkbox { display: flex; align-items: flex-start; gap: 8px; font-size: 0.9rem; line-height: 1.3; }
.tc-custom-question input[type="radio"], .tc-custom-question input[type="checkbox"] { width: 18px; height: 18px; margin: 1px 0 0; flex: 0 0 auto; }
.tc-note__field { font-size: .62em; line-height: 1.2; margin-top: .2em !important; opacity: .82; }
.tc-swatches { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tc-swatches legend { font-size: 0.75rem; text-transform: uppercase; font-weight: 800; letter-spacing: 0.05em; }
.tc-swatch { width: 28px; height: 28px; border-radius: 999px; border: 2px solid transparent; cursor: pointer; }
.tc-swatch[aria-pressed="true"] { border-color: var(--tc-ink); transform: scale(1.1); }

.tc-btn {
	appearance: none;
	border: 0;
	border-radius: 999px;
	font-family: var(--tc-display);
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 12px 18px;
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
	text-align: center;
}

.tc-btn--primary { background: var(--tc-purple); color: #fff; }
.tc-btn--ghost { background: rgba(12, 13, 115, 0.1); color: var(--tc-ink); font-size: 0.72rem; padding: 7px 14px; }

.tc-composer.is-nudged .tc-btn--primary { animation: tc-cta 1.2s ease-in-out infinite; }
.tc-error { color: #b31b4c; font-size: 0.82rem; font-weight: 600; margin: 0; min-height: 1em; }

/* ---------------------------------------------------------------- modals */

.tc-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: grid;
	place-items: center;
	padding: 20px;
	background: rgba(12, 13, 115, 0.82);
}

.tc-modal[hidden] { display: none; }

.tc-modal__panel {
	position: relative;
	background: var(--tc-paper);
	border-radius: 14px;
	padding: 28px 24px;
	max-width: 620px;
	width: 100%;
	max-height: 88vh;
	overflow: auto;
	text-align: center;
}

.tc-modal__panel h2 { font-family: var(--tc-display); margin-top: 0; }
.tc-modal__panel ol { text-align: left; }

.tc-modal__close {
	position: absolute;
	top: 10px;
	right: 12px;
	appearance: none;
	border: 0;
	background: transparent;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	color: var(--tc-ink);
}

.tc-modal__art { width: 120px; height: 120px; object-fit: cover; border-radius: 999px; margin: 0 auto 12px; display: block; }

.tc-success-panel {
	max-width: 460px;
	padding: 42px 32px 34px;
}

.tc-success-panel p {
	margin: 0 auto 22px;
	max-width: 30rem;
	font-size: 1rem;
	line-height: 1.5;
}

.tc-success-heart {
	display: grid;
	place-items: center;
	width: 72px;
	height: 72px;
	margin: 0 auto 16px;
	border-radius: 999px;
	background: rgba(128, 107, 246, 0.12);
	color: var(--tc-purple);
	font-size: 2rem;
	line-height: 1;
	animation: tc-heartbeat 1.4s ease-in-out 2;
}

@keyframes tc-heartbeat {
	0%, 100% { transform: scale(1); }
	15% { transform: scale(1.18); }
	30% { transform: scale(1); }
	45% { transform: scale(1.14); }
	60% { transform: scale(1); }
}

.tc-heartbeat { animation: tc-heartbeat 1.4s ease-in-out infinite; transform-origin: center; }

@media (prefers-reduced-motion: reduce) {
	.tc-heartbeat,
	.tc-chip--primary,
	.tc-turn--next,
	.tc-turn--prev { animation: none !important; }
}

/* ---------- Organiser admin panel ---------- */
.tc-org { max-width: 44rem; margin: 2rem auto; padding: 0 1rem; font-family: var(--tc-body); color: var(--tc-ink); }
.tc-org-head { display: flex; justify-content: space-between; align-items: center; }
.tc-org-lock { display: grid; gap: .75rem; max-width: 22rem; margin: 4rem auto; }
.tc-org-panel { background: var(--tc-paper); border-radius: 12px; padding: 1.25rem; margin: 1rem 0; box-shadow: 0 6px 20px rgba(12,13,115,.08); display: grid; gap: .6rem; }
.tc-org-panel h2 { font-family: var(--tc-display); margin: 0; }
.tc-org-cover { width: 140px; aspect-ratio: 210/297; object-fit: cover; border-radius: 6px; background: var(--tc-cream); }
.tc-org-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.tc-org-item { border-top: 1px solid var(--tc-line); padding-top: .6rem; display: grid; gap: .35rem; }
.tc-org-msg { margin: 0; white-space: pre-wrap; }
.tc-org-meta { margin: 0; font-size: 12px; opacity: .65; }
.tc-org-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tc-org-table th, .tc-org-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--tc-line); }
.tc-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.tc-status { margin: 0; font-size: 13px; }
.tc-btn--danger { background: #b3134f; color: #fff; }


/* Font picker: custom list so every font has a reliable live preview. */
.tc-font-picker { position: relative; width: 100%; }
.tc-font-picker__button {
	width: 100%;
	min-height: 46px;
	padding: 10px 42px 10px 12px;
	border: 2px solid var(--tc-line);
	border-radius: 8px;
	background: var(--tc-paper);
	color: #111;
	font-size: 16px;
	line-height: 1.25;
	text-align: left;
	cursor: pointer;
	position: relative;
}
.tc-font-picker__button::after {
	content: "⌄";
	position: absolute;
	right: 13px;
	top: 50%;
	transform: translateY(-55%);
	font-family: system-ui, sans-serif;
	font-size: 18px;
	line-height: 1;
}
.tc-font-picker__menu {
	position: absolute;
	z-index: 80;
	left: 0;
	right: 0;
	top: calc(100% + 5px);
	max-height: 280px;
	overflow-y: auto;
	padding: 5px;
	border: 2px solid var(--tc-line);
	border-radius: 8px;
	background: var(--tc-paper);
	box-shadow: 0 10px 30px rgba(12, 13, 115, .14);
}
.tc-font-picker__menu[hidden] { display: none !important; }
.tc-font-picker__option {
	display: block;
	width: 100%;
	padding: 10px 12px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #111;
	font-size: 17px;
	line-height: 1.25;
	text-align: left;
	cursor: pointer;
	white-space: nowrap;
}
.tc-font-picker__option:hover,
.tc-font-picker__option:focus-visible { background: rgba(12, 13, 115, .07); outline: none; }
.tc-font-picker__option[aria-selected="true"] { background: rgba(128, 107, 246, .12); }
