/**
 * Калькулятор стоимости ремонта — /remont-2/. Изолированные стили,
 * не влияют на main.css. Design tokens и паттерны — UI-polish этап
 * (референсы 21st.dev, адаптированные под нативный HTML/CSS/JS, без
 * React/Radix/Framer Motion/Tailwind).
 */

.repair-calc {
	--npk-bg: #f7f6f3;
	--npk-card: #ffffff;
	--npk-text: #171717;
	--npk-muted: #767676;
	--npk-line: #e8e3da;
	--npk-gold: var(--main-color, #cfa653);
	--npk-gold-dark: #b78e3f;
	--npk-radius: 22px;
	--npk-radius-sm: 16px;
	--npk-blue: #3b6ef6;

	padding: 64px 0 72px;
	background: var(--npk-bg);
	color: var(--npk-text);
}

.repair-calc * { box-sizing: border-box; }
.repair-calc .wrapper { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ---------- Заголовок ---------- */
.repair-calc__header { max-width: 780px; margin: 0 0 44px; }
.repair-calc__title {
	font-size: clamp(28px, 3.4vw, 42px);
	font-weight: 700;
	line-height: 1.12;
	letter-spacing: -0.01em;
	margin: 0 0 14px;
	color: var(--npk-text);
}
.repair-calc__subtitle { font-size: clamp(16px, 1.6vw, 19px); color: var(--npk-muted); margin: 0 0 10px; }
.repair-calc__disclaimer { font-size: 13.5px; color: #9a9a9a; margin: 0; }

/* ---------- Сетка: 2 колонки desktop, стек mobile ---------- */
.repair-calc__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
	gap: 32px;
	align-items: start;
}
@media (max-width: 900px) {
	.repair-calc__grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- Поля настроек ---------- */
.repair-calc__field { margin-bottom: 30px; }
.repair-calc__field:last-of-type { margin-bottom: 20px; }

.npk-field-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.npk-field-head > div { display: flex; align-items: center; gap: 10px; }
.npk-step {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--npk-text);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	flex-shrink: 0;
}
.npk-field-head h3, .repair-calc__field-label {
	font-size: 16.5px;
	font-weight: 600;
	color: var(--npk-text);
	margin: 0;
}

/* --- Площадь: slider с tooltip + numeric input --- */
.npk-area-value {
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--npk-card);
	border: 1.5px solid var(--npk-line);
	border-radius: 12px;
	padding: 8px 14px;
	flex-shrink: 0;
	cursor: text;
}
.npk-area-value input {
	width: 52px;
	border: none;
	outline: none;
	font-size: 18px;
	font-weight: 700;
	color: var(--npk-text);
	text-align: right;
	background: transparent;
	-moz-appearance: textfield;
}
.npk-area-value input::-webkit-outer-spin-button,
.npk-area-value input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.npk-area-value span { color: var(--npk-muted); font-size: 15px; }

.npk-slider-wrap { position: relative; padding: 30px 0 8px; }

#repair-area-slider {
	width: 100%;
	appearance: none;
	-webkit-appearance: none;
	height: 6px;
	border-radius: 999px;
	background: linear-gradient(to right, var(--npk-gold) 0%, var(--npk-gold) var(--progress, 14%), var(--npk-line) var(--progress, 14%), var(--npk-line) 100%);
	outline: none;
	cursor: pointer;
	margin: 0;
}
#repair-area-slider::-webkit-slider-thumb {
	appearance: none;
	-webkit-appearance: none;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--npk-gold);
	border: 4px solid #fff;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
	cursor: pointer;
}
#repair-area-slider::-moz-range-thumb {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--npk-gold);
	border: 4px solid #fff;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
	cursor: pointer;
	appearance: none;
}
#repair-area-slider::-moz-range-progress { background: var(--npk-gold); height: 6px; border-radius: 999px; }
#repair-area-slider:focus-visible { outline: none; }
#repair-area-slider:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--npk-blue); outline-offset: 2px; }
#repair-area-slider:focus-visible::-moz-range-thumb { outline: 3px solid var(--npk-blue); outline-offset: 2px; }

.npk-slider-tooltip {
	position: absolute;
	top: -2px;
	transform: translateX(-50%);
	background: var(--npk-text);
	color: #fff;
	padding: 6px 10px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	pointer-events: none;
	left: var(--progress, 14%);
}
.npk-slider-tooltip::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: var(--npk-text);
}

/* --- Карточки выбора: настоящий input + визуальная оболочка --- */
.npk-choice-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.npk-choice-cards--level { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .npk-choice-cards--level { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .npk-choice-cards { grid-template-columns: 1fr; } }

.npk-choice-card { display: block; cursor: pointer; position: relative; }
.npk-choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.npk-choice-content {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-height: 64px;
	padding: 16px 18px;
	border: 1.5px solid var(--npk-line);
	border-radius: var(--npk-radius-sm);
	background: var(--npk-card);
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.npk-choice-cards--level .npk-choice-content { min-height: 96px; }
.npk-choice-card:hover .npk-choice-content { border-color: #d4c6aa; }
.npk-choice-card input:checked + .npk-choice-content {
	border-color: var(--npk-gold);
	box-shadow: 0 8px 24px rgba(183, 142, 63, .14);
	transform: translateY(-2px);
}
.npk-choice-card input:focus-visible + .npk-choice-content { outline: 3px solid var(--npk-blue); outline-offset: 2px; }
.npk-choice-content strong { font-size: 15px; font-weight: 600; color: var(--npk-text); }
.npk-choice-content small { font-size: 12.5px; color: var(--npk-muted); line-height: 1.4; }

.npk-choice-check {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--npk-gold);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transform: scale(.6);
	transition: .2s ease;
}
.npk-choice-card input:checked ~ .npk-choice-check { opacity: 1; transform: scale(1); }
.npk-choice-check svg { width: 11px; height: 9px; }

/* --- Пресеты и опции комплектации (toggle group, не WP-checkbox-лист) --- */
.repair-calc__presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.repair-preset {
	border: 1.5px solid var(--npk-line);
	background: var(--npk-card);
	border-radius: 999px;
	padding: 10px 18px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--npk-muted);
	cursor: pointer;
	transition: .15s ease;
}
.repair-preset:hover { border-color: var(--npk-gold); color: var(--npk-text); }
.repair-preset:focus-visible { outline: 3px solid var(--npk-blue); outline-offset: 2px; }
.repair-preset.active { background: var(--npk-text); border-color: var(--npk-text); color: #fff; }

.repair-calc__checks { display: flex; flex-wrap: wrap; gap: 10px; }
.repair-check {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 13.5px;
	font-weight: 500;
	color: var(--npk-text);
	user-select: none;
	background: var(--npk-card);
	border: 1.5px solid var(--npk-line);
	border-radius: 999px;
	padding: 8px 14px 8px 10px;
	transition: .15s ease;
}
.repair-check:hover { border-color: #d4c6aa; }
.repair-check input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.repair-check__box {
	width: 16px;
	height: 16px;
	border-radius: 5px;
	border: 1.5px solid var(--npk-line);
	flex-shrink: 0;
	position: relative;
	transition: .15s ease;
	background: #fff;
}
.repair-check__box::after {
	content: "";
	position: absolute;
	left: 4px;
	top: 1px;
	width: 4px;
	height: 8px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	opacity: 0;
	transition: .15s ease;
}
.repair-check.checked { border-color: var(--npk-gold); background: #fbf6ed; }
.repair-check.checked .repair-check__box { background: var(--npk-gold); border-color: var(--npk-gold); }
.repair-check.checked .repair-check__box::after { opacity: 1; }
.repair-check input:focus-visible + .repair-check__box { outline: 3px solid var(--npk-blue); outline-offset: 2px; }

.repair-calc__seo-note {
	font-size: 13.5px;
	color: var(--npk-muted);
	line-height: 1.6;
	margin: 26px 0 0;
	padding-top: 22px;
	border-top: 1px solid var(--npk-line);
}

/* ---------- Правая колонка: sticky summary ---------- */
.repair-calc__summary { position: sticky; top: 110px; }
@media (max-width: 900px) { .repair-calc__summary { position: static; } }

.npk-repair-summary {
	padding: 30px;
	border-radius: var(--npk-radius);
	background: var(--npk-text);
	color: #fff;
	box-shadow: 0 18px 50px rgba(0, 0, 0, .14);
}
.npk-summary-label {
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: rgba(255, 255, 255, .6);
}
.npk-summary-price {
	margin-top: 10px;
	font-size: clamp(38px, 4vw, 52px);
	line-height: 1;
	font-weight: 600;
	letter-spacing: -0.03em;
}
.npk-summary-price small { font-size: 0.45em; font-weight: 500; color: rgba(255, 255, 255, .7); margin-left: 4px; }
.npk-summary-range { margin-top: 10px; font-size: 13.5px; color: rgba(255, 255, 255, .6); }

.npk-summary-divider { height: 1px; background: rgba(255, 255, 255, .12); margin: 22px 0 4px; }

.npk-summary-breakdown { margin: 0; }
.npk-summary-breakdown > div {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	padding: 13px 0;
	border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.npk-summary-breakdown > div:last-child { border-bottom: none; }
.npk-summary-breakdown dt { font-size: 14px; color: rgba(255, 255, 255, .8); font-weight: 400; }
.npk-summary-breakdown dd { margin: 0; font-size: 14px; font-weight: 600; }

.npk-summary-persqm { margin-top: 14px; font-size: 12.5px; color: rgba(255, 255, 255, .5); }

.npk-primary-cta {
	width: 100%;
	min-height: 56px;
	margin-top: 26px;
	border: 0;
	border-radius: 14px;
	background: var(--npk-gold);
	color: var(--npk-text);
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: background .15s ease;
}
.npk-primary-cta:hover { background: var(--npk-gold-dark); }
.npk-primary-cta:focus-visible { outline: 3px solid var(--npk-blue); outline-offset: 2px; }

.npk-summary-note { font-size: 12px; line-height: 1.5; color: rgba(255, 255, 255, .5); margin: 14px 0 0; }

/* ---------- Форма заявки ---------- */
.repair-calc__form-wrap { margin-top: 20px; }
.repair-calc__form {
	background: var(--npk-card);
	border: 1.5px solid var(--npk-line);
	border-radius: var(--npk-radius);
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.repair-calc__form .form-input {
	min-height: 50px;
	border-radius: 12px;
	border: 1.5px solid var(--npk-line);
	padding: 0 16px;
	font-size: 15px;
	background: var(--npk-bg);
}
.repair-calc__form .form-input:focus-visible { outline: 3px solid var(--npk-blue); outline-offset: 1px; }
.repair-calc__form .form-btn { min-height: 52px; border-radius: 14px; font-weight: 700; }
.repair-calc__form .form-checkbox p { font-size: 13px; line-height: 1.5; }

@media (max-width: 480px) {
	.repair-calc { padding: 44px 0 52px; }
	.npk-repair-summary { padding: 24px 20px; }
}
