/* ============================================================
   INTEGRATIONS PAGE
   Page-specific styles for integration.html. Reuses the shared
   .orbit component (components.css) + .title/.button, and mirrors
   the .section-agent-hero two-column layout language.
   Order: section -> left column -> right (orbit) -> @media.
   ============================================================ */

/* ============ HERO ============ */
/* Dark two-column stage: pitch + stats on the left, orbit on the right. */
.section-int-hero {
	position: relative;
	background: var(--bg-reverse);
	overflow: hidden;
	padding: 64px 0;
}

/* Plain black stage here: drop the shared grid backdrop's pattern + fade mask */
.section-int-hero .hero__grid {
	background-image: none;
	background-size: auto;
	-webkit-mask-image: none;
	mask-image: none;
}

.int-hero__inner {
	position: relative; /* sits above .hero__grid + vignette */
	z-index: 1;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 40px;
	align-items: center;
}

/* ----- Left: pitch + stats ----- */
.int-hero__content {
	max-width: 650px;
}

.section-int-hero .title {
	margin-bottom: 28px;
}

.int-hero__lead {
	margin-bottom: 36px;
	font-size: 17px;
	line-height: 1.6;
	color: #c1c1c1;
}

.int-hero__cta {
	display: flex;
	align-items: center;
	gap: 28px;
	margin-bottom: 56px;
}

/* Plain white text link sitting next to the primary button */
.int-hero__textlink {
	font-size: 15px;
	font-weight: bold;
	color: var(--white);
	border-bottom: 1px solid rgba(255, 255, 255, 0.35);
	padding-bottom: 2px;
	transition: border-color 0.2s ease;
}

.int-hero__textlink:hover {
	border-bottom-color: var(--white);
}

/* Stats row — each figure counts up from 0 (.counter) */
.int-hero__stats {
	display: grid;
	grid-template-columns: repeat(3, auto);
	gap: 40px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.int-stat__figure {
	margin-bottom: 12px;
	font-size: 44px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: -1px;
	color: var(--primary);
}

.int-stat__label {
	max-width: 150px;
	font-size: 14px;
	line-height: 1.4;
	color: #a3a3a3;
}

/* ----- Right: orbit constellation ----- */
/* Absolutely placed so it can grow past the column and bleed off the right
   edge (clipped by the section's overflow: hidden). */
.int-hero__media {
	position: relative;
	min-height: 600px;
}

.orbit--int {
	--size: 700px;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-34%, -50%);
}

/* Center hub: pulsing rings behind a static KODIF core — the same treatment as
   .resolve__hub on the resolution page (styles live in style.css). The
   component's white disc + pseudo-haloes are dropped so only the hub shows. */
.orbit--int .orbit__center {
	background: none;
}

.orbit--int .orbit__center::before,
.orbit--int .orbit__center::after {
	display: none;
}

/* Pulse rings lightened so they read on the dark stage (the .resolve__hub
   original pulses dark over a white section); sized up for the large orbit. */
.orbit--int .resolve__ring {
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, 0.16);
	animation-name: int-ring-pulse;
}

/* Same pulse as .resolve-pulse but fading in from full opacity (1 -> 0) */
@keyframes int-ring-pulse {
	0% {
		transform: scale(1);
		opacity: 1;
	}
	80% {
		opacity: 0;
	}
	100% {
		transform: scale(2.8);
		opacity: 0;
	}
}

.orbit--int .resolve__core {
	width: 100%;
	height: 100%;
	background: var(--white);
	border-radius: 50%;
}

.orbit--int .resolve__core img {
	width: calc(var(--size) * 0.094);
	height: auto;
}

/* Logo chips: dark discs with a light glyph — full colour returns on hover.
   hero-logo.svg is a grey disc + dark "y"; inverting it flips to a dark disc
   with a light "y", matching the mockup's monochrome chips. */
.orbit--int .orbit__logo {
	background: #3a3a3c;
}

.orbit--int .orbit__logo img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
}

/* Outer ring sits "further away": its logos blur 4px for depth. */
.orbit--int .orbit__ring--blur .orbit__logo img {
	filter: blur(4px);
}

/* Drop the rings' translucent fill here — keep only the dashed outlines. */
.orbit--int .orbit__ring--outer,
.orbit--int .orbit__ring--mid {
	background: none;
}

/* Ambient only: rings spin continuously (no hover pause), no spoke line is
   drawn (the .orbit__lines SVG is omitted from this page's markup). */
.orbit--int .orbit__ring:has(.orbit__logo:hover),
.orbit--int .orbit__ring:has(.orbit__logo:hover) .orbit__logo {
	animation-play-state: running;
}

.orbit--int .orbit__ring:has(.orbit__logo:hover) {
	z-index: auto;
}

/* ============ LIBRARY ============ */
/* Searchable logo directory: search + filter chips, then category sections.
   Logos sit greyscale and return to full colour on hover. Cards/sections get
   a .is-hidden toggle from js/integration.js as the filter/search narrows. */
.int-library {
	background: var(--bg);
	padding: 48px 0 80px;
}

/* Sticky search + filter bar: pins to the top of the viewport (above the
   header, z-index 52) as the category sections scroll past underneath. Lean
   top padding so it stays tight when pinned; the rest of the top spacing
   lives on .int-library above. */
.int-filter-sticky {
	position: sticky;
	top: 0;
	z-index: 52;
	padding-top: 32px;
	background: var(--white);
}

/* ----- Search ----- */
.int-search {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 4px 4px 4px 20px;
	border: 1px solid #e6e6e6;
	border-radius: 16px;
}

.int-search__icon {
	flex: none;
	color: #111;
}

.int-search__input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	font-size: 17px;
	color: var(--text);
}

.int-search__input:focus {
	outline: none;
}

.int-search__input::placeholder {
	color: #9a9a9a;
}

.int-search__btn {
	flex: none;
	padding: 16px 26px;
	border: 0;
	border-radius: 12px;
	background: #f1f1f1;
	font-size: 15px;
	font-weight: 600;
	color: #111;
	cursor: pointer;
	transition: background 0.15s ease;
}

.int-search__btn:hover {
	background: #e6e6e6;
}

/* ----- Filter chips (horizontal scroll on overflow) ----- */
.int-filter {
	display: flex;
	gap: 10px;
	margin-top: 20px;
	overflow-x: auto;
	/* Hide the scrollbar while keeping horizontal scroll */
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.int-filter::-webkit-scrollbar {
	display: none;
}

.int-filter__chip {
	flex: none;
	padding: 8px 18px;
	border: 1px solid #EBEBEB;
	border-radius: 999px;
	background: var(--white);
	font-size: 16px;
	color: #a3a3a3;
	white-space: nowrap;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.int-filter__chip:hover {
	border-color: #b9b9b9;
}

/* Selected chip: solid black pill (mockup's "All" state) */
.int-filter__chip.is-active {
	border-color: var(--bg-reverse);
	background: var(--bg-reverse);
	color: var(--white);
}

/* Hairline under the filter bar — sits at the bottom of the sticky header */
.int-divider {
	height: 1px;
	margin-top: 32px;
	background: #ececec;
}

/* ----- Empty state ----- */
.int-empty {
	margin-top: 36px;
	font-size: 16px;
	color: var(--text-mute);
}

/* ----- Category sections ----- */
.int-cat {
	padding: 32px 0;
}

.int-cat:first-of-type {
	margin-top: 0;
}

/* js/integration.js hides non-matching sections + cards */
.int-cat.is-hidden,
.int-card.is-hidden {
	display: none;
}

.int-cat__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 24px;
	padding-bottom: 24px;
	border-bottom: 1px solid #ececec;
}

.int-cat__title {
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -0.5px;
	color: var(--text-title);
}

.int-cat__desc {
	margin-top: 8px;
	font-size: 16px;
	color: #7a7a7a;
}

/* Live count — orange, updated as the filter/search narrows */
.int-cat__count {
	flex: none;
	font-size: 15px;
	font-weight: 600;
	color: var(--primary);
}

/* ----- Logo grid ----- */
.int-cat__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

/* Card: logo stacked above a small caption, both centred */
.int-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 26px 20px;
	border: 1px solid #ececec;
	border-radius: 14px;
	background: var(--white);
	text-align: center;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.int-card:hover {
	border-color: #111;
}

.int-card__logo {
	width: auto;
	height: auto;
	max-width: 150px;
	max-height: 34px;
	transition: opacity 0.2s ease;
}

/* Per-logo caption (e.g. "Edit orders · refunds") */
.int-card__desc {
	font-size: 16px;
	color: #7a7a7a;
}

/* ============ BUILD IT ============ */
/* Cream two-column stage: pitch + numbered process on the left, a dark stat
   panel on the right. */
.int-build {
	background: var(--chat-bg);
	padding: 80px 0;
}

.int-build__inner {
	display: grid;
	/* Fixed-width panel on the right; content takes the rest */
	grid-template-columns: minmax(0, 1fr) 500px;
	gap: 80px;
	align-items: center;
}

/* ----- Left: pitch + steps ----- */
/* Smaller than the global .title — it lives in a half column here */
.int-build__title {
	margin-bottom: 24px;
	font-size: 56px;
}

/* Box grouping both paragraphs; copy styled via the inner <p> */
.int-build__lead p {
	font-size: 16px;
	line-height: 1.6;
	color: var(--text);
}

.int-build__lead p + p {
	margin-top: 16px;
}

/* 4-step process row */
.int-steps {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 48px;
	margin: 32px 0 0;
	padding: 24px 0 0;
	list-style: none;
	border-top: 1px solid #d9d5cb;
}

.int-step__num {
	display: block;
	margin-bottom: 12px;
	font-size: 22px;
	font-weight: 700;
	color: var(--primary);
}

.int-step__text {
	font-size: 14px;
	line-height: 1.4;
	color: #383838;
}

/* ----- Right: dark stat panel ----- */
.int-build__media {
	position: relative;
}

.int-build__panel {
	position: relative;
	overflow: hidden;
	min-height: 380px;
	padding: 48px;
	background: var(--bg-reverse);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
}

/* Faint grid backdrop scoped to the panel */
.int-build__grid {
	position: absolute;
	inset: 0;
	background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
	background-size: 36px 36px;
	pointer-events: none;
}

.int-build__stat {
	position: relative;
	display: flex;
	align-items: baseline;
	gap: 8px;
	line-height: 1;
}

.int-build__stat-num {
	font-size: 160px;
	font-weight: 700;
	letter-spacing: -4px;
	color: var(--white);
}

.int-build__stat-unit {
	font-size: 44px;
	font-weight: 700;
	color: #6b6b6b;
}

.int-build__stat-label {
	position: relative;
	margin-top: 12px;
	font-size: 15px;
	line-height: 1.5;
	color: #a3a3a3;
}

/* Dashed arrow bleeding off the right edge toward the request CTA */
.int-build__arrow {
	position: absolute;
	top: 50%;
	right: -40px;
	width: 80px;
	height: 0;
	border-top: 1px dashed var(--olive);
	transform: translateY(-50%);
}

.int-build__arrow::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 0;
	width: 8px;
	height: 8px;
	border-top: 1px solid var(--olive);
	border-right: 1px solid var(--olive);
	transform: translateY(-50%) rotate(45deg);
}

/* ============ REQUEST ============ */
/* Orange CTA: pitch on the left, request form card on the right. */
.int-request {
	background: var(--primary);
	padding: 80px 0;
}

.int-request__inner {
	display: grid;
	/* Fixed-width form on the right; content takes the rest */
	grid-template-columns: minmax(0, 1fr) 530px;
	gap: 64px;
	align-items: center;
}

/* ----- Left: pitch ----- */
/* Base stays black; the second line goes white (no global variant fits) */
.int-request__title {
	margin-bottom: 24px;
	font-size: 56px;
}

.int-request__title span {
	color: var(--white);
}

.int-request__lead {
	max-width: 560px;
	font-size: 18px;
	line-height: 1.6;
	color: #1a1a1a;
}

/* ----- Right: form card ----- */
.int-request__form {
	padding: 24px;
	background: var(--white);
}

div.int-request__form * {
	font-family: inherit !important;
}

div.int-request__form .hsfc-Step .hsfc-Step__Content {
	padding: 0;
}

div.int-request__form .hsfc-NavigationRow {
	margin: 0;
}

div.int-request__form .hsfc-Row,
.int-field {
	margin-bottom: 20px;
}

div.int-request__form .hsfc-FieldLabel,
.int-field__label {
	display: block;
	margin-bottom: 8px;
	font-size: 16px;
	font-weight: 600;
	color: #7a7a7a;
}

div.int-request__form .hsfc-TextInput,
div.int-request__form .hsfc-TextareaInput,
.int-field__input {
	width: 100%;
	padding: 18px 16px;
	border: 1px solid #e6e6e6;
	border-radius: 8px;
	background: var(--white);
	font-family: inherit;
	font-size: 15px;
	color: var(--text);
	transition: border-color 0.15s ease;
}

div.int-request__form .hsfc-ErrorAlert {
	font-size: 14px;
}

.int-field__input::placeholder {
	color: #9a9a9a;
}

.int-field__input:focus {
	outline: none;
	border-color: var(--primary);
}

.int-field__input--area {
	resize: none;
	min-height: 120px;
}

div.int-request__form .hsfc-Button {
	width: 100%;
}

/* Validation: red border on the field + message below the input */
.int-field.has-error .int-field__input {
	border-color: #d92d20;
}

.int-field__error {
	margin-top: 4px;
	font-size: 14px;
	color: #d92d20;
}

/* Full-width submit; reuses .button (orange) */
.int-request__submit {
	width: 100%;
	height: 52px;
	gap: 10px;
}

/* Loading spinner — hidden until the button enters its loading state */
.int-request__spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: var(--white);
	border-radius: 50%;
	animation: int-spin 0.6s linear infinite;
}

.int-request__submit.is-loading .int-request__spinner {
	display: inline-block;
}

.int-request__submit.is-loading {
	cursor: progress;
	opacity: 0.85;
}

@keyframes int-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ============ RESULT DIALOG ============ */
/* Centered modal over a dimmed overlay; success/error set via a modifier. */
.int-dialog {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.int-dialog[hidden] {
	display: none;
}

.int-dialog__overlay {
	position: absolute;
	inset: 0;
	background: rgba(1, 1, 1, 0.55);
}

.int-dialog__box {
	position: relative;
	width: 100%;
	max-width: 560px;
	padding: 40px 32px 32px;
	border-radius: 16px;
	background: var(--white);
	text-align: center;
}

/* Status icon: a coloured disc with a glyph set per state */
.int-dialog__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin: 0 auto 20px;
	border-radius: 50%;
	font-size: 28px;
	font-weight: 700;
	line-height: 1;
	color: var(--white);
}

.int-dialog--success .int-dialog__icon {
	background: #12b76a;
}

.int-dialog--success .int-dialog__icon::before {
	content: "✓";
}

.int-dialog--error .int-dialog__icon {
	background: #d92d20;
}

.int-dialog--error .int-dialog__icon::before {
	content: "✕";
}

.int-dialog__title {
	margin-bottom: 10px;
	font-size: 22px;
	font-weight: 700;
	color: var(--text-title);
}

.int-dialog__msg {
	margin-bottom: 28px;
	font-size: 15px;
	line-height: 1.6;
	color: var(--text-mute);
}

.int-dialog__btn {
	width: 100%;
	height: 48px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1199px) {
	.orbit--int {
		--size: 600px;
		transform: translate(-30%, -50%);
	}

	.int-hero__stats {
		gap: 28px;
	}

	/* Library: 4 -> 3 columns */
	.int-cat__grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.int-card__desc {
		font-size: 14px;
	}

	.int-cat__desc {
		font-size: 14px;
	}

	/* Build / Request: narrow the panel column + tighten gap/heading */
	.int-build__inner {
		grid-template-columns: minmax(0, 1fr) 380px;
		gap: 40px;
	}

	.int-request__inner {
		grid-template-columns: minmax(0, 1fr) 460px;
		gap: 40px;
	}

	.int-build__title,
	.int-request__title {
		font-size: 46px;
	}

	.int-build__stat-num {
		font-size: 128px;
	}

	.int-steps {
		gap: 20px;
	}

	.int-request__lead {
		font-size: 16px;
	}
}

@media (max-width: 991px) {
	/* Stack: pitch on top, orbit centred below */
	.int-hero__inner {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}

	.int-hero__content {
		max-width: none;
	}

	.int-hero__media {
		min-height: 520px;
	}

	.orbit--int {
		--size: min(560px, 86vw);
		left: 50%;
		transform: translate(-50%, -50%);
	}

	/* Library: tighten the top/bottom rhythm */
	.int-library {
		padding: 32px 0 56px;
	}

	.int-filter-sticky {
		padding-top: 16px;
	}

	.int-search__input {
		font-size: 16px;
	}

	.int-card {
		padding: 8px 16px;
	}

	.int-filter {
		margin-top: 12px;
	}

	.int-divider {
		margin-top: 16px;
	}

	.int-filter__chip {
		font-size: 14px;
	}

	/* Build / Request: stack to one column, panel/form sit below the pitch */
	.int-build,
	.int-request {
		padding: 56px 0;
	}

	.int-build__inner,
	.int-request__inner {
		grid-template-columns: minmax(0, 1fr);
		gap: 40px;
	}

	/* Stacked: panel sizes to its content (no fixed height) */
	.int-build__panel {
		min-height: auto;
	}

	/* Arrow points to the side bleed — hide once the layout stacks */
	.int-build__arrow {
		display: none;
	}

	.int-request__lead {
		max-width: none;
	}
}

@media (max-width: 767px) {
	.section-int-hero {
		padding: 44px 0;
	}

	.int-hero__cta {
		flex-wrap: wrap;
		gap: 16px 24px;
		margin-bottom: 44px;
	}

	.int-hero__stats {
		grid-template-columns: repeat(3, 1fr);
		gap: 20px;
	}

	.int-stat__figure {
		font-size: 34px;
	}

	.int-hero__media {
		min-height: 440px;
	}

	/* ----- Library ----- */
	.int-library {
		padding: 24px 0 44px;
	}

	/* Search shrinks; keep the button compact */
	.int-search {
		gap: 8px;
		padding: 4px 4px 4px 16px;
	}

	.int-search__icon {
		width: 20px;
		height: 20px;
	}

	.int-search__input {
		font-size: 15px;
	}

	.int-search__btn {
		padding: 12px 18px;
	}

	.int-filter {
		gap: 8px;
	}

	.int-filter__chip {
		padding: 7px 14px;
	}

	/* 3 -> 2 columns */
	.int-cat__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}

	.int-cat {
		padding: 16px 0;
	}

	/* Stack the section title above its count */
	.int-cat__head {
		flex-direction: column;
		gap: 8px;
		margin-bottom: 20px;
		padding-bottom: 20px;
	}

	.int-cat__title {
		font-size: 22px;
	}

	/* .int-card padding inherits 8px 16px from the 991px breakpoint */
	.int-card {
		min-height: 112px;
	}

	/* Build / Request */
	.int-build,
	.int-request {
		padding: 44px 0;
	}

	.int-build__title,
	.int-request__title {
		font-size: 38px;
	}

	.int-build__inner,
	.int-request__inner {
		gap: 20px;
	}

	/* Steps: 4 -> 2 columns */
	.int-steps {
		grid-template-columns: repeat(2, 1fr);
		gap: 16px;
		margin-top: 16px;
		padding-top: 16px;
	}

	.int-step__num {
		margin-bottom: 4px;
	}

	.int-build__panel {
		padding: 32px;
	}

	.int-build__stat-num {
		font-size: 80px;
	}

	.int-build__stat-unit {
		font-size: 34px;
	}

	.int-request__form {
		padding: 16px;
	}

	.int-field__input {
		padding: 13px 16px;
	}

	.int-field__label {
		font-size: 14px;
	}
}

@media (max-width: 539px) {
	.int-hero__stats {
		gap: 8px;
	}

	.int-stat__figure {
		font-size: 24px;
	}

	.int-stat__label {
		max-width: none;
		font-size: 12px;
	}

	.int-hero__media {
		min-height: 380px;
	}

	.orbit--int {
		--size: 92vw;
	}

	/* ----- Library ----- */
	.int-library {
		padding: 16px 0 36px;
	}

	.int-search {
		padding: 3px 3px 3px 14px;
	}

	.int-search__btn {
		padding: 10px 16px;
		font-size: 14px;
	}

	.int-cat__title {
		font-size: 20px;
	}

	.int-cat__count {
		font-size: 14px;
	}

	.int-card {
		min-height: 100px;
	}

	.int-card__logo {
		max-width: 112px;
		max-height: 30px;
	}

	/* Build / Request */
	.int-build__title,
	.int-request__title {
		font-size: 32px;
	}

	.int-build__panel {
		padding: 24px;
	}

	.int-build__stat-num {
		font-size: 84px;
	}
}
