/**
 * Попап оплаты Subs — вёрстка по макетам Платежка (Несколько / Только 1 / нет платежек).
 */
@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@400;600;700&family=Onest:wght@400;500;600&display=swap');

.subs-pay-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
	font-family: 'Onest', 'Segoe UI', Helvetica, Arial, sans-serif;
	color: #2d333c;
	/* Затемнение на слое оверлея — без «дыр» и без цвета темы под backdrop */
	background-color: rgba(0, 0, 0, 0.45) !important;
	isolation: isolate;
	overscroll-behavior: contain;
}

.subs-pay-overlay.is-open {
	display: flex;
}

/* Полноэкранная кнопка закрытия: темы часто красят button:hover в акцент — оставляем прозрачным */
.subs-pay-overlay .subs-pay-backdrop {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	cursor: pointer;
	padding: 0;
	margin: 0;
	display: block;
	appearance: none;
	-webkit-appearance: none;
	color: transparent;
	font-size: 0;
	line-height: 0;
}

.subs-pay-overlay .subs-pay-backdrop:hover,
.subs-pay-overlay .subs-pay-backdrop:focus,
.subs-pay-overlay .subs-pay-backdrop:focus-visible,
.subs-pay-overlay .subs-pay-backdrop:active {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	outline: none !important;
}

.subs-pay-dialog {
	position: relative;
	z-index: 1;
	max-height: 92vh;
	overflow-y: auto;
	/* Прокрутка сохраняется, полоса не отображается */
	scrollbar-width: none;
	-ms-overflow-style: none;
	width: 100%;
	max-width: 680px;
	outline: none;
}

.subs-pay-dialog::-webkit-scrollbar {
	width: 0;
	height: 0;
	display: none;
}

.subs-pay-popup {
	max-width: 680px;
	width: 100%;
	background: #ffffff;
	border-radius: 24px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
	overflow: hidden;
}

.subs-pay-popup .popup-header {
	padding: 1.5rem 1.8rem;
	border-bottom: 1px solid #ededed;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.subs-pay-popup .popup-header h2 {
	font-family: 'Unbounded', sans-serif;
	font-size: 1.3rem;
	font-weight: 600;
	color: #2d333c;
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0;
}

.subs-pay-popup .subs-pay-close {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #ededed;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.1rem;
	color: #5d6d84;
	border: none;
	cursor: pointer;
	padding: 0;
	line-height: 1;
}

.subs-pay-popup .subs-pay-close:hover {
	background: #dedede;
}

.subs-pay-popup .popup-body {
	padding: 1.8rem;
}

.subs-pay-popup .plan-card {
	background: linear-gradient(135deg, #f8fafd 0%, #ffffff 100%);
	border: 1px solid #ededed;
	border-radius: 20px;
	padding: 1.2rem;
	margin-bottom: 1.8rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 1rem;
}

.subs-pay-popup .plan-info h3 {
	font-family: 'Unbounded', sans-serif;
	font-size: 1.1rem;
	margin: 0 0 0.2rem;
	color: #2d333c;
}

.subs-pay-popup .plan-info p {
	font-size: 0.8rem;
	color: #5d6d84;
	margin: 0;
}

.subs-pay-popup .plan-price-block {
	text-align: right;
}

.subs-pay-popup .plan-current-price {
	font-size: 1.6rem;
	font-weight: 700;
	color: #2d333c;
	display: inline;
}

.subs-pay-popup .plan-period {
	font-size: 0.8rem;
	color: #5d6d84;
	display: block;
	margin-top: 0.15rem;
}

.subs-pay-popup .form-row-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
	margin-bottom: 1rem;
}

.subs-pay-popup .form-group {
	margin-bottom: 1rem;
}

.subs-pay-popup .form-label {
	display: block;
	font-weight: 500;
	margin-bottom: 0.4rem;
	color: #606a77;
	font-size: 0.8rem;
}

.subs-pay-popup .form-label i {
	margin-right: 0.3rem;
}

.subs-pay-popup .form-control {
	width: 100%;
	padding: 0.8rem 1rem;
	border: 1px solid #dedede;
	border-radius: 14px;
	font-family: 'Onest', sans-serif;
	font-size: 0.9rem;
	background: #ffffff;
	box-sizing: border-box;
}

.subs-pay-popup .form-control:focus {
	outline: none;
	border-color: #5d6d84;
	box-shadow: 0 0 0 3px rgba(93, 109, 132, 0.1);
}

.subs-pay-popup .subs-pay-logged-note {
	font-size: 0.85rem;
	color: #5d6d84;
	margin-bottom: 1rem;
	padding: 0.75rem 1rem;
	background: #f8fafd;
	border-radius: 12px;
	border: 1px solid #ededed;
}

.subs-pay-popup .promo-toggle {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.8rem;
	color: #5d6d84;
	margin: 1rem 0 0.8rem;
}

.subs-pay-popup .promo-input-group {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 1rem;
	flex-wrap: wrap;
}

.subs-pay-popup .promo-input-group input {
	flex: 1;
	min-width: 120px;
	padding: 0.7rem 1rem;
	border: 1px solid #dedede;
	border-radius: 12px;
	font-family: 'Onest', sans-serif;
	font-size: 0.9rem;
}

.subs-pay-popup .promo-input-group button {
	padding: 0.7rem 1.2rem;
	background: #ededed;
	border: none;
	border-radius: 12px;
	cursor: pointer;
	font-family: 'Onest', sans-serif;
	font-weight: 500;
	font-size: 0.85rem;
	color: #2d333c;
}

.subs-pay-popup .promo-input-group button:hover {
	background: #dedede;
}

.subs-pay-popup .methods-section {
	margin: 1.2rem 0;
}

.subs-pay-popup .methods-title {
	font-weight: 500;
	font-size: 0.8rem;
	color: #606a77;
	margin-bottom: 0.8rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.subs-pay-popup .methods-scroll {
	overflow-x: auto;
	white-space: nowrap;
	scrollbar-width: thin;
	padding-bottom: 0.5rem;
}

.subs-pay-popup .methods-scroll::-webkit-scrollbar {
	height: 4px;
}

.subs-pay-popup .methods-scroll::-webkit-scrollbar-track {
	background: #ededed;
	border-radius: 4px;
}

.subs-pay-popup .methods-scroll::-webkit-scrollbar-thumb {
	background: #c3c3c3;
	border-radius: 4px;
}

.subs-pay-popup .methods-list {
	display: inline-flex;
	gap: 0.8rem;
	padding: 0.2rem 0;
}

.subs-pay-popup .method-item {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	padding: 0.8rem 1.2rem;
	background: #f8fafd;
	border: 1.5px solid #ededed;
	border-radius: 14px;
	min-width: 85px;
	cursor: pointer;
	font: inherit;
	color: inherit;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.subs-pay-popup .method-item:hover {
	border-color: #c3c3c3;
}

.subs-pay-popup .method-item.active {
	border-color: #606a77;
	background: #ffffff;
}

.subs-pay-popup .method-item i {
	font-size: 1.5rem;
	color: #5d6d84;
}

.subs-pay-popup .method-name {
	font-size: 0.7rem;
	font-weight: 500;
	white-space: normal;
	text-align: center;
	line-height: 1.2;
}

.subs-pay-popup .single-method {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1rem;
	background: #f8fafd;
	border: 1px solid #ededed;
	border-radius: 14px;
}

.subs-pay-popup .single-method i {
	font-size: 1.8rem;
	color: #5d6d84;
	flex-shrink: 0;
}

.subs-pay-popup .single-method .method-name-main {
	font-weight: 500;
	font-size: 0.9rem;
	color: #2d333c;
}

.subs-pay-popup .single-method .method-badge {
	margin-left: auto;
	font-size: 0.7rem;
	color: #4caf50;
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.subs-pay-popup .no-methods-message {
	background: #fff3cd;
	border-radius: 14px;
	padding: 1rem;
	text-align: center;
	font-size: 0.85rem;
	color: #856404;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	margin: 1rem 0;
	flex-wrap: wrap;
}

.subs-pay-popup .no-methods-message i {
	font-size: 1.2rem;
	flex-shrink: 0;
}

.subs-pay-popup .total-section {
	background: #f8fafd;
	border-radius: 16px;
	padding: 1rem 1.2rem;
	margin: 1rem 0 1.5rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.subs-pay-popup .total-label {
	font-weight: 500;
	color: #606a77;
}

.subs-pay-popup .total-amount {
	font-family: 'Unbounded', sans-serif;
	font-size: 1.5rem;
	font-weight: 700;
	color: #2d333c;
}

.subs-pay-popup .btn-pay {
	width: 100%;
	padding: 1rem;
	background: #606a77;
	color: #ffffff;
	border: none;
	border-radius: 14px;
	font-family: 'Unbounded', sans-serif;
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	line-height: 1.3;
}

.subs-pay-popup .btn-pay:hover:not(:disabled) {
	background: #4a525c;
}

.subs-pay-popup .btn-pay:disabled {
	background: #c3c3c3;
	cursor: not-allowed;
	color: #ffffff;
}

.subs-pay-popup .security-note {
	text-align: center;
	margin-top: 1rem;
	font-size: 0.7rem;
	color: #c3c3c3;
	display: flex;
	justify-content: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.subs-pay-popup .terms-row {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	font-size: 0.75rem;
	color: #5d6d84;
	margin: 1rem 0;
}

.subs-pay-popup .terms-row input {
	margin-top: 0.2rem;
	flex-shrink: 0;
}

.subs-pay-popup .subs-pay-terms-label {
	line-height: 1.45;
	font-weight: 400;
}

.subs-pay-popup .subs-pay-terms-label a {
	color: #2563eb;
	text-decoration: underline;
}

.subs-pay-popup .subs-pay-terms-label a:hover {
	color: #1d4ed8;
}

.subs-pay-popup .subs-pay-msg {
	padding: 0.75rem;
	border-radius: 10px;
	font-size: 0.85rem;
	margin-bottom: 1rem;
}

.subs-pay-popup .subs-pay-msg.error {
	background: #ffebee;
	color: #c62828;
}

.subs-pay-popup .subs-pay-msg.success {
	background: #d4edda;
	color: #155724;
}

@media (max-width: 560px) {
	.subs-pay-popup .form-row-2 {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.subs-pay-popup .popup-body {
		padding: 1.2rem;
	}
}
