/* ==================== GOOGLE FONTS ==================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

/* ==================== CSS VARIABLES ==================== */
:root {
	/* Colors */
	--bg-color: #111827;
	--bg-secondary-color: #1f2937;
	--primary-color: #4338ca;
	--primary-hover-color: #4f46e5;
	--text-color: #f3f4f6;
	--text-color-light: #9ca3af;

	/* Typography */
	--font-family: 'Inter', sans-serif;
	--h1-font-size: 2.5rem;
	--h2-font-size: 2rem;
	--h3-font-size: 1.25rem;
	--normal-font-size: 1rem;
	--small-font-size: 0.875rem;

	/* Other */
	--header-height: 6rem;
	--border-radius: 0.5rem;
	--transition: all 0.3s ease;
}

/* ==================== BASE STYLES ==================== */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	background-color: var(--bg-color);
	color: var(--text-color);
	font-family: var(--font-family);
	font-size: var(--normal-font-size);
}

ul {
	list-style: none;
}

a {
	text-decoration: none;
	color: inherit;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

h1,
h2,
h3 {
	font-weight: 700;
}

/* ==================== REUSABLE CLASSES ==================== */
.container {
	max-width: 1140px;
	margin-inline: auto;
	padding-inline: 1rem;
}

/* ==================== HEADER ==================== */
.header {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	background-color: rgba(17, 24, 39, 0.8);
	backdrop-filter: blur(10px);
	z-index: 100;
	border-bottom: 1px solid var(--bg-secondary-color);
}

.header__container {
	height: var(--header-height);
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.logo {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 1.5rem;
	font-weight: 700;
	transition: var(--transition);
}

.logo:hover {
	color: var(--primary-hover-color);
}

.logo img {
	width: 32px;
	height: 32px;
}

.header__nav-list {
	display: flex;
	align-items: center;
	gap: 2rem;
}

.header__nav-link {
	font-weight: 500;
	transition: var(--transition);
	position: relative;
	padding-bottom: 0.25rem;
}

.header__nav-link::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 0;
	height: 2px;
	background-color: var(--primary-color);
	transition: var(--transition);
}

.header__nav-link:hover {
	color: var(--primary-color);
}

.header__nav-link:hover::after {
	width: 100%;
}

.header__nav-link--button {
	background-color: var(--primary-color);
	color: var(--text-color);
	padding: 0.6rem 1.2rem;
	border-radius: var(--border-radius);
}

.header__nav-link--button:hover {
	background-color: var(--primary-hover-color);
	color: var(--text-color);
}

.header__nav-link--button::after {
	display: none;
}

.header__burger-button {
	display: none;
	background: none;
	border: none;
	color: var(--text-color);
	cursor: pointer;
}

/* ==================== FOOTER ==================== */
.footer {
	background-color: var(--bg-secondary-color);
	padding-top: 4rem;
	font-size: var(--small-font-size);
}

.footer__container {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 2rem;
	padding-bottom: 3rem;
}

.footer__column--about .logo {
	margin-bottom: 1rem;
}

.footer__description {
	color: var(--text-color-light);
	line-height: 1.6;
	max-width: 250px;
}

.footer__title {
	font-size: var(--h3-font-size);
	margin-bottom: 1rem;
}

.footer__list li:not(:last-child) {
	margin-bottom: 0.75rem;
}

.footer__link {
	color: var(--text-color-light);
	transition: var(--transition);
}

.footer__link:hover {
	color: var(--primary-color);
	padding-left: 0.25rem;
}

.footer__list--contacts li {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	color: var(--text-color-light);
}

.footer__list--contacts i {
	flex-shrink: 0;
}

.footer__bottom {
	padding-block: 1.5rem;
	border-top: 1px solid #374151;
	text-align: center;
	color: var(--text-color-light);
}

/* ==================== RESPONSIVENESS ==================== */
@media screen and (max-width: 768px) {
	.header__nav {
		position: fixed;
		top: var(--header-height);
		right: -100%;
		width: 100%;
		height: calc(100vh - var(--header-height));
		background-color: var(--bg-color);
		transition: var(--transition);
	}

	.header__nav.is-active {
		right: 0;
	}

	.header__nav-list {
		flex-direction: column;
		padding-top: 3rem;
		gap: 2.5rem;
	}

	.header__nav-link {
		font-size: var(--h3-font-size);
	}

	.header__burger-button {
		display: block;
	}
}

/* ==================== REUSABLE CLASSES (дополнение) ==================== */
.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	background-color: var(--primary-color);
	color: var(--text-color);
	padding: 0.8rem 1.6rem;
	border-radius: var(--border-radius);
	font-weight: 500;
	transition: var(--transition);
	border: 2px solid transparent;
}

.button:hover {
	background-color: var(--primary-hover-color);
	transform: translateY(-2px);
}

.button__icon {
	transition: transform 0.3s ease;
}

.button:hover .button__icon {
	transform: translateX(4px);
}

/* ==================== HERO SECTION ==================== */
.hero {
	padding-top: calc(var(--header-height) + 4rem);
	padding-bottom: 4rem;
	min-height: 100vh;
	display: flex;
	align-items: center;
}

.hero__container {
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: center;
	gap: 3rem;
}

.hero__title {
	font-size: 2.5rem;
	line-height: 1.2;
	margin-bottom: 1.5rem;
}

.hero__description {
	font-size: 1.125rem;
	color: var(--text-color-light);
	margin-bottom: 2.5rem;
	max-width: 500px;
}

.hero__visual {
	background-color: var(--bg-secondary-color);
	border-radius: var(--border-radius);
	border: 1px solid #374151;
	overflow: hidden;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hero__visual-header {
	background-color: #374151;
	padding: 0.75rem;
	display: flex;
	gap: 0.5rem;
}

.hero__visual-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
}

.hero__visual-body {
	padding: 2rem;
	min-height: 100px;
}

.hero__visual-text {
	font-family: 'Courier New', Courier, monospace;
	font-size: 1.1rem;
	color: var(--text-color);
}

.hero__visual-cursor {
	display: inline-block;
	width: 10px;
	height: 1.2rem;
	background-color: var(--text-color);
	margin-left: 5px;
	animation: blink 1s infinite;
}

@keyframes blink {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0;
	}
}

/* ==================== RESPONSIVENESS (дополнение для Hero) ==================== */
@media screen and (max-width: 992px) {
	.hero__title {
		font-size: 1.5rem;
	}
}

@media screen and (max-width: 768px) {
	.hero {
		text-align: center;
		padding-top: calc(var(--header-height) + 2rem);
	}
	.hero__container {
		grid-template-columns: 1fr;
		gap: 4rem;
	}
	.hero__description {
		margin-inline: auto;
	}
}

/* ==================== REUSABLE CLASSES (дополнение) ==================== */
.section {
	padding-block: 5rem;
}

.section__header {
	text-align: center;
	margin-bottom: 3rem;
}

.section__title {
	font-size: var(--h2-font-size);
	margin-bottom: 0.75rem;
}

.section__subtitle {
	font-size: 1.125rem;
	color: var(--text-color-light);
	max-width: 600px;
	margin-inline: auto;
}

/* ==================== TYPES SECTION ==================== */
.types__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 1.5rem;
}

.types__card {
	background-color: var(--bg-secondary-color);
	padding: 2rem;
	border-radius: var(--border-radius);
	border: 1px solid #374151;
	transition: var(--transition);
}

.types__card:hover {
	transform: translateY(-5px);
	border-color: var(--primary-color);
}

.types__card-icon {
	width: 50px;
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: var(--primary-color);
	color: var(--text-color);
	border-radius: 50%;
	margin-bottom: 1.5rem;
}

.types__card-icon i {
	width: 28px;
	height: 28px;
}

.types__card-title {
	font-size: var(--h3-font-size);
	margin-bottom: 0.5rem;
}

.types__card-description {
	color: var(--text-color-light);
	line-height: 1.6;
}

/* ==================== PROCESS SECTION ==================== */
.process {
	background-color: var(--bg-secondary-color);
}

.process__timeline {
	position: relative;
	max-width: 800px;
	margin: 0 auto;
}

/* The vertical line */
.process__timeline::after {
	content: '';
	position: absolute;
	width: 3px;
	background-color: #374151;
	top: 0;
	bottom: 0;
	left: 50%;
	margin-left: -1.5px;
}

.process__item {
	padding: 1rem 2.5rem;
	position: relative;
	width: 50%;
	z-index: 5;
}

/* The circle on the timeline */
.process__step {
	position: absolute;
	width: 50px;
	height: 50px;
	right: -25px;
	top: 20px;
	background-color: var(--bg-color);
	border: 3px solid var(--primary-color);
	border-radius: 50%;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 1.1rem;
}

/* Place items to the left */
.process__item:nth-child(odd) {
	left: 0;
	text-align: right;
}

/* Place items to the right */
.process__item:nth-child(even) {
	left: 50%;
}

/* Adjust step circle position for left and right items */
.process__item:nth-child(even) .process__step {
	left: -25px;
}

.process__content {
	padding: 1.25rem;
	background-color: var(--bg-color);
	border-radius: var(--border-radius);
	border: 1px solid #374151;
}

.process__title {
	font-size: var(--h3-font-size);
	margin-bottom: 0.5rem;
	color: var(--primary-color);
}

.process__description {
	color: var(--text-color-light);
	line-height: 1.6;
}

/* ==================== RESPONSIVENESS (дополнение для Process) ==================== */
@media screen and (max-width: 768px) {
	.process__timeline::after {
		left: 30px;
	}

	.process__item {
		width: 100%;
		padding-left: 60px;
		padding-right: 15px;
	}

	.process__item:nth-child(odd),
	.process__item:nth-child(even) {
		left: 0;
		text-align: left;
	}

	.process__step,
	.process__item:nth-child(even) .process__step {
		left: 5px;
	}
}

/* ==================== TECH SECTION ==================== */
.tech__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1.5rem;
	max-width: 900px;
	margin-inline: auto;
}

.tech__item {
	background-color: var(--bg-secondary-color);
	padding: 1.5rem;
	border-radius: var(--border-radius);
	border: 1px solid #374151;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	text-align: center;
	font-weight: 500;
	font-size: 1.1rem;
	transition: var(--transition);
}

.tech__item:hover {
	transform: translateY(-5px);
	border-color: var(--primary-color);
	color: var(--primary-color);
}

.tech__item i {
	width: 40px;
	height: 40px;
	color: var(--primary-color);
}

/* ==================== CASES SECTION ==================== */
.cases {
	background-color: var(--bg-color); /* Возвращаем основной фон */
}

.cases__wrapper {
	display: flex;
	flex-direction: column;
	gap: 4rem;
}

.cases__item {
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: center;
	gap: 3rem;
}

/* Чередование для второго элемента */
.cases__item:nth-child(even) .cases__image {
	order: 2;
}

.cases__image img {
	border-radius: var(--border-radius);
	border: 1px solid #374151;
}

.cases__category {
	display: inline-block;
	background-color: var(--bg-secondary-color);
	color: var(--primary-color);
	padding: 0.25rem 0.75rem;
	border-radius: 999px;
	font-size: var(--small-font-size);
	font-weight: 500;
	margin-bottom: 1rem;
}

.cases__title {
	font-size: var(--h2-font-size);
	margin-bottom: 1rem;
}

.cases__description {
	color: var(--text-color-light);
	line-height: 1.7;
	margin-bottom: 1.5rem;
}

.cases__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.cases__tag {
	background-color: var(--bg-secondary-color);
	padding: 0.3rem 0.8rem;
	border-radius: var(--border-radius);
	font-size: var(--small-font-size);
}

/* ==================== RESPONSIVENESS (дополнение для Cases) ==================== */
@media screen and (max-width: 768px) {
	.cases__item,
	.cases__item:nth-child(even) {
		grid-template-columns: 1fr;
	}

	.cases__item:nth-child(even) .cases__image {
		order: 1; /* Возвращаем картинку наверх на мобильных */
	}

	.cases__content {
		order: 2;
	}
}

/* ==================== CONTACT SECTION ==================== */
.contact {
	background-color: var(--bg-secondary-color);
}

.contact__container {
	display: grid;
	grid-template-columns: 1fr 1.2fr;
	gap: 3rem;
	max-width: 1000px;
	margin-inline: auto;
	background-color: var(--bg-color);
	padding: 3rem;
	border-radius: var(--border-radius);
	border: 1px solid #374151;
}

.contact__info-title {
	font-size: var(--h2-font-size);
	margin-bottom: 1rem;
}

.contact__info-text {
	color: var(--text-color-light);
	margin-bottom: 2rem;
}

.contact__info .footer__list {
	font-size: var(--normal-font-size);
}

.contact__form {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.form__group {
	display: flex;
	flex-direction: column;
}

.form__label {
	margin-bottom: 0.5rem;
	font-weight: 500;
	font-size: var(--small-font-size);
}

.form__input {
	width: 100%;
	padding: 0.8rem 1rem;
	background-color: var(--bg-secondary-color);
	border: 1px solid #374151;
	border-radius: var(--border-radius);
	color: var(--text-color);
	font-size: var(--normal-font-size);
	transition: var(--transition);
}

.form__input:focus {
	outline: none;
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.3);
}

.form__group--checkbox {
	flex-direction: row;
	align-items: flex-start;
	gap: 0.75rem;
	font-size: var(--small-font-size);
}

.form__checkbox {
	margin-top: 3px;
	flex-shrink: 0;
}

.form__checkbox-label a {
	color: var(--primary-color);
	text-decoration: underline;
}

.contact__button {
	width: 100%;
}

.form__message {
	display: none; /* Скрыто по умолчанию */
	padding: 1rem;
	border-radius: var(--border-radius);
	text-align: center;
	font-weight: 500;
}

.form__message--success {
	background-color: #10b981; /* Green */
	color: #f3f4f6;
}

.form__message--error {
	background-color: #ef4444; /* Red */
	color: #f3f4f6;
}

/* ==================== RESPONSIVENESS (дополнение для Contact) ==================== */
@media screen and (max-width: 768px) {
	.contact__container {
		grid-template-columns: 1fr;
		padding: 2rem;
	}
}

/* ==================== COOKIE POPUP ==================== */
.cookie-popup {
	position: fixed;
	bottom: -100%; /* Скрыто по умолчанию */
	left: 0;
	width: 100%;
	background-color: var(--bg-secondary-color);
	border-top: 1px solid #374151;
	box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2);
	padding-block: 1rem;
	z-index: 200;
	transition: bottom 0.5s ease-in-out;
}

.cookie-popup.is-visible {
	bottom: 0; /* Показываем плавно */
}

.cookie-popup__container {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1.5rem;
}

.cookie-popup__text {
	color: var(--text-color-light);
	font-size: var(--small-font-size);
}

.cookie-popup__text a {
	color: var(--primary-color);
	text-decoration: underline;
}

.cookie-popup__button {
	padding: 0.5rem 1rem; /* Делаем кнопку чуть меньше */
	flex-shrink: 0;
}

/* ==================== RESPONSIVENESS (дополнение для Cookie) ==================== */
@media screen and (max-width: 768px) {
	.cookie-popup__container {
		flex-direction: column;
		text-align: center;
	}
}

/* ==================== POLICY PAGES ==================== */
.pages {
	padding-top: calc(var(--header-height) + 4rem);
	padding-bottom: 5rem;
}

/* Ограничиваем ширину для лучшей читабельности */
.pages .container {
	max-width: 800px;
}

.pages h1 {
	font-size: 1.5rem;
	margin-bottom: 2rem;
	border-bottom: 1px solid #374151;
	padding-bottom: 1rem;
}

.pages h2 {
	font-size: 1.5rem;
	margin-top: 2.5rem;
	margin-bottom: 1.5rem;
}

.pages p {
	color: var(--text-color-light);
	line-height: 1.8;
	margin-bottom: 1rem;
}

.pages ul {
	color: var(--text-color-light);
	line-height: 1.8;
	list-style-type: disc;
	padding-left: 25px;
	margin-bottom: 1.5rem;
}

.pages li {
	margin-bottom: 0.75rem;
}

.pages a {
	color: var(--primary-color);
	text-decoration: none;
	transition: var(--transition);
}

.pages a:hover {
	text-decoration: underline;
}

.pages strong {
	color: var(--text-color);
	font-weight: 700;
}
