:root {
    --primary-color: rgba(0, 200, 0, 1);
    --primary-dark: rgba(0, 120, 0, 1);
    --secondary-color: #2d3748;
    --dark-color: #1a202c;
    --light-color: #f7fafc;
    --gray-color: #e2e8f0;
    --dark-gray: #4a5568;
    --success-color: #48bb78;
    --error-color: #f56565;
    --warning-color: #ed8936;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--dark-color);
    color: var(--light-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

/* Шапка */
.header {
    background-color: rgba(26, 32, 44, 0.9);
    /*position: fixed;*/
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    padding: 15px 0;
}

.header.scrolled {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: rgba(26, 32, 44, 0.98);
    padding: 10px 0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--light-color);
    text-decoration: none;
    z-index: 1001;
}

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

.nav-menu {
    display: flex;
    list-style: none;
    transition: all 0.5s ease;
}

.nav-item {
    margin-left: 30px;
}

.nav-link {
    color: var(--gray-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
    font-size: 1.1rem;
}

.nav-link:hover {
    color: var(--light-color);
}

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

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

.hamburger {
    display: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
    background: transparent;
    border: none;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--light-color);
    transition: all 0.3s ease;
}

/* Основные секции */
section {
    padding: 100px 0;
    scroll-margin-top: 80px;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

/* Сертификаты */
.certificates-section {
    background-color: var(--secondary-color);
}
.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.certificate-mp-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    /*height: 260px;*/
    transition: transform 0.3s;
    border-bottom: 3px solid transparent;
}

.certificate-mp-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.certificate-mp-card:hover {
    border-bottom: 3px solid var(--primary-color);
}

.certificate-mp-card:hover img {
    transform: scale(1.1);
}

.certificate-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 20px;
    color: white;
    /*transform: translateY(100%);*/
    transition: transform 0.3s;
}

.certificate-card:hover .certificate-overlay {
    transform: translateY(0);
    /*border-buttom 3px transperent*/
}

.text-center {
    text-align: center;
}

/* Типовые задачи */
.tasks-section {
    /*background-color: var(--secondary-color);*/
}

.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.task-card {
    background-color: var(--secondary-color);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.task-card:hover {
    /*transform: translateY(-10px);*/
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    border-bottom: 3px solid var(--primary-color);
}

.task-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.task-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.task-card p {
    color: var(--gray-color);
    margin-bottom: 20px;
}

.task-more {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.task-more:hover {
    background-color: var(--primary-color);
    color: var(--light-color);
}

/* Контакты */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 50px;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.contact-info ul {
    list-style: none;
}

.contact-info li {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
}

.contact-info li a {
    text-decoration: none;
    color: var(--light-color);
}

.contact-info i {
    color: var(--primary-color);
    font-size: 1.3rem;
    width: 30px;
    text-align: center;
}

.contact-social {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.contact-social a {
    color: var(--light-color);
    font-size: 1.5rem;
    transition: color 0.3s, transform 0.3s;
}

.contact-social a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

.contact-form {
    background-color: var(--secondary-color);
    padding: 40px;
    border-radius: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 5px;
    background-color: var(--dark-color);
    color: var(--light-color);
    font-size: 1rem;
    transition: box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.3);
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

/* Подвал */
.footer {
    background-color: var(--secondary-color);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo .logo {
    font-size: 1.8rem;
    margin-bottom: 20px;
    display: inline-block;
}

.footer-logo p {
    color: var(--gray-color);
}

.footer-links h3,
.footer-contact h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--gray-color);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--light-color);
}

.footer-contact ul {
    list-style: none;
}

.footer-contact li {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gray-color);
}

.footer-contact i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.footer-contact a {
    text-decoration: none;
    color: var(--gray-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--dark-gray);
    color: var(--gray-color);
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    overflow-y: auto;
}

.modal-content {
    background-color: var(--secondary-color);
    margin: 2% auto;
    padding: 30px;
    border-radius: 10px;
    /*max-width: 800px;*/
    width: 55%;
    position: relative;
    animation: modalFadeIn 0.3s ease-out;
}
.certificates-modal .modal-content {
    width: 80%;
}
.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.8rem;
    color: var(--gray-color);
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--light-color);
}

.modal-task-info {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
}

.modal-task-icon {
    font-size: 3rem;
    color: var(--primary-color);
    min-width: 60px;
}

.task-features {
    list-style: none;
    margin: 15px 0;
}

.task-features li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.tech-tags span {
    background: var(--dark-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.task-price .price {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Анимации */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптивность */
@media (max-width: 992px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-text {
        margin-bottom: 50px;
    }

    .title {
        font-size: 2.8rem;
    }

    .section-title {
        font-size: 2.2rem;
    }
    .certificate-mp-card {
        /*height: 300px;*/
    }
    .cases-page, .page-content {
         padding: 30px 0;
     }

}

@media (max-width: 768px) {

    .close-modal {
        top: 0;
        right: 15px;
        z-index: 500;
        color: var(--primary-color)
    }
    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        background-color: var(--dark-color);
        flex-direction: column;
        align-items: center;
        padding: 30px 0;
        transition: 0.3s;
        z-index: 999;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 15px 0;
    }

    .nav-link {
        font-size: 1.2rem;
        opacity: 0;
        transform: translateY(-20px);
        transition: opacity 0.3s, transform 0.3s;
    }

    .nav-menu.active .nav-link {
        opacity: 1;
        transform: translateY(0);
    }

    .nav-menu.active .nav-item:nth-child(1) .nav-link {
        transition-delay: 0.1s;
    }

    .nav-menu.active .nav-item:nth-child(2) .nav-link {
        transition-delay: 0.2s;
    }

    .nav-menu.active .nav-item:nth-child(3) .nav-link {
        transition-delay: 0.3s;
    }

    .nav-menu.active .nav-item:nth-child(4) .nav-link {
        transition-delay: 0.4s;
    }

    .nav-menu.active .nav-item:nth-child(5) .nav-link {
        transition-delay: 0.5s;
    }

    .profile-img {
        width: 280px;
        height: 280px;
    }

    section {
        padding: 80px 0;
        scroll-margin-top: 70px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .certificates-grid {
        /*grid-template-columns: 1fr;*/
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .btn {
        padding: 10px 25px;
    }

    .profile-img {
        width: 220px;
        height: 220px;
    }

    .modal-content {
        padding: 10px;
        width: 95%;

    }
    .modal-case-content {
        gap: 10px;
    }
    ul {
        padding: 0 15px;
    }
    .close-modal {
        z-index: 999;
        color: var(--secondary-color);
        border-radius: 5px;
        width: 25px;
        height: 25px;

    }
    .hero {
        padding: 10px 0 10px;
    }


    .close-modal {
        top: 0;
        right: 15px;
        z-index: 500;
        color: var(--primary-color)
    }
    .hero-text {
        margin-bottom: 0;
    }
    .social-links {
        margin-bottom: 0;
    }
    .hero-image {
        margin-bottom: 30px;
    }
    .cases-page, .page-content {
        padding: 20px 0;
    }
}
.separator {
    padding: 20px 0;
}
/* Кнопка "Наверх" */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(108, 99, 255, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s ease-out;
    z-index: 999;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background: var(--primary-dark);
}

#back-to-top i {
    font-size: 1.5rem;
    position: relative;
    z-index: 2;
}

#progress-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

#progress-circle circle {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}

#progress-circle .bg {
    stroke: rgba(255, 255, 255, 0.2);
}

#progress-circle .progress {
    stroke: white;
    stroke-dasharray: 176;
    stroke-dashoffset: 176;
    transition: stroke-dashoffset 0.3s ease;
}

/* Общие стили для кнопок ошибок */
.btn-error {
    background: var(--primary-color);
    color: white;
    transition: all 0.3s ease;
}

.btn-error-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.btn-error:hover, .btn-error-outline:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(108, 99, 255, 0.3);
}
