/*
 * Страница «Контакты» (page-contacts.php). Подключается только на ней.
 * Цвета и шрифты — как на странице ЦОК: фон #131313, карточки #1c1c1c, акцент #f7bf50, Nekst / Onest.
 */

.cfc {
	--cfc-bg: #131313;
	--cfc-card: #1c1c1c;
	--cfc-card-2: #222;
	--cfc-line: #2b2b2b;
	--cfc-line-2: #3a3a3a;
	--cfc-text: #fff;
	--cfc-muted: #b8babc;
	--cfc-dim: #919191;
	--cfc-accent: #f7bf50;
	--cfc-accent-soft: rgba(247, 191, 80, 0.1);
	--cfc-red: #ff5a5f;
	--cfc-green: #5ccf8f;
	--cfc-radius: 20px;
	--cfc-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	padding-bottom: 24px;
}

.cfc .cfc-icon {
	width: 20px;
	height: 20px;
	flex: none;
}

.cfc a:focus-visible,
.cfc button:focus-visible {
	outline: 2px solid var(--cfc-accent);
	outline-offset: 3px;
}

/* ---------- Первый экран ---------- */

.cfc-hero {
	padding: 24px 0 32px;
}

.cfc-eyebrow {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 14px;
	color: var(--cfc-accent);
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.cfc-eyebrow::before {
	content: '';
	width: 24px;
	height: 1px;
	background: var(--cfc-accent);
}

.cfc-title {
	margin: 0 0 16px;
	color: var(--cfc-text);
	font-family: 'Nekst';
	font-size: 56px;
	font-weight: 600;
	line-height: 64px;
}

.cfc-lead {
	max-width: 720px;
	margin: 0 0 28px;
	color: var(--cfc-muted);
	font-size: 19px;
	line-height: 29px;
}

.cfc-quick {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
}

.cfc-quick__item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 18px;
	border: 1px solid var(--cfc-line);
	border-radius: 16px;
	background: var(--cfc-card);
	color: var(--cfc-text);
	font-family: 'Nekst';
	font-size: 16px;
	font-weight: 500;
	line-height: 22px;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
	transition: border-color 0.25s, transform 0.25s var(--cfc-ease), background 0.25s;
}

.cfc-quick__item:hover {
	border-color: rgba(247, 191, 80, 0.5);
	transform: translateY(-3px);
}

.cfc-quick__item > .cfc-icon {
	width: 42px;
	height: 42px;
	padding: 10px;
	border-radius: 12px;
	background: var(--cfc-accent);
	color: #131313;
	stroke-width: 1.8;
}

.cfc-quick__item span {
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow-wrap: anywhere;
}

.cfc-quick__item small {
	color: var(--cfc-dim);
	font-family: 'Onest';
	font-size: 12px;
	font-weight: 400;
	line-height: 16px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.cfc-quick__item--alert {
	border-color: rgba(238, 28, 37, 0.35);
	background:
		radial-gradient(100% 140% at 0% 0%, rgba(238, 28, 37, 0.14) 0%, rgba(238, 28, 37, 0) 60%),
		var(--cfc-card);
}

.cfc-quick__item--alert > .cfc-icon {
	background: rgba(238, 28, 37, 0.16);
	color: var(--cfc-red);
}

.cfc-quick__item--alert:hover {
	border-color: rgba(238, 28, 37, 0.6);
}

/* ---------- Отделы ---------- */

.cfc-section {
	padding: 24px 0;
}

.cfc-deps {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cfc-dep {
	display: flex;
	flex-direction: column;
	padding: 24px;
	border: 1px solid var(--cfc-line);
	border-radius: var(--cfc-radius);
	background: var(--cfc-card);
}

.cfc-dep__top {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	margin-bottom: 18px;
}

.cfc-dep__icon {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: var(--cfc-accent-soft);
	color: var(--cfc-accent);
}

.cfc-dep__title {
	margin: 0 0 4px;
	color: var(--cfc-text);
	font-family: 'Nekst';
	font-size: 22px;
	font-weight: 500;
	line-height: 28px;
}

.cfc-dep__text {
	margin: 0;
	color: var(--cfc-dim);
	font-size: 14px;
	line-height: 20px;
}

.cfc-dep__rows {
	display: flex;
	flex-direction: column;
	margin: auto 0 0;
	padding: 0;
	list-style: none;
}

.cfc-dep__rows li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 0;
	border-top: 1px solid var(--cfc-line);
}

.cfc-dep__rows a {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	color: var(--cfc-text);
	font-size: 17px;
	line-height: 24px;
	text-decoration: none;
	overflow-wrap: anywhere;
	transition: color 0.2s;
}

.cfc-dep__rows a:hover {
	color: var(--cfc-accent);
}

.cfc-dep__rows a .cfc-icon {
	color: var(--cfc-accent);
}

.cfc-copy {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 10px;
	background: transparent;
	color: var(--cfc-dim);
	cursor: pointer;
	transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.cfc-copy:hover {
	border-color: var(--cfc-line-2);
	background: var(--cfc-card-2);
	color: var(--cfc-accent);
}

.cfc-copy .cfc-icon {
	width: 17px;
	height: 17px;
}

.cfc-copy.is-done {
	color: var(--cfc-green);
}

/* ---------- Офис и карта ---------- */

/* Декоративные фигуры блока заявки (blocks/application.php) заходят на блок офиса
   и перехватывали клики по кнопкам маршрута — делаем их «прозрачными» для мыши. */
.cfc .application__kr-1,
.cfc .application__kr-2,
.cfc .application__kr-3 {
	pointer-events: none;
}

.cfc-location {
	position: relative;
	z-index: 2;
}

.cfc-location__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
	gap: 16px;
	align-items: stretch;
}

.cfc-map {
	position: relative;
	min-height: 540px;
	border: 1px solid var(--cfc-line);
	border-radius: 24px;
	background:
		radial-gradient(circle at 50% 50%, rgba(247, 191, 80, 0.08) 0%, rgba(247, 191, 80, 0) 40%),
		repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 48px),
		repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 48px),
		#171717;
	overflow: hidden;
	isolation: isolate;
}

/* Без JS или пока карта не загрузилась — заглушка со ссылкой на 2ГИС. */
.cfc-map__fallback {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 24px;
	color: var(--cfc-muted);
	font-size: 16px;
	line-height: 24px;
	text-align: center;
}

.cfc-map__fallback .cfc-icon {
	width: 40px;
	height: 40px;
	color: var(--cfc-accent);
}

.cfc-map__fallback a {
	color: var(--cfc-accent);
	text-underline-offset: 4px;
}

.cfc-map.is-ready .cfc-map__fallback {
	display: none;
}

/* В теме у всех элементов max-width: 100% — внутри карты это сжимает метки до нуля. */
.cfc-map .leaflet-container *,
.cfc-map .leaflet-container *::before,
.cfc-map .leaflet-container *::after {
	max-width: none;
}

/* Тёмная гамма для тайлов OpenStreetMap. */
.cfc-map .leaflet-container {
	width: 100%;
	height: 100%;
	position: absolute;
	inset: 0;
	background: #171717;
	font-family: 'Onest';
}

.cfc-map .leaflet-tile-pane {
	filter: invert(1) hue-rotate(180deg) brightness(0.88) contrast(0.9) saturate(0.3);
}

.cfc-map .leaflet-control-zoom {
	border: 1px solid var(--cfc-line-2) !important;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.cfc-map .leaflet-control-zoom a {
	width: 38px;
	height: 38px;
	border: 0;
	background: var(--cfc-card);
	color: var(--cfc-text);
	line-height: 38px;
}

.cfc-map .leaflet-control-zoom a:hover {
	background: var(--cfc-card-2);
	color: var(--cfc-accent);
}

.cfc-map .leaflet-control-zoom-in {
	border-bottom: 1px solid var(--cfc-line-2) !important;
}

.cfc-map .leaflet-control-attribution {
	background: rgba(19, 19, 19, 0.75);
	color: var(--cfc-dim);
	font-size: 11px;
}

.cfc-map .leaflet-control-attribution a {
	color: var(--cfc-muted);
}

/* Метка офиса */
.cfc-pin {
	position: relative;
	width: 56px;
	height: 56px;
}

.cfc-pin__dot {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 22px;
	height: 22px;
	margin: -11px 0 0 -11px;
	border: 4px solid #131313;
	border-radius: 50%;
	background: var(--cfc-accent);
	box-shadow: 0 0 0 2px var(--cfc-accent), 0 0 24px rgba(247, 191, 80, 0.7);
}

.cfc-pin__pulse {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: rgba(247, 191, 80, 0.35);
	animation: cfc-pulse 2.4s var(--cfc-ease) infinite;
}

.cfc-pin__label {
	position: absolute;
	width: max-content;
	left: 50%;
	bottom: calc(100% - 6px);
	padding: 6px 12px;
	border-radius: 8px;
	background: var(--cfc-accent);
	color: #131313;
	font-family: 'Nekst';
	font-size: 13px;
	font-weight: 600;
	line-height: 16px;
	letter-spacing: 0.04em;
	white-space: nowrap;
	transform: translateX(-50%);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.cfc-pin__label::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 100%;
	margin-left: -5px;
	border: 5px solid transparent;
	border-top-color: var(--cfc-accent);
}

@keyframes cfc-pulse {
	0% { transform: scale(0.35); opacity: 0.9; }
	100% { transform: scale(1.4); opacity: 0; }
}

/* Карточка офиса */
.cfc-office {
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding: 28px;
	border: 1px solid rgba(247, 191, 80, 0.3);
	border-radius: 24px;
	background:
		radial-gradient(120% 70% at 100% 0%, rgba(247, 191, 80, 0.1) 0%, rgba(247, 191, 80, 0) 55%),
		var(--cfc-card);
}

.cfc-office__title {
	margin: 0;
	color: var(--cfc-text);
	font-family: 'Nekst';
	font-size: 26px;
	font-weight: 600;
	line-height: 32px;
}

.cfc-office__row {
	display: flex;
	gap: 14px;
	align-items: flex-start;
}

.cfc-office__icon {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: var(--cfc-accent-soft);
	color: var(--cfc-accent);
}

.cfc-office__label {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 6px;
	color: var(--cfc-dim);
	font-size: 12px;
	line-height: 16px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.cfc-office__label .cfc-icon {
	width: 16px;
	height: 16px;
	color: var(--cfc-accent);
}

.cfc-office__value {
	margin: 0;
	color: var(--cfc-text);
	font-size: 17px;
	line-height: 26px;
}

.cfc-muted {
	color: var(--cfc-dim);
	font-size: 14px;
}

.cfc-link-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	width: auto;
	height: auto;
	margin-top: 8px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--cfc-accent);
	font-family: 'Onest';
	font-size: 14px;
	line-height: 20px;
	cursor: pointer;
}

.cfc-link-btn:hover {
	border: 0;
	background: none;
	text-decoration: underline;
	text-underline-offset: 4px;
}

.cfc-routes {
	padding-top: 18px;
	border-top: 1px solid var(--cfc-line);
}

.cfc-routes__btns {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 4px;
}

.cfc-routes__btns a {
	padding: 9px 16px;
	border: 1px solid var(--cfc-line-2);
	border-radius: 50px;
	color: var(--cfc-text);
	font-size: 14px;
	line-height: 20px;
	text-decoration: none;
	transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.cfc-routes__btns a:hover {
	border-color: var(--cfc-accent);
	background: var(--cfc-accent);
	color: #131313;
}

/* Сообщение «Скопировано» */
.cfc-toast {
	position: fixed;
	left: 50%;
	bottom: 28px;
	z-index: 1000;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 18px;
	border: 1px solid rgba(92, 207, 143, 0.4);
	border-radius: 12px;
	background: #1c1c1c;
	color: var(--cfc-text);
	font-size: 15px;
	line-height: 20px;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
	transform: translateX(-50%);
}

.cfc-toast .cfc-icon {
	color: var(--cfc-green);
}

.cfc-toast[hidden] {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.cfc *,
	.cfc *::before,
	.cfc *::after {
		animation: none !important;
		transition: none !important;
	}
}

/* ---------- Адаптив ---------- */

@media only screen and (max-width: 1199px) {
	.cfc-title {
		font-size: 44px;
		line-height: 52px;
	}

	.cfc-quick {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cfc-deps {
		grid-template-columns: minmax(0, 1fr);
	}

	.cfc-location__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.cfc-map {
		min-height: 440px;
	}
}

@media only screen and (max-width: 767px) {
	.cfc-hero {
		padding: 16px 0 20px;
	}

	.cfc-title {
		font-size: 34px;
		line-height: 40px;
	}

	.cfc-lead {
		font-size: 16px;
		line-height: 26px;
		margin-bottom: 20px;
	}

	.cfc-quick {
		grid-template-columns: minmax(0, 1fr);
		gap: 8px;
	}

	.cfc-quick__item {
		padding: 12px 14px;
		font-size: 15px;
	}

	.cfc-quick__item:hover {
		transform: none;
	}

	.cfc-section {
		padding: 16px 0;
	}

	.cfc-dep,
	.cfc-office {
		padding: 20px;
	}

	.cfc-dep__rows a {
		font-size: 16px;
	}

	.cfc-map {
		min-height: 360px;
		border-radius: 18px;
	}

	.cfc-office__title {
		font-size: 22px;
		line-height: 28px;
	}
}
