:root {
	--title-color: #1A1A1A;
	--error-color: #EF4444;

	--question-accent: #027CC2;
	--question-accent-hover: #0263A3;
	--question-accent-press: #035991;
	--question-text: #0C447C;
	--question-bg-hover: #EAF4FC;

	--pro-question-accent: #00C24A;
	--pro-question-text: #0A6B33;
	--pro-question-bg-hover: #E5F9EC;
}

/* Shared question dialog. The choice screen follows the supplied design. */
#pro-question-dialog {
	box-sizing: border-box;
	width: min(664px, calc(100% - 80px));
	max-width: none;
	max-height: 100vh;
	max-height: 100dvh;
	margin: auto;
	padding: 32px;
	border: 0;
	border-radius: 16px;
	overflow-y: auto;
	color: #1b1b1b;
	background: #fff;
	font-family: Montserrat, Arial, "Helvetica Neue", Helvetica, sans-serif;
	text-align: left;
	color-scheme: light;
	opacity: 0;

	@media (max-width: 767px) {
		padding: 24px;
	}

	@media (max-width: 600px) {
		padding: 20px;
	}
}

/* Keep panel geometry during the closing transition. */
#pro-question-dialog[aria-labelledby="pro-question-success-title"] {
	width: min(480px, 100%);
	padding: 40px 48px;
}

#pro-question-dialog[open][aria-labelledby="pro-question-rules-title"],
#pro-question-dialog[open][aria-labelledby="pro-question-form-title"] {
	display: flex;
}

#pro-question-dialog[aria-labelledby="pro-question-rules-title"] {
	flex-direction: column;
	height: fit-content;
	max-height: 70vh;
	max-height: 70dvh;
	overflow-x: hidden;
	overflow-y: auto;

	@media (max-width: 600px) {
		inset: 0;
		width: 100%;
		max-width: none;
		max-height: 100vh;
		max-height: 100dvh;
		height: 100vh;
		height: 100dvh;
		margin: 0;
		border-radius: 0;
	}
}

#pro-question-dialog[aria-labelledby="pro-question-form-title"] {
	flex-direction: column;
	height: fit-content;
	/*max-height: 70vh;*/
	/*max-height: 70dvh;*/
	overflow-x: hidden;
	overflow-y: auto;

	@media (max-width: 767px) {
		inset: 0;
		width: 100%;
		max-width: none;
		max-height: 100vh;
		max-height: 100dvh;
		height: 100vh;
		height: 100dvh;
		margin: 0;
		border-radius: 0;
	}
}

#pro-question-dialog[aria-labelledby="pro-question-loading-title"] {
	height: min(380px, 100dvh);
	
	@media (max-width: 600px) {
		margin-bottom: 0;
		border-radius: 16px 16px 0 0;
		width: 100%;
		height: min(541px, 100dvh);
	}
}

#pro-question-dialog[aria-labelledby="pro-question-choice-title"],
#pro-question-dialog[aria-labelledby="pro-question-success-title"] {
	@media (max-width: 600px) {
		margin-bottom: 0;
		border-radius: 16px 16px 0 0;
		width: 100%;
	}
}

#pro-question-dialog::backdrop {
	background: rgb(0 0 0 / 55%);
	opacity: 0;
}

/* Keep the dialog and backdrop rendered until the fade-out finishes. */
#pro-question-dialog,
#pro-question-dialog::backdrop {
	transition: opacity .2s ease-out, display .2s, overlay .2s;
	transition-behavior: allow-discrete;
}

#pro-question-dialog[open],
#pro-question-dialog[open]::backdrop {
	opacity: 1;
}

@starting-style {
	#pro-question-dialog[open],
	#pro-question-dialog[open]::backdrop {
		opacity: 0;
	}
}

body.pro-questions-open {
	overflow: hidden;
}

#pro-question-dialog [hidden] {
	display: none !important;
}

/* Close-btn */
.pro-questions-close {
	position: absolute;
	top: 32px;
	right: 32px;
	display: block;
	width: 32px;
	min-width: 0;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 4px;
	box-shadow: none;
	color: #8d8d8d;
	background: transparent;
	font-size: 31px;
	line-height: 1;
	z-index: 1;
	cursor: pointer;

	@media (max-width: 767px) {
		top: 16px;
		right: 16px;
	}
}

.pro-questions-close:hover {
	color: #1b1b1b;
}

#pro-question-dialog .pro-questions-copy {
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	margin-bottom: 16px;
}

#pro-question-dialog :is(a, button, input, textarea):focus-visible {
	border-color: var(--question-accent)!important;
	border-width: 2px;
}

#pro-question-dialog [role="alert"] {
	color: var(--error-color);
}

#pro-question-dialog[aria-busy="true"],
#pro-question-dialog[aria-busy="true"] button:disabled {
	cursor: progress;
}

#pro-question-dialog button:disabled {
	opacity: 0.6;
}

/* Buttons in popups */
.pro-questions-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 12px;
	margin-top: 16px;

	> button {
		height: 44px;
		padding-inline: 24px;
		border-radius: 5px;
		transition: all .3s ease;
	}

	button[data-pro-question-close] {
		border: 1px solid #E4E9F2;
		background-color: transparent;
		color: #0F172A;
	}

	button[data-pro-question-close]:hover {
		background-color: #F0F6FE;
	}

	button[data-pro-question-close]:active {
		background-color: #e9eef6;
	}

	button[data-pro-question-accept],
	button[data-pro-question-submit] {
		border: 1px solid var(--question-accent);
		background-color: var(--question-accent);
		color: #ffffff;
	}

	button[data-pro-question-accept]:hover,
	button[data-pro-question-submit]:hover {
		background-color: var(--question-accent-hover);
		border-color: var(--question-accent-hover);
	}

	button[data-pro-question-accept]:active,
	button[data-pro-question-submit]:active {
		background-color: var(--question-accent-press);
		border-color: var(--question-accent-press);
	}
}

/* Section[data-pro-question-panel="choice"] */
#pro-question-dialog section[data-pro-question-panel="choice"] {
	padding-top: 44px;

	@media (max-width: 767px) {
		padding-top: 40px;
	}

	#pro-question-choice-title {
		margin: 0;
		padding: 0;
		color: var(--title-color);
		font-family: inherit;
		font-size: 24px;
		font-weight: 800;
		line-height: 120%;
		text-align: center;

		@media (max-width: 767px) {
			font-size: 26px;
		}

		@media (max-width: 480px) {
			font-size: 20px;
		}
	}

	/* Subtitle */
	p[data-pro-question-text="choice_description"] {
		margin: 24px 0;
		color: #6B6B6B;
		font-size: 14px;
		line-height: 120%;
		text-align: center;

		@media (max-width: 767px) {
			margin: 20px 0 24px;
			font-size: 16px;
		}
	}

	/* Choices-cards */
	.pro-questions-choices {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 20px;
		margin: 0;
		padding: 0;

		@media (max-width: 767px) {
			grid-template-columns: minmax(0, 1fr);
			gap: 16px;
		}
	}

	.pro-questions-choices > * {
		position: relative;
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-start;
		row-gap: 14px;
		width: 100%;
		min-width: 0;
		height: auto;
		margin: 0;
		padding: 24px;
		border: 1px solid #E2E8F0;
		border-radius: 20px;
		box-shadow: none;
		background: #fff;
		font: inherit;
		letter-spacing: normal;
		text-align: left;
		text-decoration: none;
		text-transform: none;
		white-space: normal;
		cursor: pointer;
		appearance: none;
		transition: all .3s ease;

		@media (max-width: 374px) {
			padding: 20px;
		}
	}

	.pro-questions-choice__not-pro {
		color: var(--question-text);

		.pro-questions-choice__icon {
			background-color: var(--question-accent);
		}

		.pro-questions-choice__text-arr svg {
			color: var(--question-accent);
		}
	}
	.pro-questions-choice__not-pro:hover {
		background-color: var(--question-bg-hover);
		border-color: var(--question-accent);
	}

	.pro-questions-choice__pro {
		color: var(--pro-question-text);

		.pro-questions-choice__icon {
			flex: 0 0 48px;
			background-color: var(--pro-question-accent);
		}

		.pro-questions-choice__text-arr svg {
			color: var(--pro-question-accent);
		}
	}
	.pro-questions-choice__pro:hover {
		background-color: var(--pro-question-bg-hover);
		border-color: var(--pro-question-accent);
	}

	.pro-questions-choice__icon {
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 50%;
		width: 48px;
		height: 48px;
		color: white;
	}

	.pro-questions-choices strong {
		display: block;
		width: 100%;
		margin: 0;
		color: inherit;
		font-size: 16px;
		font-weight: 700;
		line-height: 120%;
		overflow-wrap: break-word;
	}

	.pro-questions-choice__text-arr {
		display: flex;
		align-items: center;
		justify-content: space-between;
		column-gap: 15px;
		width: 100%;
	}

	.pro-questions-choices span {
		 position: relative;
		 display: block;
		 width: 100%;
		 margin: 0;
		 color: inherit;
		 font-size: 13px;
		 font-weight: 400;
		 line-height: 120%;
		 overflow-wrap: break-word;
	 }

	.pro-questions-choice__pro .pro-questions-choice__top {
		display: flex;
		align-items: flex-start;
		justify-content: space-between;
		width: 100%;

		span {
			display: block;
			width: fit-content;
			font-size: 14px;
			font-weight: 800;
			color: #fff;
			background-color: #0F172A;
			padding: 6px 12px;
			border-radius: 8px;
		}
	}
}

#pro-question-dialog section[data-pro-question-panel="rules"] {
	display: flex;
	flex: 0 1 auto;
	flex-direction: column;
	min-height: 0;
	line-height: 130%;

	> * {
		flex-shrink: 0;
	}

	#pro-question-rules-title {
		font-size: 22px;
		font-weight: 800;
		margin: 0;
		padding-right: 22px;
	}

	.pro-questions-copy {
		font-size: 14px;
		font-weight: 400;
	}

	/* Rules-list */
	ol[data-pro-question-rules-items] {
		display: flex;
		flex: 0 1 auto;
		flex-direction: column;
		min-height: 100px;
		row-gap: 12px;
		margin: 16px 0;
		padding-right: 12px;
		padding-left: 24px;
		padding-bottom: 0;
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: thin;
		scrollbar-color: #CBD5E1 transparent;
		border-bottom: 1px solid #E4E9F2;
	}

	/* gap above the border while the list scrolls */
	ol[data-pro-question-rules-items]::after {
		content: "";
		position: sticky;
		bottom: 0;
		z-index: 1;
		flex: 0 0 68px;
		margin-top: -60px;
		background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 48px, #fff 48px);
		pointer-events: none;
	}

	/* Fade the 48px above the gap without changing the scrollable area. */
	ol[data-pro-question-rules-items].has-scroll-fade::after {
		margin-right: -12px;
		margin-left: -24px;
		background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 48px);
	}

	ol[data-pro-question-rules-items] > li {
		flex-shrink: 0;
		margin: 0;
	}

	ol[data-pro-question-rules-items] > li::marker {
		color: var(--question-accent);
		font-weight: 500;
	}

	label.pro-questions__rules-hidding {
		display: flex;
		column-gap: 10px;
		align-items: flex-start;
		margin-bottom: 0;
	}

	label.pro-questions__rules-hidding input {
		margin-top: 5px;
		width: 20px;
		height: 20px;
		border-radius: 5px;
	}

	label.pro-questions__rules-hidding span {
		font-size: 13px;
		font-weight: 500;
	}
}

#pro-question-dialog section[data-pro-question-panel="form"] {

	#pro-question-form-title {
		font-size: 22px;
		font-weight: 800;
		margin-bottom: 8px;
	}

	span[data-pro-question-text="form_description"] {
		color: #6B6B6B;
		font-size: 13px;
	}

	button[data-pro-question-view-rules] {
		background-color: transparent;
		border: none;
		color: var(--question-accent);
		font-size: 13px;
		font-weight: 600;
		text-decoration: underline;
		padding-left: 2px;
	}

	button[data-pro-question-view-rules]::before {
		content: "\00B7";
		display: inline-block;
		margin-right: 8px;
		color: #6B6B6B;
		text-decoration: none;
	}

	#pro-question-form {
		line-height: 130%;

		legend {
			font-size: 12px;
			font-weight: 600;
			color: #6A6A6A;
			float: left;
			width: auto;
			margin: 0 6px 0 0;
		}

		#pro-question-topic-hint {
			clear: none;
			margin: 0;
			font-size: 12px;
			color: #999999;
			font-size: 12px;
		}
		#pro-question-topic-hint::before {
			content: "\00B7";
			display: inline;
			width: auto;
			margin-right: 6px;
		}

		/* Theme-buttons */
		.pro-questions-topics {
			clear: both;
			display: flex;
			flex-wrap: wrap;
			justify-content: flex-start;
			gap: 10px;
			margin-block: 8px 24px;
		}

		.pro-questions-topics > label {
			position: relative;
			display: inline-flex;
			align-items: center;
			box-sizing: border-box;
			max-width: 100%;
			min-height: 44px;
			margin: 0;
			padding: 9px 14px;
			border: 1px solid #E4E9F2;
			border-radius: 10px;
			background: #fff;
			color: #475569;
			font-size: 13px;
			font-weight: 600;
			overflow-wrap: anywhere;
			cursor: pointer;
		}

		.pro-questions-topics input[type="radio"] {
			position: absolute;
			opacity: 0;
			width: 1px;
			height: 1px;
			margin: 0;
		}

		.pro-questions-topics > label:hover {
			border-color: var(--question-accent);
		}

		.pro-questions-topics > label:has(input:checked) {
			border-color: var(--question-accent);
			background: #F0F6FE;
			color: var(--question-accent);
		}

		.pro-questions-topics > label:has(input:focus-visible) {
			outline: 2px solid var(--question-accent);
			outline-offset: 3px;
		}

		/* Text area */
		label[data-pro-question-text="question_label"] {
			font-size: 12px;
			font-weight: 600;
		}

		textarea#pro-question-content {
			padding: 14px 16px;
			border-radius: 8px;
			width: 100%;
			max-width: 100%;
			resize: vertical;
			display: block;
			margin-bottom: 0;
		}

		.pro-questions__counter {
			margin: 6px 0 8px;
			color: #8A8A8A;
			font-size: 12px;
			font-weight: 500;
			line-height: 1.3;
			text-align: right;
			font-variant-numeric: tabular-nums;
		}

		.pro-questions-hint {
			font-size: 12px;
			font-weight: 400;
			color: #8A8A8A;
		}

		textarea[aria-invalid="true"] {
			border-color: var(--error-color)!important;
			border-width: 2px;
		}

		/* Errors */
		#pro-question-topic-error,
		#pro-question-content-error {
			font-size: 12px;
			font-weight: 500;
		}
	}
}

#pro-question-dialog section[data-pro-question-panel="success"] {
	.pro-question-success__icon {
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 50%;
		width: 96px;
		height: 96px;
		background-color: #E6F8ED;
		margin-inline: auto;
		margin-top: 48px;
	}

	.pro-question-success__icon > div {
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 50%;
		width: 44px;
		height: 44px;
		background-color: #00C24A;

	}

	#pro-question-success-title {
		margin-block: 20px;
		font-size: 20px;
		font-weight: 800;
		text-align: center;
	}

	p[data-pro-question-text="success_description"] {
		font-size: 14px;
		font-weight: 400;
		margin-block: 0 20px;
		text-align: center;
	}

	button[data-pro-question-close] {
		width: 100%;
		background-color: var(--question-accent);
		color: #fff;
		padding: 14px;
		font-size: 14px;
		font-weight: 600;
		border: none;
		border-radius: 10px;
		transition: background-color .3s ease;
	}

	button[data-pro-question-close]:hover {
		background-color: var(--question-accent-hover);
	}

	button[data-pro-question-close]:active {
		background-color: var(--question-accent-press);
	}
}

#pro-question-dialog section[data-pro-question-panel="loading"] {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	height: 100%;

	.pro-questions-loading-bar {
		position: relative;
		flex-shrink: 0;
		width: 240px;
		max-width: 100%;
		height: 12px;
		overflow: hidden;
		border-radius: 999px;
		background-color: var(--question-accent);
	}

	#pro-question-loading-title {
		margin: 0;
		color: #6B6B6B;
		font-size: 14px;
		font-weight: 400;
		text-align: center;
	}
}

/* Ошибка отправки формы (нет интернета) */
#pro-question-dialog [data-pro-question-notice] {
	display: flex;
	column-gap: 10px;
	align-items: center;
	background-color: #FCEBEB;
	padding: 12px 16px;
	color: var(--error-color);
	font-size: 13px;
	font-weight: 500;
	line-height: 130%;
	border-radius: 8px;
	margin-block: 20px 0;
}
#pro-question-dialog [data-pro-question-notice]::before {
	content: "";
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	background: url("data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M9.16684%2013.3334V10C9.16684%209.53978%209.53994%209.16669%2010.0002%209.16669C10.4604%209.16669%2010.8335%209.53978%2010.8335%2010V13.3334C10.8335%2013.7936%2010.4604%2014.1667%2010.0002%2014.1667C9.53994%2014.1667%209.16684%2013.7936%209.16684%2013.3334Z%22%20fill%3D%22%23EF4444%22%2F%3E%3Cpath%20d%3D%22M10.0083%2015.8334C10.4685%2015.8334%2010.8416%2016.2065%2010.8416%2016.6667C10.8416%2017.1269%2010.4685%2017.5%2010.0083%2017.5H10.0002C9.53994%2017.5%209.16684%2017.1269%209.16684%2016.6667C9.16684%2016.2065%209.53994%2015.8334%2010.0002%2015.8334H10.0083Z%22%20fill%3D%22%23EF4444%22%2F%3E%3Cpath%20d%3D%22M17.5001%2011.2503C17.5001%2010.4768%2017.1926%209.73432%2016.6456%209.18734C16.0987%208.64053%2015.3569%208.33366%2014.5835%208.33366H13.0918C12.7233%208.33362%2012.3987%208.09108%2012.2934%207.73795C12.046%206.90835%2011.5869%206.15696%2010.962%205.55778C10.3372%204.95872%209.56733%204.53234%208.72816%204.31999C7.88898%204.10765%207.00902%204.11625%206.17445%204.34603C5.33975%204.57588%204.57886%205.0189%203.9666%205.63102C3.35444%206.24305%202.91169%207.00355%202.68161%207.83805C2.45156%208.67269%202.44174%209.55322%202.65394%2010.3926C2.86611%2011.2318%203.29282%2012.0015%203.89173%2012.6265C4.4908%2013.2515%205.24231%2013.7102%206.07191%2013.9578C6.51283%2014.0894%206.76323%2014.5537%206.63181%2014.9946C6.50018%2015.4356%206.03604%2015.687%205.59502%2015.5553C4.48893%2015.2252%203.48767%2014.613%202.68893%2013.7796C1.89028%2012.9463%201.32147%2011.9201%201.03854%2010.8011C0.755611%209.68196%200.767623%208.5082%201.07435%207.39534C1.38107%206.28259%201.97197%205.26874%202.78822%204.45264C3.60455%203.63649%204.61884%203.04606%205.73174%202.73958C6.84467%202.43311%208.01842%202.42058%209.1375%202.70377C10.2565%202.98698%2011.2829%203.55607%2012.116%204.35498C12.797%205.00797%2013.3289%205.79679%2013.681%206.66699H14.5835C15.7989%206.66699%2016.9645%207.14958%2017.824%208.00895C18.6836%208.86849%2019.1668%2010.0347%2019.1668%2011.2503C19.1667%2012.4658%2018.6835%2013.6314%2017.824%2014.4909C16.9645%2015.3503%2015.799%2015.8337%2014.5835%2015.8337H14.1668C13.7067%2015.8336%2013.3336%2015.4604%2013.3335%2015.0003C13.3335%2014.5401%2013.7066%2014.167%2014.1668%2014.167H14.5835C15.3569%2014.167%2016.0987%2013.8594%2016.6456%2013.3125C17.1925%2012.7656%2017.5%2012.0238%2017.5001%2011.2503Z%22%20fill%3D%22%23EF4444%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
}

/* submit button */
#pro-question-dialog [data-pro-question-submit].is-loading {
	position: relative;
	overflow: hidden;
	opacity: 1;
	background-color: var(--question-accent);
	border-color: var(--question-accent);
}

#pro-question-dialog [data-pro-question-submit].is-loading::before,
#pro-question-dialog .pro-questions-loading-bar::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	background-image: linear-gradient(
			-45deg,
			rgba(0, 0, 0, 0.15) 25%,
			transparent 25%,
			transparent 50%,
			rgba(0, 0, 0, 0.15) 50%,
			rgba(0, 0, 0, 0.15) 75%,
			transparent 75%,
			transparent
	);
	background-size: 30px 30px;
	animation: move 0.5s linear infinite;
}

/* PRO-баннер внутри общего диалога вопросов. */
#pro-question-dialog.is-pro-banner {
	@media (max-width: 600px) {
		width: 100%;
		margin-bottom: 0;
		border-radius: 16px 16px 0 0;
	}
}

#pro-question-dialog.is-pro-banner > .lk-pro__buy-pro-popup.is-embedded {
	display: block;
	visibility: visible;
	position: static;
	inset: auto;
	z-index: auto;
	background: transparent;
	animation: pro-question-banner-in .18s ease-out;
}

#pro-question-dialog.is-pro-banner form#lk-pro__buy-pro-popup {
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
}

#pro-question-dialog.is-pro-banner .lk-pro__buy-pro-close {
	display: none;
}

#pro-question-dialog.is-pro-banner #pro-question-banner-title {
	margin-top: 0;
	padding-right: 40px;
}

@keyframes pro-question-banner-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* Отключение анимации */
@media (prefers-reduced-motion: reduce) {
	#pro-question-dialog,
	#pro-question-dialog::backdrop {
		transition: none;
	}

	#pro-question-dialog [data-pro-question-submit].is-loading::before,
	#pro-question-dialog .pro-questions-loading-bar::before {
		animation: none;
	}

	#pro-question-dialog.is-pro-banner > .lk-pro__buy-pro-popup.is-embedded {
		animation: none;
	}
}
