#modalJoinGroup {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	z-index: 9999;
	align-items: center;
	justify-content: center;
	padding: 16px;
	overflow: hidden;
}

#modalJoinGroup.active {
	display: flex;
}

#modalJoinGroup input,
#modalJoinGroup select,
#modalJoinGroup textarea {
	margin-bottom: 0;
}

.join-group__select:focus {
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6L8 10L12 6' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.join-group__select option {
	color: #0F172A;
}

.join-group__select option[value=""] {
	color: #6B7280;
}

.join-group__wrap {
	position: relative;
	max-width: 512px;
	width: 100%;
	min-height: 0;
	/* vh — fallback; dvh последним: на телефоне 100vh больше видимой области → нет overflow/скролла */
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	margin: 0 auto;
	background: #fff;
	border-radius: 16px;
	padding: 32px;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

.join-group__field--error .join-group__input,
.join-group__field--error .join-group__select {
	border-color: #FFF2F5;
	background-color: #FFF2F5;
	box-shadow: none;
}

.join-group__field--error .join-group__input:focus,
.join-group__field--error .join-group__select:focus {
	border-color: #FFF2F5;
	background-color: #FFF2F5;
	box-shadow: none;
}

.join-group__field-error {
	color: #E83838;
	font-family: Inter;
	font-size: 13px;
	line-height: 20px;
	margin: 0;
	font-weight: 400;
}

.join-group__accept--error .join-group__checkbox {
	border-color: #F59E0B;
	background: #FEF3C7;
}

.join-group__accept-message {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	background: #FFFBEB;
	border: 1px solid #FCD34D;
	border-radius: 8px;
	margin-top: 32px;
	font-size: 14px;
	line-height: 1.4;
	color: #92400E;
	margin-bottom: 16px;
}

.join-group__accept-message+.join-group__accept.join-group__accept--error {
	margin: 0;
}

.join-group__accept-message-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	min-width: 24px;
	background: #F59E0B;
	color: #fff;
	border-radius: 4px;
	font-weight: 700;
	font-size: 16px;
}

.join-group__wrap .join-group__input.wrong,
.join-group__wrap .join-group__select.wrong {
	box-shadow: none;
	animation: none;
}

.join-group__wrap--sent .join-group__success {
	display: block;
}

.join-group__title {
	color: #111827;
	font-family: Inter;
	font-size: 32px;
	font-style: normal;
	font-weight: 500;
	line-height: 40px;
	margin-bottom: 16px;
}

.join-group__description {
	color: #111827;
	font-family: Inter;
	font-size: 15px;
	font-style: normal;
	font-weight: 400;
	line-height: 22px;
	max-width: 412px;
	margin-bottom: 32px;
}

.join-group__form {
	display: block;
	width: 100%;
}

.join-group__fields {
	display: flex;
	flex-direction: column;
}

.join-group__field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	position: relative;
}

.join-group__field .join-group__input,
.join-group__field .join-group__select {
	width: 100%;
	height: 52px;
	padding: 14px 20px 14px 16px;
	border-radius: 10px;
	font-size: 18px;
	line-height: 24px;
	color: #9299A5;
	background: #F0F2F5;
	transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
	appearance: none;
	border: none;
	font-family: Inter;
	font-weight: 400;
	color: #111827;
	border: 2px solid #F0F2F5;
}

.join-group__select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	padding-right: 44px;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6L8 10L12 6' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 16px 16px;
}

.join-group__input:hover,
.join-group__select:hover {
	background-color: #E5E8ED;
	border: 2px solid #E5E8ED;
}

.join-group__field .join-group__input:focus,
.join-group__field .join-group__select:focus {
	border: 2px solid #0B314E;
	background-color: #FFF;
	outline: none;
	color: #111827;
	background-image: none;
}

.join-group__input::placeholder,
.join-group__select::placeholder {
	color: #94A3B8;
}

.join-group__field--phone .iti {
	width: 100%;
	display: block;
	position: relative;
}

.join-group__field--phone .iti__flag-container {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	padding: 0;
	z-index: 1;
}

.join-group__field--phone .iti__selected-flag {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 12px 0 16px;
	height: 100%;
	background-color: transparent;
	border: none;
	cursor: pointer;
	transition: background-color 0.2s;
}

.join-group__field--phone .iti__selected-flag:hover,
.join-group__field--phone .iti__selected-flag:focus {
	background-color: rgba(0, 0, 0, 0.02);
}

.join-group__field--phone .iti__arrow {
	margin-left: 6px;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid #64748B;
	display: inline-block;
	vertical-align: middle;
}

.join-group__field--phone .iti__arrow--up {
	border-top: none;
	border-bottom: 5px solid #64748B;
}

.join-group__field--phone .join-group__input--phone {
	padding-left: 72px;
	width: 100%;
}

.join-group__field--phone .iti__country-list {
	background: #fff;
	border: 1px solid #E2E8F0;
	border-radius: 8px;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	max-height: 200px;
	overflow-y: auto;
	z-index: 10000;
	margin-top: 4px;
	padding: 4px 0;
}

.join-group__field--phone .iti__country-list .iti__country {
	padding: 8px 12px;
	cursor: pointer;
	transition: background-color 0.15s;
}

.join-group__field--phone .iti__country-list .iti__country:hover,
.join-group__field--phone .iti__country-list .iti__country.iti__highlight {
	background-color: #F1F5F9;
}

.join-group__field--phone .iti__country-list .iti__country.iti__active {
	background-color: #EFF6FF;
	color: #3B82F6;
}

.join-group__field--phone .iti__country-list .iti__dial-code {
	color: #64748B;
	margin-left: 8px;
}

.join-group__accept {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	margin-top: 32px;
	cursor: pointer;
}

.join-group__accept span {
	color: #5A616C;
	font-family: Inter;
	font-size: 12px;
	font-weight: 400;
	line-height: 18px;
}

.join-group__accept span a {
	color: #D3011D;
}

.join-group__accept a {
	color: #3B82F6;
	text-decoration: none;
}

.join-group__accept a:hover {
	text-decoration: underline;
}

.join-group__submit {
	width: 100%;
	height: 52px;
	padding: 14px 24px;
	background: #FFE400;
	border: none;
	border-radius: 10px;
	font-size: 18px;
	font-weight: 500;
	line-height: 24px;
	color: #0F172A;
	cursor: pointer;
	transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
	margin-top: 24px;
	font-family: Inter;
}

.join-group__submit:hover,
.join-group__submit:active {
	background-color: #F1D800;
}

.join-group__submit:disabled {
	background: #C3C7CB;
	cursor: default;
	color: #FFF;
}

.join-group__close {
	position: absolute;
	background: transparent;
	border: none;
	width: 40px;
	height: 40px;
	top: 16px;
	right: 16px;
	cursor: pointer;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	transition: background-color 0.2s;
}

.join-group__close:hover {
	background: #F1F5F9;
}

.join-group__close::after {
	content: "✕";
	font-size: 24px;
	color: #64748B;
	font-weight: 300;
	line-height: 1;
}

.join-group__field+.join-group__field {
	margin-top: 8px;
}

.join-group__success-popup {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(15, 23, 42, 0.5);
	left: 0;
	top: 0;
}

.join-group__success-popup-card {
	position: absolute;
	width: 100%;
	max-width: 512px;
	padding: 40px 32px 32px;
	background-color: #fff;
	border-radius: 20px;
	text-align: center;
	border: 1px solid #E6E8EC;
	box-shadow: 0 10px 10px -5px rgba(0, 0, 0, 0.04);
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-family: Inter;
}

.join-group__success-popup-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 32px;
	height: 32px;
	padding: 0;
	border: none;
	background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 4L12 12M12 4L4 12' stroke='%2394A3B8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center no-repeat;
	cursor: pointer;
}

.join-group__success-popup-icon {
	width: 80px;
	height: 80px;
	margin: 0 auto 40px;
	background: #E3FFF6;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.join-group__success-popup-title {
	margin: 0 0 16px;
	color: #111827;
	text-align: center;
	font-family: Inter;
	font-size: 32px;
	font-weight: 500;
	line-height: 40px;
}

.join-group__success-popup-text {
	margin-bottom: 40px;
	color: #5A616C;
	font-size: 18px;
	font-weight: 400;
	line-height: 24px;
}

.join-group__success-popup-note {
	margin: -4px auto 20px;
	max-width: 300px;
	font-size: 13px;
	line-height: 1.4;
	color: #64748B;
}

.join-group__success-popup-btn {
	width: 100%;
	height: 52px;
	border-radius: 10px;
	background-color: #FFE400;
	color: #111827;
	font-size: 18px;
	font-style: normal;
	font-weight: 500;
	line-height: 24px;
	border: none;
}

@media (max-width: 768px) {
	#modalJoinGroup {
		padding: 12px;
	}

	.join-group__wrap {
		max-width: 100%;
		max-height: calc(100vh - 24px);
		max-height: calc(100dvh - 24px);
		padding: 32px 24px 40px;
		border-radius: 12px;
	}

	.join-group__title {
		font-size: 24px;
		margin-bottom: 12px;
	}

	.join-group__description {
		font-size: 14px;
		margin-bottom: 24px;
	}

	.join-group__fields {
		gap: 12px;
	}

	.join-group__input,
	.join-group__select {
		height: 48px;
		font-size: 15px;
		padding: 12px 16px;
	}

	.join-group__field--phone .join-group__input--phone {
		padding-left: 56px;
	}

	.join-group__submit {
		height: 48px;
		font-size: 15px;
	}

	.join-group__close {
		top: 12px;
		right: 12px;
		width: 36px;
		height: 36px;
	}

	.join-group__close::after {
		font-size: 20px;
	}

	.join-group__success-icon {
		width: 64px;
		height: 64px;
		font-size: 36px;
		margin-bottom: 16px;
	}

	.join-group__success-title {
		font-size: 22px;
	}

	.join-group__success-text {
		font-size: 14px;
		margin-bottom: 24px;
	}

	.join-group__success-btn {
		height: 48px;
	}
}
