/* =========================================================
 * Отзывы пользователей на странице обзора кредита (#co-reviews).
 * =======================================================*/

.co-reviews {
	--rv-dark: #101621;
	--rv-muted: #8a93a2;
	--rv-gold: #f5b301;
	--rv-green: #2f9e5f;
	--rv-track: #e8edf1;
	--rv-card-border: #e9edf2;
	--rv-btn-dark: #0f2e22;
	--rv-pill-active: #1a7a4f;
	position: relative;
	margin-top: 36px;
	padding-top: 28px;
	border-top: 1px solid #ebeff4;
}

/* ---- Шапка ---- */
.co-reviews-header {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin-bottom: 18px;
}

.co-reviews-title {
	font-size: 28px;
	font-weight: 800;
	color: var(--rv-dark);
	margin: 0;
	line-height: 1.15;
}

.co-reviews-total {
	font-size: 15px;
	font-weight: 600;
	color: var(--rv-muted);
}

/* ---- Звёзды (вывод) ---- */
.wf-review-stars {
	display: inline-flex;
	line-height: 1;
	font-size: 15px;
	letter-spacing: 2px;
}

.wf-review-stars--lg {
	font-size: 18px;
}

.wf-star {
	display: inline-block;
	line-height: 1;
}

.wf-star::before,
.wf-star-pick::before {
	content: "\2605"; /* ★ */
}

.wf-star--full {
	color: var(--rv-gold);
}

.wf-star--empty {
	color: #d9dee6;
}

.wf-star--half {
	position: relative;
	color: #d9dee6;
}

.wf-star--half::after {
	content: "\2605";
	position: absolute;
	left: 0;
	top: 0;
	width: 50%;
	overflow: hidden;
	color: var(--rv-gold);
}

/* ---- Сводка: оценка + гистограмма ---- */
.co-reviews-summary {
	display: flex;
	align-items: center;
	gap: 32px;
	background: #ffffff;
	border: 1px solid var(--rv-card-border);
	border-radius: 16px;
	padding: 24px 28px;
	box-shadow: 0 1px 2px rgba(16, 22, 33, 0.04);
	margin-bottom: 18px;
}

.co-reviews-score {
	flex: 0 0 auto;
	text-align: center;
	padding-right: 32px;
	border-right: 1px solid #eef1f5;
	min-width: 130px;
}

.co-reviews-score-num {
	font-size: 52px;
	font-weight: 800;
	color: var(--rv-dark);
	line-height: 1;
	margin-bottom: 8px;
}

.co-reviews-score .wf-review-stars {
	font-size: 18px;
	margin-bottom: 8px;
}

.co-reviews-score-count {
	font-size: 13px;
	color: var(--rv-muted);
}

.co-reviews-bars {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.co-reviews-bar-row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.co-reviews-bar-label {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	color: var(--rv-muted);
	min-width: 26px;
}

.co-reviews-bar-star {
	font-size: 12px;
}

.co-reviews-bar-track {
	flex: 1 1 auto;
	height: 8px;
	background: var(--rv-track);
	border-radius: 999px;
	overflow: hidden;
}

.co-reviews-bar-fill {
	display: block;
	height: 100%;
	background: var(--rv-green);
	border-radius: 999px;
	transition: width 0.4s ease;
}

.co-reviews-bar-fill.is-empty {
	background: transparent;
}

.co-reviews-bar-count {
	flex: 0 0 auto;
	font-size: 13px;
	color: var(--rv-muted);
	min-width: 16px;
	text-align: right;
}

/* ---- Баннер быстрой оценки ---- */
.co-reviews-cta {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
	background: #e7f4ec;
	border-radius: 14px;
	padding: 18px 24px;
	margin-bottom: 22px;
}

.co-reviews-cta-text {
	flex: 1 1 220px;
	min-width: 0;
}

.co-reviews-cta-title {
	font-size: 17px;
	font-weight: 700;
	color: var(--rv-dark);
	margin-bottom: 2px;
}

.co-reviews-cta-sub {
	font-size: 13px;
	color: #4b6d5b;
}

.co-reviews-cta-stars {
	display: inline-flex;
	gap: 6px;
}

.co-reviews-cta-star {
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	font-size: 30px;
	line-height: 1;
	color: #c4d8cb;
	transition: color 0.12s ease, transform 0.12s ease;
}

.co-reviews-cta-star:hover,
.co-reviews-cta-star.is-hover {
	color: var(--rv-gold);
	transform: scale(1.05);
}

.co-reviews-cta-btn {
	flex: 0 0 auto;
	background: var(--rv-btn-dark);
	color: #ffffff;
	border: none;
	border-radius: 10px;
	padding: 13px 24px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.co-reviews-cta-btn:hover {
	opacity: 0.9;
}

/* ---- Фильтры ---- */
.co-reviews-filters {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
}

.co-reviews-filters-label {
	font-size: 14px;
	color: var(--rv-muted);
	margin-right: 4px;
}

.co-reviews-filter {
	background: #ffffff;
	border: 1px solid #dfe4ea;
	border-radius: 999px;
	padding: 7px 16px;
	font-size: 14px;
	font-weight: 600;
	color: #3b4656;
	cursor: pointer;
	transition: all 0.12s ease;
}

.co-reviews-filter:hover {
	border-color: var(--rv-pill-active);
	color: var(--rv-pill-active);
}

.co-reviews-filter.is-active {
	background: var(--rv-pill-active);
	border-color: var(--rv-pill-active);
	color: #ffffff;
}

/* ---- Список отзывов ---- */
.co-reviews-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.co-review {
	display: flex;
	gap: 16px;
	background: #ffffff;
	border: 1px solid var(--rv-card-border);
	border-radius: 14px;
	padding: 18px 20px;
	box-shadow: 0 1px 2px rgba(16, 22, 33, 0.04);
}

.co-review--own {
	border-color: #bfe3cd;
	background: #f6fbf8;
}

.co-review-avatar {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	font-size: 18px;
	font-weight: 700;
	text-transform: uppercase;
}

.co-review-body {
	flex: 1 1 auto;
	min-width: 0;
}

.co-review-top {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 10px;
	margin-bottom: 6px;
}

.co-review-name {
	font-weight: 700;
	color: var(--rv-dark);
	font-size: 15px;
}

.co-review-date {
	margin-left: auto;
	font-size: 13px;
	color: #aab2bf;
	white-space: nowrap;
}

.co-review-text {
	font-size: 15px;
	line-height: 1.6;
	color: #3b4656;
}

.co-review-empty {
	font-size: 14px;
	font-style: italic;
	color: #aab2bf;
}

/* ---- Модалка ---- */
body.co-review-modal-open {
	overflow: hidden;
}

.co-review-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

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

.co-review-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(16, 30, 24, 0.55);
	backdrop-filter: blur(2px);
}

.co-review-modal-dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 520px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	background: #ffffff;
	border-radius: 20px;
	padding: 28px 28px 30px;
	box-shadow: 0 24px 60px rgba(16, 22, 33, 0.28);
}

.co-review-modal-x {
	position: absolute;
	top: 18px;
	right: 18px;
	width: 34px;
	height: 34px;
	border: none;
	border-radius: 50%;
	background: #f1f4f8;
	color: #5b6472;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.12s ease;
}

.co-review-modal-x:hover {
	background: #e5e9ef;
}

.co-review-modal-title {
	font-size: 24px;
	font-weight: 800;
	color: var(--rv-dark);
	margin: 0 0 4px;
	padding-right: 40px;
}

.co-review-modal-sub {
	font-size: 14px;
	color: var(--rv-muted);
	margin: 0 0 22px;
}

.co-review-field {
	margin-bottom: 18px;
}

.co-review-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: #2f3642;
	margin-bottom: 8px;
}

.co-review-req {
	color: #da3b3b;
}

.co-review-form input[type="text"],
.co-review-form input[type="email"],
.co-review-form textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #dbe1e9;
	border-radius: 10px;
	padding: 12px 14px;
	font-size: 15px;
	color: var(--rv-dark);
	background: #f7f9fb;
	font-family: inherit;
}

.co-review-form input::placeholder,
.co-review-form textarea::placeholder {
	color: #aab2bf;
}

.co-review-form input[type="text"]:focus,
.co-review-form input[type="email"]:focus,
.co-review-form textarea:focus {
	outline: none;
	border-color: #00b35c;
	background: #ffffff;
	box-shadow: 0 0 0 3px rgba(0, 179, 92, 0.12);
}

.co-review-form textarea {
	resize: vertical;
	min-height: 96px;
}

.co-review-note {
	display: block;
	margin-top: 8px;
	font-size: 13px;
	color: var(--rv-muted);
}

/* honeypot */
.co-review-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---- Ввод звёзд в модалке ---- */
.co-modal-stars {
	display: inline-flex;
	flex-direction: row-reverse;
	justify-content: flex-end;
	gap: 6px;
}

.co-modal-stars input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.co-modal-stars label {
	cursor: pointer;
	font-size: 34px;
	line-height: 1;
	color: #d9dee6;
	transition: color 0.1s ease;
}

.co-modal-stars label .wf-star-pick::before {
	content: "\2605";
}

.co-modal-stars input[type="radio"]:checked ~ label,
.co-modal-stars label.is-hover {
	color: var(--rv-gold);
}

.co-modal-stars input[type="radio"]:focus-visible + label {
	outline: 2px solid #00b35c;
	outline-offset: 2px;
	border-radius: 4px;
}

/* ---- Кнопка отправки ---- */
.co-review-submit {
	width: 100%;
	background: var(--rv-btn-dark);
	color: #ffffff;
	border: none;
	border-radius: 12px;
	padding: 15px;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.co-review-submit:hover:not(:disabled) {
	opacity: 0.92;
}

.co-review-submit:disabled {
	background: #c8ccd3;
	cursor: not-allowed;
}

.co-review-form-msg {
	display: block;
	margin-top: 10px;
	font-size: 14px;
	text-align: center;
}

.co-review-form-msg--error {
	color: #da3b3b;
}

.co-review-form-msg--pending {
	color: var(--rv-muted);
}

/* ---- Тост ---- */
.co-review-toast {
	position: fixed;
	left: 50%;
	bottom: 28px;
	transform: translate(-50%, 20px);
	background: var(--rv-btn-dark);
	color: #ffffff;
	padding: 14px 22px;
	border-radius: 12px;
	font-size: 15px;
	font-weight: 600;
	max-width: 90vw;
	box-shadow: 0 12px 32px rgba(16, 22, 33, 0.25);
	opacity: 0;
	transition: opacity 0.35s ease, transform 0.35s ease;
	z-index: 100000;
}

.co-review-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* ---- Адаптив ---- */
@media (max-width: 700px) {
	.co-reviews-title {
		font-size: 23px;
	}

	.co-reviews-summary {
		flex-direction: column;
		align-items: stretch;
		gap: 20px;
		padding: 20px;
	}

	.co-reviews-score {
		padding-right: 0;
		padding-bottom: 18px;
		border-right: none;
		border-bottom: 1px solid #eef1f5;
	}

	.co-reviews-cta {
		flex-direction: column;
		align-items: stretch;
		gap: 16px;
		text-align: center;
	}

	.co-reviews-cta-text {
		flex: 0 0 auto;
	}

	.co-reviews-cta-stars {
		justify-content: center;
	}

	.co-reviews-cta-star {
		font-size: 34px;
	}

	.co-reviews-cta-btn {
		width: 100%;
	}

	/* Фильтры — одной прокручиваемой строкой, без переноса под кнопку «вверх» */
	.co-reviews-filters {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.co-reviews-filters::-webkit-scrollbar {
		display: none;
	}

	.co-reviews-filters-label,
	.co-reviews-filter {
		flex: 0 0 auto;
	}

	.co-review-modal-dialog {
		padding: 24px 20px 26px;
	}
}
