/* ------------------------------------------------------------------
   The agent of each Taallem France page: a thin bar under the title, then
   a stage where a lead agent hands a mission to four sub-agents, and the
   three options. Loaded after pays.css; every colour is one of its tokens
   or the brand gradient (blue to green), so both themes are covered.
   ------------------------------------------------------------------ */

.agent-teaser {
	border-block: 1px solid var(--line);
	background: linear-gradient(90deg, rgb(37 99 235 / 0.14), rgb(16 185 129 / 0.14));
}

.agent-teaser-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem 1rem;
	padding-block: 0.7rem;
}

.agent-teaser p {
	flex: 1 1 16rem;
	color: var(--ink);
	font-weight: 500;
}

.agent-icon {
	display: inline-grid;
	flex: none;
	place-items: center;
	width: 2.6rem;
	height: 2.6rem;
	border-radius: 50%;
	background: var(--surface-2);
	color: var(--accent);
}

.agent-icon svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.agent-teaser .agent-icon {
	width: 2.1rem;
	height: 2.1rem;
	background: linear-gradient(135deg, #3b82f6, #10b981);
	color: #fff;
}

.agent-band {
	border-top: 1px solid var(--line);
	background: linear-gradient(180deg, var(--surface-2), transparent 32rem);
}

.agent-head {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 20rem);
	gap: 1.5rem 2.5rem;
	align-items: center;
}

.agent-kicker {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-bottom: 0.75rem;
	color: var(--muted);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.agent-photo {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	border-radius: 8px;
	object-fit: cover;
}

.agent-warning {
	margin-top: 0.75rem;
	padding-left: 0.9rem;
	border-left: 3px solid var(--orange);
}

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

.agent-stage {
	margin-top: 2rem;
	padding: clamp(1.1rem, 3vw, 2rem);
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
	box-shadow: 0 18px 40px -28px rgb(3 7 18 / 0.5);
}

.agent-controls[hidden],
.agent-result[hidden],
.agent-from[hidden] {
	display: none;
}

.agent-label {
	margin-bottom: 0.6rem;
	color: var(--ink);
	font-weight: 600;
}

.agent-missions {
	margin-bottom: 0.9rem;
}

.agent-ask {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-bottom: 1.75rem;
}

.agent-ask input[type='text'] {
	flex: 1 1 16rem;
	min-width: 0;
	padding: 0.7rem 1rem;
	border: 1px solid var(--line-2);
	border-radius: 999px;
	background: var(--field);
	color: var(--ink);
	font: 500 0.98rem var(--sans);
}

.agent-ask input[type='text']:focus-visible {
	border-color: var(--fill);
	outline: 2px solid var(--fill);
	outline-offset: 1px;
}

.agent-board {
	display: grid;
	justify-items: center;
}

.agent-chief {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.9rem;
	width: min(100%, 34rem);
	padding: 0.9rem 1.2rem;
	border: 1px solid transparent;
	border-radius: 999px;
	background:
		linear-gradient(var(--surface), var(--surface)) padding-box,
		linear-gradient(90deg, #3b82f6, #10b981) border-box;
}

.agent-chief .agent-icon {
	width: 3rem;
	height: 3rem;
	background: linear-gradient(135deg, #3b82f6, #10b981);
	color: #fff;
}

.agent-chief-name {
	color: var(--ink);
	font-weight: 700;
}

.agent-chief-line {
	min-height: 1.5em;
	color: var(--body);
	font-size: 0.92rem;
}

/* The line from the lead agent down to the rail of its team. */
.agent-chief::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	width: 2px;
	height: 1.75rem;
	background: linear-gradient(#10b981, var(--line-2));
}

.agent-team {
	position: relative;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.75rem;
	width: 100%;
	margin: 1.75rem 0 0;
	padding: 1.25rem 0 0;
	list-style: none;
}

.agent-team::before {
	content: '';
	position: absolute;
	top: 0;
	right: 12.5%;
	left: 12.5%;
	height: 2px;
	background: var(--line-2);
}

.agent-worker {
	position: relative;
	display: grid;
	gap: 0.35rem;
	align-content: start;
	padding: 1rem;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--bg);
	transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.agent-worker::before {
	content: '';
	position: absolute;
	bottom: 100%;
	left: 50%;
	width: 2px;
	height: 1.25rem;
	background: var(--line-2);
}

.agent-worker-name {
	color: var(--ink);
	font-size: 1.02rem;
	font-weight: 600;
}

.agent-role {
	color: var(--muted);
	font-size: 0.85rem;
}

.agent-log {
	min-height: 4.2em;
	color: var(--ink);
	font-size: 0.9rem;
}

.agent-state {
	justify-self: start;
	padding: 0.15rem 0.6rem;
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--muted);
	font-size: 0.75rem;
	font-weight: 600;
}

.agent-worker.is-working {
	border-color: var(--fill);
	box-shadow: 0 0 0 3px rgb(37 99 235 / 0.2);
	transform: translateY(-3px);
}

.agent-worker.is-working .agent-icon {
	background: var(--fill);
	color: #fff;
	animation: agent-pulse 1.1s ease-in-out infinite;
}

.agent-worker.is-working .agent-log::after {
	content: '▍';
	margin-left: 1px;
	color: var(--fill);
	animation: agent-blink 0.8s steps(2) infinite;
}

.agent-worker.is-working .agent-state {
	background: var(--fill);
	color: #fff;
}

.agent-worker.is-done {
	border-color: var(--green-line);
}

.agent-worker.is-done .agent-icon {
	background: var(--green);
	color: var(--bg);
}

.agent-worker.is-done .agent-state {
	background: transparent;
	color: var(--green);
}

.agent-worker.is-done .agent-state::before {
	content: '✓ ';
}

.agent-chief.is-working .agent-icon {
	animation: agent-pulse 1.1s ease-in-out infinite;
}

@keyframes agent-pulse {
	50% {
		box-shadow: 0 0 0 7px rgb(37 99 235 / 0.18);
		transform: scale(1.06);
	}
}

@keyframes agent-blink {
	50% {
		opacity: 0;
	}
}

.agent-result {
	display: grid;
	gap: 0.6rem;
	justify-items: start;
	margin-top: 1.5rem;
	padding: 1.25rem 1.4rem;
	border: 1px solid var(--green-line);
	border-left: 4px solid var(--green);
	border-radius: 8px;
	background: var(--bg);
	animation: agent-rise 0.45s ease-out;
}

@keyframes agent-rise {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
}

.agent-result-kicker {
	color: var(--green);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.agent-result-title {
	color: var(--ink);
	font-family: var(--serif);
	font-size: 1.5rem;
	line-height: 1.2;
}

.agent-result-for {
	padding: 0.2rem 0.7rem;
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--ink);
	font-size: 0.9rem;
	font-weight: 600;
}

.agent-result-for[hidden] {
	display: none;
}

.agent-result-lines,
.agent-from ul {
	display: grid;
	gap: 0.35rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.agent-result-lines li {
	padding-left: 1.5rem;
	background: no-repeat left 0.35em / 1rem
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
	color: var(--body);
}

.agent-from {
	width: 100%;
	padding-top: 0.75rem;
	border-top: 1px solid var(--line);
}

.agent-from p {
	margin-bottom: 0.4rem;
	color: var(--muted);
	font-size: 0.85rem;
}

.agent-from li {
	color: var(--ink);
	font-size: 0.92rem;
}

.agent-note {
	margin-top: 1.25rem;
}

/* ---------- three options, then what to do next ---------- */

.agent-offers {
	margin-top: 2.75rem;
	scroll-margin-top: 6rem;
}

.agent-offers-title {
	margin: 2.5rem 0 1rem;
	color: var(--ink);
	font-family: var(--serif);
	font-size: clamp(1.4rem, 3vw, 1.9rem);
	font-weight: 400;
}

.agent-offers > .agent-offers-title {
	margin-top: 0;
}

.offer-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr));
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.offer,
.agent-how-step {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	align-items: flex-start;
	padding: 1.4rem;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface);
	color: var(--body);
	font-size: 0.95rem;
}

.offer .btn {
	margin-top: auto;
}

.offer-number {
	display: grid;
	place-items: center;
	width: 2.2rem;
	height: 2.2rem;
	border-radius: 50%;
	background: linear-gradient(135deg, #3b82f6, #10b981);
	color: #fff;
	font-weight: 700;
}

.offer-title {
	color: var(--ink);
	font-size: 1.15rem;
	font-weight: 600;
	line-height: 1.25;
}

.agent-cta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	margin-top: 1.5rem;
	padding: 1.1rem 1.4rem;
	border-radius: 8px;
	background: linear-gradient(90deg, rgb(37 99 235 / 0.14), rgb(16 185 129 / 0.14));
}

.agent-cta-lead {
	flex: 1 1 12rem;
	color: var(--ink);
	font-size: 1.1rem;
	font-weight: 600;
}

.agent-cta + .note {
	margin-top: 0.75rem;
}

/* ---------- the catalogue of the agents page ---------- */

.agent-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
	gap: 0.75rem;
	margin-top: 1.5rem;
}

.agent-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface);
	transition: transform 0.2s, border-color 0.2s;
}

.agent-card:hover {
	border-color: var(--fill);
	transform: translateY(-3px);
}

.agent-card img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.agent-card-body {
	display: grid;
	gap: 0.4rem;
	padding: 1.1rem;
}

.agent-card-name {
	color: var(--ink);
	font-size: 1.15rem;
	font-weight: 600;
}

.agent-card-text {
	color: var(--body);
	font-size: 0.92rem;
}

.agent-card-team {
	color: var(--muted);
	font-size: 0.8rem;
}

.agent-card-cta {
	margin-top: 0.3rem;
	color: var(--accent);
	font-size: 0.9rem;
	font-weight: 600;
}

/* ---------- the agents as tabs at the top of the agents page ---------- */

.agent-subnav {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
	margin: 0.5rem 0 2rem;
}

.agent-subnav-item {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.4rem 0.95rem 0.4rem 0.45rem;
	border: 1px solid var(--line-2);
	border-radius: 999px;
	background: var(--surface);
	color: var(--ink);
	font-size: 0.92rem;
	font-weight: 600;
	transition: border-color 0.15s, transform 0.15s;
}

.agent-subnav-item .agent-icon {
	width: 1.9rem;
	height: 1.9rem;
}

.agent-subnav-item:hover {
	border-color: var(--fill);
	transform: translateY(-2px);
}

.agent-subnav-team {
	padding-inline: 1.1rem;
	border-color: transparent;
	background: linear-gradient(90deg, #3b82f6, #10b981);
	color: #fff;
}

/* An anchor of the menu lands under the fixed header, not behind it. */
.agent-family,
.team-builder {
	scroll-margin-top: 5.5rem;
}

/* ---------- the family of agents (agents page): figures, one tab per agent ---------- */

.agent-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
	gap: 0.75rem;
	margin: 1.75rem 0 0;
}

.agent-stat {
	display: grid;
	gap: 0.2rem;
	padding: 1.1rem 1.3rem;
	border: 1px solid transparent;
	border-radius: 8px;
	background:
		linear-gradient(var(--surface), var(--surface)) padding-box,
		linear-gradient(90deg, #3b82f6, #10b981) border-box;
}

.agent-stat dd {
	margin: 0;
	background: linear-gradient(90deg, #3b82f6, #10b981);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	font-size: 2.6rem;
	font-weight: 700;
	line-height: 1;
}

.agent-stat dt {
	color: var(--body);
	font-size: 0.92rem;
}

.agent-tabs {
	margin-top: 2rem;
}

.agent-family .tab-panel + .tab-panel {
	margin-top: 2.5rem;
}

.agent-family .sub-tabs:not([hidden]) ~ .tab-panel + .tab-panel {
	margin-top: 0;
}

.agent-panel-title {
	color: var(--ink);
	font-family: var(--serif);
	font-size: clamp(1.6rem, 3.4vw, 2.2rem);
	font-weight: 400;
	line-height: 1.15;
}

.agent-head-text .section-lead {
	margin-top: 0.6rem;
}

.agent-head-text .text-link {
	display: inline-flex;
	gap: 0.3rem;
	margin-top: 0.75rem;
}

.agent-custom {
	padding: clamp(1.25rem, 3vw, 2rem);
	border: 1px solid transparent;
	border-radius: 12px;
	background:
		linear-gradient(var(--surface), var(--surface)) padding-box,
		linear-gradient(90deg, #3b82f6, #10b981) border-box;
}

.agent-custom-steps {
	display: grid;
	gap: 0.4rem;
	margin: 1rem 0 1.5rem;
	padding-left: 1.3rem;
	color: var(--body);
}

/* Tick the agents you need: the card lights up, the bar below counts the team. */
.team-builder {
	margin-top: 3rem;
}

.team-picks {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
	gap: 0.6rem;
	margin-top: 1.25rem;
}

.team-pick {
	position: relative;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 0.15rem 0.8rem;
	align-items: center;
	padding: 0.9rem 1rem;
	border: 1px solid var(--line-2);
	border-radius: 8px;
	background: var(--surface);
	cursor: pointer;
	transition: border-color 0.15s, transform 0.15s;
}

.team-pick input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.team-pick .agent-icon {
	grid-row: span 2;
}

.team-pick-name {
	color: var(--ink);
	font-weight: 600;
}

.team-pick-text {
	color: var(--muted);
	font-size: 0.82rem;
}

.team-pick:hover {
	transform: translateY(-2px);
}

.team-pick:has(input:focus-visible) {
	outline: 2px solid var(--fill);
	outline-offset: 2px;
}

.team-pick:has(input:checked) {
	border-color: transparent;
	background:
		linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
		linear-gradient(90deg, #3b82f6, #10b981) border-box;
}

.team-pick:has(input:checked) .agent-icon {
	background: linear-gradient(135deg, #3b82f6, #10b981);
	color: #fff;
}

.team-pick:has(input:checked) .team-pick-name::after {
	content: ' ✓';
	color: var(--green);
}

.team-summary {
	margin-top: 1rem;
}

@media (max-width: 900px) {
	.agent-head {
		grid-template-columns: minmax(0, 1fr);
	}

	.agent-photo {
		max-width: 26rem;
	}

	.agent-team {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		padding-top: 0;
	}

	.agent-team::before,
	.agent-worker::before {
		display: none;
	}
}

@media (max-width: 520px) {
	.agent-team {
		grid-template-columns: minmax(0, 1fr);
	}

	.agent-chief {
		border-radius: 16px;
	}

	.agent-log {
		min-height: 3em;
	}
}

@media (prefers-reduced-motion: reduce) {
	.agent-worker,
	.agent-card {
		transition: none;
	}

	.agent-worker.is-working .agent-icon,
	.agent-chief.is-working .agent-icon,
	.agent-worker.is-working .agent-log::after,
	.agent-result {
		animation: none;
	}
}

/* ---------- right to left (Arabic pages) ---------- */

html[dir='rtl'] .agent-warning {
	padding-right: 0.9rem;
	padding-left: 0;
	border-right: 3px solid var(--orange);
	border-left: 0;
}

html[dir='rtl'] .agent-worker.is-working .agent-log::after {
	margin-right: 1px;
	margin-left: 0;
}

html[dir='rtl'] .agent-result {
	border-right: 4px solid var(--green);
	border-left: 1px solid var(--green-line);
}

html[dir='rtl'] .agent-result-lines li {
	padding-right: 1.5rem;
	padding-left: 0;
	background-position: right 0.35em;
}

html[dir='rtl'] .agent-custom-steps {
	padding-right: 1.3rem;
	padding-left: 0;
}

html[dir='rtl'] :is(.agent-kicker, .agent-result-kicker) {
	text-transform: none;
}
