/* Шапка сайта: логотип, навигация, кнопка "Задать вопрос", бургер-меню, мобильное меню, плавающая кнопка (FAB) */

.header {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	background: rgba(250, 250, 249, 0.9);
	backdrop-filter: blur(8px);
	padding: 20px 32px;
	display: flex;
	justify-content: center;
	z-index: 1000;
	transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
	will-change: transform;
}

/* Добавляется скриптом при прокрутке вниз, чтобы освободить место контенту. */
.header.is-hidden {
	transform: translateY(-110%);
}

.header.is-scrolled {
	background: rgba(250, 250, 249, 0.97);
	box-shadow: 0 2px 18px rgba(20, 38, 48, 0.08);
}

.header-container {
	max-width: 1280px;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.logo {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	text-decoration: none;
	flex-shrink: 0;
}

.logo img {
	display: block;
	height: 64px;
	width: auto;
	object-fit: contain;
	transition: transform 0.2s;
}

.logo-subtitle {
	font-size: 13px;
	font-weight: 200;
	color: #888;
	letter-spacing: 0.03em;
	margin-top: 0;
	white-space: nowrap;
	position: relative;
	top: -10px;
}

.logo:hover img {
	transform: scale(1.02);
}

.nav-and-actions {
	display: flex;
	align-items: center;
	gap: 36px;
}

.nav-links {
	display: flex;
	align-items: center;
	gap: 32px;
	list-style: none;
}

.nav-links a {
	font-size: 17px;
	font-weight: 600;
	color: #282828;
	text-decoration: none;
	letter-spacing: 0.04em;
	padding: 6px 0;
	border-bottom: 2px solid transparent;
	transition: color 0.3s, border-color 0.3s;
}

.nav-links a:hover {
	color: #00c4ff;
	border-bottom-color: #00c4ff;
}

.btn-ask {
	font-size: 16px;
	font-weight: 700;
	color: #fff;
	background: linear-gradient(135deg, #00c4ff, #0099dd);
	padding: 12px 28px;
	border: none;
	border-radius: 10px;
	cursor: pointer;
	transition: all 0.25s;
	line-height: 1.3;
	letter-spacing: 0.02em;
	white-space: nowrap;
	box-shadow: 0 4px 14px rgba(0, 196, 255, 0.25);
}

.btn-ask:hover {
	background: linear-gradient(135deg, #00b3ee, #0088cc);
	box-shadow: 0 6px 18px rgba(0, 196, 255, 0.4);
	transform: translateY(-1px);
}

/* Кнопка "Вход для юристов" */
.btn-lawyer-login {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-size: 16px;
	font-weight: 700;
	color: #fff;
	background: linear-gradient(135deg, #00c4ff, #0099dd);
	border: none;
	border-radius: 10px;
	padding: 12px 28px;
	cursor: pointer;
	text-decoration: none;
	line-height: 1.3;
	letter-spacing: 0.02em;
	white-space: nowrap;
	transition: all 0.25s;
	box-shadow: 0 4px 14px rgba(0, 196, 255, 0.25);
}

.btn-lawyer-login svg {
	flex-shrink: 0;
}

.btn-lawyer-login:hover {
	background: linear-gradient(135deg, #00b3ee, #0088cc);
	box-shadow: 0 6px 18px rgba(0, 196, 255, 0.4);
	transform: translateY(-1px);
}

/* Контейнер для кнопки входа / состояния "вошли" */
.lawyer-auth-slot {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.lawyer-auth-slot .btn-lawyer-login {
	/* Перекрывает дефолтный inline display на старых вставках */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-family: inherit;
}

/* Кнопка выхода рядом с ФИО вошедшего юриста */
.btn-lawyer-logout {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	background: #fff;
	border: 2px solid #e0e0e0;
	border-radius: 10px;
	color: #888;
	cursor: pointer;
	transition: all 0.2s;
	flex-shrink: 0;
}

.btn-lawyer-logout:hover {
	border-color: #ff3b30;
	color: #ff3b30;
	background: #fff5f5;
}

/* ============================================================
   МОДАЛ ВХОДА ДЛЯ ЮРИСТОВ
   ============================================================ */
.lawyer-login-error {
	display: none;
	padding: 11px 14px;
	border-radius: 9px;
	background: #fdecea;
	color: #c0392b;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
}
.lawyer-login-error:not(:empty) { display: block; }

.lawyer-login-hint {
	margin: 4px 0 0;
	text-align: center;
	font-size: 14px;
	color: #687881;
}
.lawyer-login-hint a {
	color: #008fcb;
	font-weight: 700;
	text-decoration: none;
}
.lawyer-login-hint a:hover { text-decoration: underline; }

#lawyerLoginStep2 .modal-submit-btn {
	display: inline-block;
	margin-top: 16px;
	text-decoration: none;
}

/* Кнопки внутри модала не наследуют кнопочные стили шапки */
#lawyerLoginModalOverlay .modal-card .lawyer-login-error { font-family: inherit; }

/* ============================================================
   ПЛАВАЮЩАЯ КНОПКА (FAB)
   ============================================================ */
.fab-ask {
	/* Плавающая кнопка видна на всех экранах. */
	display: flex !important;
	position: fixed;
	bottom: 24px;
	right: max(24px, calc(50vw - 640px));
	z-index: 999;
	background: #16b24b;
	color: #fff;
	width: 64px;
	height: 64px;
	padding: 0;
	border-radius: 50%;
	border: none;
	border: 2px solid #fff;
	box-shadow: 0 4px 20px rgba(22, 178, 75, 0.45);
	cursor: pointer;
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
	align-items: center;
	justify-content: center;
	font-size: 32px;
	font-weight: 700;
	line-height: 1;
	animation: fabPulse 2.5s ease-in-out infinite;
}

.fab-ask:hover {
	transform: scale(1.12);
	box-shadow: 0 6px 32px rgba(22, 178, 75, 0.6);
	animation-play-state: paused;
}

@keyframes fabPulse {
	0%, 100% {
		transform: scale(1);
		box-shadow: 0 4px 20px rgba(22, 178, 75, 0.45);
	}
	50% {
		transform: scale(1.08);
		box-shadow: 0 6px 32px rgba(22, 178, 75, 0.65);
	}
}

.fab-ask .question-mark {
	display: inline-block;
	transition: transform 0.3s;
}

.fab-ask:hover .question-mark {
	transform: rotate(15deg) scale(1.1);
}

/* ============================================================
   БУРГЕР-МЕНЮ
   ============================================================ */
.burger-btn {
	display: none;
	flex-direction: column;
	gap: 5px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 6px 4px;
	z-index: 1100;
	position: relative;
}

.burger-btn span {
	display: block;
	width: 28px;
	height: 3px;
	background: #282828;
	border-radius: 3px;
	transition: all 0.3s;
	transform-origin: center;
}

.burger-btn.active span:nth-child(1) {
	transform: translateY(8px) rotate(45deg);
}

.burger-btn.active span:nth-child(2) {
	opacity: 0;
	transform: scaleX(0);
}

.burger-btn.active span:nth-child(3) {
	transform: translateY(-8px) rotate(-45deg);
}

/* ============================================================
   МОБИЛЬНОЕ МЕНЮ
   ============================================================ */
.mobile-menu {
	position: fixed;
	top: 0;
	right: -100%;
	width: 320px;
	max-width: 85vw;
	height: 100vh;
	background: #fff;
	box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
	z-index: 1050;
	padding: 0;
	transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	overflow-y: auto;
	display: flex;
	flex-direction: column;
}

.mobile-menu.open {
	right: 0;
}

/* ШАПКА МОБИЛЬНОГО МЕНЮ */
.mobile-menu-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 20px;
	border-bottom: 1px solid #f0f0f0;
	background: #fafaf9;
	position: sticky;
	top: 0;
	z-index: 10;
}

.mobile-menu-title {
	font-size: 20px;
	font-weight: 700;
	color: #1a1a1a;
}

.mobile-menu-close {
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s;
}

.mobile-menu-close:hover {
	background: #f5f5f5;
	border-color: #00c4ff;
}

.mobile-menu-close svg {
	stroke: #666;
	transition: stroke 0.2s;
}

.mobile-menu-close:hover svg {
	stroke: #00c4ff;
}

/* КОНТЕНТ МЕНЮ */
.mobile-menu-content {
	padding: 12px 0;
	flex: 1;
}

/* ОБЫЧНЫЕ ССЫЛКИ */
.mobile-menu-link {
	display: block;
	font-size: 16px;
	font-weight: 600;
	color: #1a1a1a;
	text-decoration: none;
	padding: 14px 20px;
	border-bottom: 1px solid #f5f5f5;
	transition: all 0.2s;
}

.mobile-menu-link:hover,
.mobile-menu-link:active {
	background: #f0f9ff;
	color: #00c4ff;
	padding-left: 28px;
}

/* АККОРДЕОН СЕКЦИИ */
.mobile-menu-section {
	border-bottom: 1px solid #f0f0f0;
}

.mobile-menu-accordion {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: none;
	border: none;
	padding: 14px 20px;
	font-size: 16px;
	font-weight: 600;
	color: #1a1a1a;
	text-align: left;
	cursor: pointer;
	transition: all 0.2s;
}

.mobile-menu-accordion:hover {
	background: #f0f9ff;
	color: #00c4ff;
}

.mobile-menu-arrow {
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	flex-shrink: 0;
}

.mobile-menu-accordion.active .mobile-menu-arrow {
	transform: rotate(180deg);
}

.mobile-menu-accordion-content {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	background: #fafaf9;
}

.mobile-menu-accordion.active + .mobile-menu-accordion-content {
	max-height: 800px;
}

/* ПОДССЫЛКИ В АККОРДЕОНЕ */
.mobile-menu-sublink {
	display: block;
	font-size: 14px;
	font-weight: 400;
	color: #666;
	text-decoration: none;
	padding: 10px 20px 10px 40px;
	border-bottom: 1px solid #f0f0f0;
	transition: all 0.2s;
	position: relative;
}

.mobile-menu-sublink::before {
	content: '';
	position: absolute;
	left: 24px;
	top: 50%;
	transform: translateY(-50%);
	width: 4px;
	height: 4px;
	background: #999;
	border-radius: 50%;
	transition: all 0.2s;
}

.mobile-menu-sublink:hover,
.mobile-menu-sublink:active {
	background: #f0f9ff;
	color: #00c4ff;
	padding-left: 44px;
}

.mobile-menu-sublink:hover::before {
	background: #00c4ff;
	width: 6px;
	height: 6px;
}

/* КНОПКА ЗАДАТЬ ВОПРОС */
.mobile-ask-btn {
	margin: 16px 20px 20px;
	background: linear-gradient(135deg, #00c4ff, #0099dd);
	color: #fff;
	border: none;
	border-radius: 12px;
	padding: 16px;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s;
	box-shadow: 0 4px 14px rgba(0, 196, 255, 0.25);
}

.mobile-ask-btn:hover,
.mobile-ask-btn:active {
	background: linear-gradient(135deg, #00b3ee, #0088cc);
	box-shadow: 0 6px 18px rgba(0, 196, 255, 0.4);
	transform: translateY(-1px);
}

.mobile-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.3);
	z-index: 1040;
	opacity: 0;
	visibility: hidden;
	transition: all 0.35s;
}

.mobile-overlay.active {
	opacity: 1;
	visibility: visible;
}

/* ============================================================
   ВЫПАДАЮЩЕЕ МЕНЮ ДЛЯ "Вопросы" (ТОЛЬКО ПК)
   ============================================================ */
.nav-links .dropdown-trigger {
	position: relative;
	cursor: pointer;
}

.nav-links .dropdown-trigger > a {
	display: flex;
	align-items: center;
	gap: 4px;
}

.nav-links .dropdown-trigger > a::after {
	content: '▾';
	font-size: 14px;
	color: #999;
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
	margin-left: 4px;
}

.nav-links .dropdown-trigger:hover > a::after {
	transform: rotate(180deg);
	color: #00c4ff;
}

.dropdown-menu {
	position: absolute;
	top: calc(100% + 12px);
	left: 50%;
	transform: translateX(-50%) translateY(-6px);
	min-width: 240px;
	background: #ffffff;
	border-radius: 14px;
	box-shadow: 0 12px 44px rgba(0, 0, 0, 0.10);
	padding: 8px 0;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
	z-index: 1001;
	border: 1px solid rgba(0, 0, 0, 0.05);
	list-style: none;
}

.dropdown-menu.show {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(-50%) translateY(0);
}

.dropdown-menu li {
	list-style: none;
	margin: 0;
	padding: 0;
}

.dropdown-menu a {
	display: block;
	padding: 10px 20px;
	font-size: 14px;
	font-weight: 500;
	color: #1a1a1a;
	text-decoration: none;
	transition: background 0.2s, color 0.2s, padding-left 0.2s;
	border-bottom: none !important;
	letter-spacing: 0.01em;
	border-radius: 0;
}

.dropdown-menu a:hover {
	background: #f0f9ff;
	color: #00c4ff;
	padding-left: 26px;
}

/* ============================================================
   АДАПТИВ (ПЛАНШЕТЫ И МОБИЛА)
   ============================================================ */
@media (max-width: 768px) {
	.header {
		padding: 14px 16px;
	}

	.header-container {
		flex-wrap: nowrap;
		gap: 8px;
	}

	.nav-links {
		display: none;
	}

	.btn-ask {
		/* Перекрывает устаревший inline display на скопированных страницах. */
		display: none !important;
	}

	.btn-lawyer-login,
	.lawyer-auth-slot {
		display: none !important;
	}

	.burger-btn {
		display: flex;
	}

	.logo img {
		height: 44px;
	}

	.fab-ask {
		display: flex !important;
		width: 56px;
		height: 56px;
		padding: 0;
		border-radius: 50%;
		font-size: 26px;
		bottom: 16px;
		right: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.header,
	.mobile-menu,
	.mobile-overlay,
	.burger-btn span {
		transition: none;
	}

	.fab-ask {
		animation: none;
	}
}

/* ============================================================
   ЭКСТРА-МАЛЕНЬКИЕ ЭКРАНЫ
   ============================================================ */
@media (max-width: 480px) {
	.fab-ask {
		width: 50px;
		height: 50px;
		padding: 0;
		border-radius: 50%;
		font-size: 22px;
		bottom: 14px;
		right: 14px;
	}


	.mobile-menu {
		padding: 70px 18px 30px;
		width: 280px;
	}
}
