/* ===========================================
СБРОС СТИЛЕЙ И БАЗОВЫЕ НАСТРОЙКИ
=========================================== */
* {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
	box-sizing: border-box;
	-webkit-tap-highlight-color: transparent;
}
html {
	font-size: 16px;
	line-height: 1.15;
	-webkit-text-size-adjust: 100%;
	-moz-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
}
body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	font-size: 1rem;
	line-height: 1.5;
	color: #333333;
	background-color: #f5f5f5;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
	min-height: 100vh;
}
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
	display: block;
}

/* ===========================================
ТИПОГРАФИЯ — ЗАПРЕТ ЖИРНОГО И КУРСИВА
=========================================== */
body,
.text-input,
.sticker_original_font,
.line,
.font-name,
.step-section h3,
.preview-content p,
.color-options label,
.size-options label,
.shop strong {
	font-weight: normal !important;
	font-style: normal !important;
}

/* ===========================================
КОНТЕЙНЕР ДЛЯ ОГРАНИЧЕНИЯ ШИРИНЫ
=========================================== */
.container {
	max-width: 600px;
	margin: 0 auto;
	width: 100%;
	padding: 1rem;
}

/* ===========================================
ЗАГОЛОВОК ПРИЛОЖЕНИЯ
=========================================== */
h1 {
	font-size: 2rem;
	letter-spacing: -0.02em;
	font-weight: 600;
	text-align: center;
	margin: 1.5rem 0 2rem;
	color: #2c3e50;
}

/* ===========================================
ТИПОГРАФИЯ
=========================================== */
h2, h3, h4, h5, h6 {
	font-weight: 600;
	line-height: 1.25;
	margin-bottom: 0.75rem;
	color: #333333;
}
h3 {
	font-size: 1.25rem;
}

/* ===========================================
ШАГ: ВВОД ТЕКСТА
=========================================== */
#text-input-section {
	background-color: #ffffff;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	padding: 1.25rem 1rem;
	border-bottom: 1px solid #e0e0e0;
	margin-bottom: 1.5rem;
	border-radius: 0.75rem;
}
#text-input-section h3 {
	text-align: center;
	margin-bottom: 1.25rem;
	padding: 0 0.5rem;
	color: #2c3e50;
	font-weight: 600;
}

/* ===========================================
ПОЛЕ ВВОДА ТЕКСТА С CSS-ПЛЕЙСХОЛДЕРОМ
=========================================== */
.input-wrapper {
	position: relative;
	width: 100%;
	margin-bottom: 1rem;
}
.text-input {
	width: 100%;
	min-height: 3.75rem;
	padding: 1rem 3.5rem 1rem 1rem;
	background-color: #ffffff;
	border: 2px solid #e0e0e0;
	border-radius: 0.75rem;
	font-size: 1.125rem;
	line-height: 1.5;
	color: #333333;
	outline: none;
	resize: none;
	overflow-wrap: break-word;
	white-space: pre-wrap;
	transition: all 0.2s ease;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
.text-input:focus {
	border-color: #3498db;
	box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* CSS-плейсхолдер через ::before */
.text-input[data-placeholder] {
	position: relative;
}
.text-input[data-placeholder]:empty:not(:focus)::before {
	content: attr(data-placeholder);
	position: absolute;
	top: 1rem;
	left: 1rem;
	right: 3.5rem;
	color: #95a5a6;
	pointer-events: none;
	white-space: pre-wrap;
	word-break: break-word;
}

/* ===========================================
КНОПКА ОЧИСТКИ (КРЕСТИК)
=========================================== */
.clear-btn {
	position: absolute;
	right: 0.75rem;
	top: 50%;
	transform: translateY(-50%);
	width: 2rem;
	height: 2rem;
	background-color: #e0e0e0;
	border-radius: 50%;
	color: #7f8c8d;
	font-size: 1.5rem;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	user-select: none;
}
.clear-btn.visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}
.clear-btn:hover {
	background-color: #ff6b6b;
	color: #ffffff;
	transform: translateY(-50%) scale(1.1);
}
.clear-btn:active {
	transform: translateY(-50%) scale(0.95);
}

/* ===========================================
АККОРДЕОН С ТАТАРСКИМИ БУКВАМИ
=========================================== */
.tatar-letters-accordion {
	width: 100%;
	border: 1px solid #e0e0e0;
	border-radius: 0.75rem;
	overflow: hidden;
	margin-top: 1rem;
	background-color: #ffffff;
}
.accordion-header {
	width: 100%;
	padding: 1rem 1.25rem;
	background-color: #f8f9fa;
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	transition: background-color 0.2s ease;
	user-select: none;
}
.accordion-header:hover {
	background-color: #f1f3f4;
}
.accordion-title {
	font-weight: 600;
	font-size: 1rem;
	color: #2c3e50;
	flex: 1;
}
.accordion-icon {
	font-size: 0.875rem;
	color: #7f8c8d;
	transition: transform 0.3s ease;
	margin-left: 0.5rem;
	min-width: 1rem;
	text-align: center;
}
.tatar-letters-accordion.open .accordion-icon {
	transform: rotate(180deg);
}
.accordion-body {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	background-color: #ffffff;
}
.tatar-letters-accordion.open .accordion-body {
	max-height: 300px;
}

/* ===========================================
ТАТАРСКИЕ БУКВЫ
=========================================== */
.tatar-letters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding: 1.25rem;
	width: 100%;
}
.tatar-letter {
	flex: 0 0 auto;
	padding: 0.75rem 1rem;
	font-size: 1.125rem;
	font-weight: 500;
	background-color: #ffffff;
	border: 1px solid #e0e0e0;
	border-radius: 0.5rem;
	color: #333333;
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: center;
	user-select: none;
	box-sizing: border-box;
	min-height: 3rem;
	display: flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
}
.tatar-letter:hover {
	background-color: #3498db;
	color: #ffffff;
	border-color: #3498db;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
}
.tatar-letter:active {
	transform: translateY(0);
}

/* ===========================================
ШАГ: ВЫБОР ШРИФТА
=========================================== */
#sticker_input_font {
	width: 100%;
	padding: 0;
	margin-bottom: 2rem;
}
#sticker_input_font h3 {
	padding-top: 1rem!important;
}

/* ===========================================
БЛОК ШРИФТА
=========================================== */
.font-sample {
	margin-bottom: 2.5rem;
	background-color: #ffffff;
	padding: 1rem;
}
.font-sample:hover {
}
.font-name {
	font-size: 1.125rem;
	color: #2c3e50;
	line-height: 1.4;
	font-weight: 500;
	display: inline-block;
}
.select-font-btn {
	background-color: #3498db;
	color: white;
	border: none;
	padding: 0.25rem 0.5rem;
	border-radius: 0.5rem;
	font-size: 1rem;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.2s ease;
}
.select-font-btn:hover {
	background-color: #2980b9;
	transform: translateY(-2px);
}
.select-font-btn:active {
	transform: translateY(0);
}

/* ===========================================
НАКЛЕЙКА (PREVIEW)
=========================================== */
.sticker_original_font {
	width: 100%;
	min-height: 9.375rem;
	padding: 1.5rem;
	background-color: #ffffff;
	border: 2px solid #333333;
	border-radius: 0.75rem;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	overflow: visible;
	white-space: normal;
	word-break: keep-all;
	word-wrap: normal;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	font-size: 2rem;
	color: #333333;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	transition: border-color 0.2s ease;
	margin-top: 0.5rem;
}
.sticker_original_font:hover {
	border-color: #3498db;
}
.sticker_original_font .line {
	display: block;
	width: 100%;
	white-space: nowrap;
	word-break: keep-all;
	overflow: visible;
	text-overflow: clip;
	line-height: 1.4;
	margin: 0;
	padding: 0;
}

/* ===========================================
ШАГ: ВЫБОР ЦВЕТА / РАЗМЕРА / PREVIEW / ОТПРАВКА
=========================================== */
.step-section {
	background-color: #ffffff;
	padding: 1.5rem;
	border-radius: 0.75rem;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	margin-bottom: 1.5rem;
}
.step-section h3 {
	text-align: center;
	margin-bottom: 1.25rem;
	color: #2c3e50;
}

/* Цвет */
.color-options,
.size-options {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}
.color-options label,
.size-options label {
	font-size: 1.05rem;
	padding: 0.5rem;
	background-color: #f8f9fa;
	border-radius: 0.5rem;
	cursor: pointer;
	transition: background-color 0.2s;
	user-select: none;
}
.color-options input[type="radio"],
.size-options input[type="radio"] {
	margin-right: 0.5rem;
}

/* Preview */
.preview-content p {
	font-size: 1.1rem;
	margin-bottom: 0.75rem;
	line-height: 1.5;
}
.preview-content strong {
	color: #2c3e50;
}

/* Отправка */
.shop-options {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}
.shop {
	background-color: #f8f9fa;
	padding: 1rem;
	border-radius: 0.75rem;
}
.shop strong {
	display: block;
	margin-bottom: 0.5rem;
	color: #2c3e50;
	font-size: 1.1rem;
}
.send-to-telegram {
	display: inline-block;
	background-color: #3498db;
	color: white;
	padding: 0.6rem 1.2rem;
	border-radius: 0.5rem;
	text-decoration: none;
	font-weight: 500;
	transition: background-color 0.2s;
}
.send-to-telegram:hover {
	background-color: #2980b9;
	text-decoration: none;
}

/* ===========================================
КНОПКА "НАВЕРХ"
=========================================== */
.scroll-top-btn {
	position: fixed;
	bottom: 2rem;
	right: 2rem;
	width: 3.5rem;
	height: 3.5rem;
	background-color: rgba(128, 128, 128, 0.7);
	color: #ffffff;
	border: none;
	border-radius: 50%;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transition: all 0.3s ease;
	opacity: 0;
	visibility: hidden;
	transform: translateY(20px);
	z-index: 999;
	user-select: none;
}
.scroll-top-btn.visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.scroll-top-btn:hover {
	background-color: rgba(128, 128, 128, 0.9);
	transform: translateY(-5px) scale(1.1);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}
.scroll-top-btn:active {
	transform: translateY(0) scale(0.95);
}

/* ===========================================
АДАПТИВНОСТЬ
=========================================== */
@media (max-width: 768px) {
	html { font-size: 15px; }
	h1 { font-size: 1.75rem; margin: 1.25rem 0 1.75rem; }
	.step-section { padding: 1.25rem; }
	.select-font-btn { padding: 0.4rem 0.8rem; font-size: 0.95rem; }
	.scroll-top-btn {
		width: 3rem;
		height: 3rem;
		font-size: 1.4rem;
		bottom: 1.5rem;
		right: 1.5rem;
	}
}
@media (max-width: 480px) {
	html { font-size: 14px; }
	h1 { font-size: 1.5rem; margin: 1rem 0 1.5rem; }
	.step-section { padding: 1rem; }
	.font-sample { padding: 1rem; margin-bottom: 2rem; }
	.select-font-btn { padding: 0.35rem 0.75rem; font-size: 0.9rem; }
	.scroll-top-btn {
		width: 2.75rem;
		height: 2.75rem;
		font-size: 1.25rem;
		bottom: 1.25rem;
		right: 1.25rem;
	}
}
@media (max-width: 320px) {
	html { font-size: 13px; }
	h1 { font-size: 1.375rem; }
	.step-section { padding: 0.875rem; }
	.scroll-top-btn {
		width: 2.5rem;
		height: 2.5rem;
		font-size: 1.125rem;
		bottom: 1rem;
		right: 1rem;
	}
}

/* ===========================================
ТЕМНАЯ ТЕМА
=========================================== */
@media (prefers-color-scheme: dark) {
	body {
		background-color: #1a1a1a;
		color: #e0e0e0;
	}
	.step-section,
	#text-input-section,
	.font-sample,
	.tatar-letters-accordion {
		background-color: #2d2d2d;
		color: #e0e0e0;
	}
	.text-input {
		background-color: #2d2d2d;
		border-color: #404040;
		color: #e0e0e0;
	}
	/* Плейсхолдер в темной теме */
	.text-input[data-placeholder]:empty:not(:focus)::before {
		color: #7f8c8d;
	}
	.clear-btn {
		background-color: #404040;
		color: #95a5a6;
	}
	.clear-btn:hover {
		background-color: #ff6b6b;
		color: #ffffff;
	}
	.accordion-header {
		background-color: #333333;
	}
	.accordion-header:hover {
		background-color: #3d3d3d;
	}
	.tatar-letter {
		background-color: #2d2d2d;
		border-color: #404040;
		color: #e0e0e0;
	}
	.tatar-letter:hover {
		background-color: #3498db;
		color: #ffffff;
	}
	.font-name,
	.step-section h3,
	.preview-content strong,
	.shop strong {
		color: #e0e0e0;
	}
	.sticker_original_font {
		background-color: #2d2d2d;
		border-color: #404040;
		color: #e0e0e0;
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	}
	.sticker_original_font:hover {
		border-color: #3498db;
	}
	.color-options label,
	.size-options label,
	.shop {
		background-color: #333333;
	}
	.send-to-telegram {
		background-color: #3498db;
	}
	.send-to-telegram:hover {
		background-color: #2980b9;
	}
	.scroll-top-btn {
		background-color: rgba(180, 180, 180, 0.6);
	}
	.scroll-top-btn:hover {
		background-color: rgba(180, 180, 180, 0.8);
	}
	/* Уведомление в темной теме */
	.custom-notification {
		background-color: #2E7D32;
		color: #ffffff;
	}
}