/* =================================
   GLOBAL STYLES (ETAP 0)
   ================================= */

:root {
    --bg-color: hsl(234, 25%, 10%);
    --text-color: hsl(240, 8%, 90%);
    --accent-color: hsl(170, 100%, 50%);
    --secondary-color: hsl(235, 15%, 30%);
    --font-primary: 'Poppins', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-color);
}

ul {
    list-style: none;
}

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

/* =================================
   HEADER (ETAP 1)
   ================================= */

.header {
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: hsla(234, 25%, 10%, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--secondary-color);
}

.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header__logo {
    font-size: 1.5rem; /* 24px */
    font-weight: 600;
}

.header__menu {
    display: flex;
    gap: 30px;
}

.header__menu-link {
    font-size: 1rem; /* 16px */
    font-weight: 400;
    position: relative;
    padding-bottom: 5px;
}

.header__menu-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease-out;
}

.header__menu-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Mobile responsive for header */
@media (max-width: 768px) {
    .header__nav {
        /* In a future step, we can hide this and implement a burger menu button */
        display: none; 
    }
}


/* =================================
   FOOTER (ETAP 2)
   ================================= */

.footer {
    padding: 60px 0 0;
    background-color: hsl(234, 25%, 12%);
    border-top: 1px solid var(--secondary-color);
}

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

.footer__logo {
    font-size: 1.5rem; /* 24px */
    font-weight: 600;
    display: inline-block;
    margin-bottom: 15px;
}

.footer__tagline {
    font-size: 0.9rem;
    color: hsl(240, 8%, 70%);
    max-width: 250px;
}

.footer__heading {
    font-size: 1.1rem; /* 18px */
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-color);
}

.footer__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer__link {
    font-size: 0.95rem; /* 15px */
    color: hsl(240, 8%, 70%);
}

.footer__list--contacts .footer__link {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer__list--contacts i {
    width: 18px;
    height: 18px;
    color: var(--secondary-color);
    transition: color 0.3s ease;
}

.footer__link:hover i {
    color: var(--accent-color);
}

.footer__link--static {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: hsl(240, 8%, 70%);
}

.footer__bottom {
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid var(--secondary-color);
    font-size: 0.8rem;
    color: hsl(240, 8%, 50%);
}

/* =================================
   HERO SECTION (ETAP 3)
   ================================= */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px; /* Offset for fixed header */
    padding-bottom: 60px;
    overflow: hidden;
}

.hero__container {
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero__content {
    flex: 1;
    max-width: 600px;
}

.hero__title {
    font-size: 3.5rem; /* 56px */
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 25px;
}

.hero__title--animated {
    color: var(--accent-color);
    position: relative;
}

.hero__cursor {
    display: inline-block;
    width: 3px;
    height: 3.5rem;
    background-color: var(--accent-color);
    margin-left: 8px;
    animation: blink 1s infinite;
}

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

.hero__subtitle {
    font-size: 1.1rem; /* 18px */
    color: hsl(240, 8%, 80%);
    margin-bottom: 40px;
    max-width: 500px;
}

.hero__cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--bg-color);
    padding: 15px 35px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero__cta-button:hover {
    color: var(--bg-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px hsla(170, 100%, 50%, 0.2);
}

.hero__visual {
    flex: 0 0 45%;
    position: relative;
}

.hero__image {
    width: 100%;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: glow 4s infinite alternate, morph 10s infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 20px -10px hsla(170, 100%, 50%, 0.4);
    }
    to {
        box-shadow: 0 0 40px 10px hsla(170, 100%, 50%, 0.6);
    }
}

@keyframes morph {
    0% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
    50% {
         border-radius: 60% 40% 30% 70% / 60% 70% 30% 40%;
    }
    100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
}

/* Responsive for Hero */
@media (max-width: 992px) {
    .hero__title {
        font-size: 2.8rem;
    }
    .hero__cursor {
        height: 2.8rem;
    }
}

@media (max-width: 768px) {
    .hero {
        text-align: center;
    }
    .hero__container {
        flex-direction: column;
        gap: 40px;
    }
    .hero__content {
        max-width: 100%;
        order: 2; /* Text goes below image on mobile */
    }
    .hero__title {
        font-size: 2.2rem;
    }
    .hero__cursor {
        height: 2.2rem;
    }
    .hero__subtitle {
        margin-left: auto;
        margin-right: auto;
    }
    .hero__visual {
        order: 1;
        width: 70%;
        max-width: 300px;
    }
}

/* =================================
   SHARED SECTION STYLES
   ================================= */
.section-title,
.section-subtitle {
    text-align: center;
}

.section-title {
    font-size: 2.5rem; /* 40px */
    font-weight: 600;
    margin-bottom: 15px;
}

.section-subtitle {
    font-size: 1.1rem; /* 18px */
    color: hsl(240, 8%, 80%);
    max-width: 600px;
    margin: 0 auto 60px auto;
}


/* =================================
   COURSES SECTION (ETAP 3)
   ================================= */

.courses {
    padding: 100px 0;
    background-color: hsl(234, 25%, 12%); /* Slightly different bg */
}

.courses__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.course-card {
    background-color: var(--bg-color);
    border: 1px solid var(--secondary-color);
    border-radius: 12px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.course-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.course-card__icon {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    background-color: var(--secondary-color);
    border-radius: 8px;
    margin-bottom: 25px;
}

.course-card__icon i {
    width: 28px;
    height: 28px;
    color: var(--accent-color);
}

.course-card__title {
    font-size: 1.4rem; /* 22px */
    font-weight: 600;
    margin-bottom: 15px;
}

.course-card__description {
    font-size: 0.95rem;
    color: hsl(240, 8%, 80%);
    margin-bottom: 25px;
    flex-grow: 1; /* Pushes the link to the bottom */
}

.course-card__tech {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.tech-tag {
    background-color: hsl(235, 15%, 22%);
    color: hsl(240, 8%, 80%);
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: 5px;
}

.course-card__link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: hsl(240, 8%, 70%);
}

.course-card:hover .course-card__link {
    color: var(--accent-color);
}

.course-card__link i {
    transition: transform 0.3s ease;
}

.course-card:hover .course-card__link i {
    transform: translateX(5px);
}


/* Responsive for Courses */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem; /* 32px */
    }
    .courses {
        padding: 80px 0;
    }
}

/* =================================
   PROCESS SECTION (ETAP 3)
   ================================= */
.process {
    padding: 100px 0;
}

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

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

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    /* Animation initial state */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* The circle on the timeline */
.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--bg-color);
    border: 3px solid var(--accent-color);
    top: 20px;
    border-radius: 50%;
    z-index: 1;
}

/* Position items */
.timeline-item:nth-child(odd) {
    left: 0;
    padding-left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
    padding-right: 0;
}

.timeline-item:nth-child(even)::after {
    left: -10px;
}

/* Animation final state */
.timeline-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item__content {
    padding: 20px 30px;
    background-color: hsl(234, 25%, 12%);
    border: 1px solid var(--secondary-color);
    border-radius: 8px;
    position: relative;
}

.timeline-item__step {
    position: absolute;
    top: -15px;
    right: 20px;
    font-size: 2rem;
    font-weight: 600;
    color: hsla(235, 15%, 30%, 0.5);
}

.timeline-item__title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.timeline-item__description {
    font-size: 0.95rem;
    color: hsl(240, 8%, 80%);
}


/* Responsive for Process */
@media screen and (max-width: 768px) {
    .process__timeline::after {
        left: 20px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 60px;
        padding-right: 15px;
        left: 0 !important; /* Override inline style from JS if any */
    }

    .timeline-item::after {
        left: 10px;
    }
}

/* =================================
   MENTORS SECTION (ETAP 3)
   ================================= */
.mentors {
    padding: 100px 0;
    background-color: hsl(234, 25%, 12%); /* Match courses section bg */
}

.mentors__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
}

.mentor-card {
    background: var(--bg-color);
    border: 1px solid var(--secondary-color);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mentor-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
}

.mentor-card__image-wrapper {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px auto;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--secondary-color);
    transition: border-color 0.3s ease;
}

.mentor-card:hover .mentor-card__image-wrapper {
    border-color: var(--accent-color);
}

.mentor-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mentor-card__name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.mentor-card__role {
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    min-height: 30px; /* Reserve space */
}

.mentor-card__quote {
    font-size: 0.9rem;
    color: hsl(240, 8%, 80%);
    font-style: italic;
    border: none;
    padding: 0;
    position: relative;
    
    /* Initially hidden */
    opacity: 0;
    max-height: 0;
    margin-top: 0;
    overflow: hidden;
    transition: opacity 0.4s ease, max-height 0.4s ease, margin-top 0.4s ease;
}

.mentor-card:hover .mentor-card__quote {
    opacity: 1;
    max-height: 200px; /* Set high enough to fit content */
    margin-top: 15px;
}

.mentor-card__quote::before {
    content: '“';
    font-size: 2rem;
    color: var(--secondary-color);
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
}

/* =================================
   REVIEWS SECTION (ETAP 3)
   ================================= */
.reviews {
    padding: 100px 0;
}

.reviews-slider {
    max-width: 850px;
    margin: 0 auto;
    padding: 0 10px 40px 10px; /* Padding for buttons/pagination */
}

.review-card {
    background-color: hsl(234, 25%, 12%);
    border: 1px solid var(--secondary-color);
    border-radius: 12px;
    padding: 40px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.review-card__icon {
    color: var(--accent-color);
    width: 32px;
    height: 32px;
    margin-bottom: 20px;
}

.review-card__text {
    font-size: 1.1rem;
    font-style: italic;
    line-height: 1.7;
    flex-grow: 1;
    margin-bottom: 30px;
}

.review-card__author {
    display: flex;
    align-items: center;
    gap: 15px;
}

.review-card__author-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.review-card__author-info {
    display: flex;
    flex-direction: column;
}

.review-card__author-name {
    font-weight: 600;
}

.review-card__author-role {
    font-size: 0.9rem;
    color: hsl(240, 8%, 70%);
}

/* Swiper custom styles */
.swiper-button-next,
.swiper-button-prev {
    color: var(--accent-color);
    transition: transform 0.2s ease;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    transform: scale(1.1);
}

.swiper-pagination-bullet {
    background-color: var(--secondary-color);
    width: 10px;
    height: 10px;
    opacity: 0.8;
}

.swiper-pagination-bullet-active {
    background-color: var(--accent-color);
}

/* =================================
   CONTACT SECTION (ETAP 4)
   ================================= */
.contact {
    padding: 100px 0;
}

.contact__wrapper {
    max-width: 700px;
    margin: 0 auto;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.contact-form__group {
    position: relative;
}

.contact-form__input {
    width: 100%;
    padding: 15px;
    background-color: hsl(234, 25%, 15%);
    border: 1px solid var(--secondary-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    font-family: var(--font-primary);
    transition: border-color 0.3s ease;
}

.contact-form__input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.contact-form__label {
    position: absolute;
    top: 16px;
    left: 16px;
    color: hsl(240, 8%, 70%);
    transition: all 0.2s ease;
}

/* Floating label effect */
.contact-form__input:focus + .contact-form__label,
.contact-form__input:not(:placeholder-shown) + .contact-form__label {
    top: -10px;
    left: 12px;
    font-size: 0.8rem;
    background-color: var(--bg-color);
    padding: 0 5px;
    color: var(--accent-color);
}

.contact-form__captcha-label {
    display: block;
    margin-bottom: 10px;
    color: hsl(240, 8%, 80%);
}

.contact-form__submit-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--bg-color);
    padding: 15px 35px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.contact-form__submit-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px hsla(170, 100%, 50%, 0.2);
}

.contact-form__submit-button:disabled {
    background-color: var(--secondary-color);
    cursor: not-allowed;
}

/* Form messages */
.form-message {
    padding: 20px;
    margin-top: 20px;
    border-radius: 8px;
    text-align: center;
}
.form-message i {
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
}
.form-message h4 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.form-message--success {
    background-color: hsla(170, 100%, 25%, 0.2);
    border: 1px solid var(--accent-color);
    color: var(--text-color);
}
.form-message--success i { color: var(--accent-color); }

.form-message--error {
    background-color: hsla(0, 80%, 40%, 0.2);
    border: 1px solid hsl(0, 80%, 60%);
    color: hsl(0, 80%, 90%);
}
.form-message--error i { color: hsl(0, 80%, 60%); }

/* =================================
   COOKIE POPUP (ETAP 5)
   ================================= */

.cookie-popup {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 1160px;
    background-color: hsl(234, 25%, 15%);
    color: var(--text-color);
    padding: 15px 25px;
    border-radius: 12px;
    border: 1px solid var(--secondary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    z-index: 2000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);

    /* Animation */
    opacity: 0;
    transform: translate(-50%, 20px);
    visibility: hidden;
    transition: opacity 0.5s ease, transform 0.5s ease, visibility 0.5s;
}

.cookie-popup.is-visible {
    opacity: 1;
    transform: translateX(-50%);
    visibility: visible;
}

.cookie-popup__text {
    font-size: 0.9rem;
}

.cookie-popup__link {
    color: var(--accent-color);
    text-decoration: underline;
}

.cookie-popup__link:hover {
    text-decoration: none;
}

.cookie-popup__button {
    background-color: var(--accent-color);
    color: var(--bg-color);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

.cookie-popup__button:hover {
    background-color: hsl(170, 100%, 65%);
}

@media (max-width: 768px) {
    .cookie-popup {
        flex-direction: column;
        text-align: center;
    }
}

/* =================================
   POLICY PAGES STYLES (ETAP 5)
   ================================= */

.pages .container {
    max-width: 800px; /* Optimal width for reading text */
}

.pages {
    padding-top: 120px; /* Offset for fixed header */
    padding-bottom: 80px;
}

.pages h1, .pages h2 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-color);
}

.pages h1 {
    font-size: 2.8rem;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 15px;
}

.pages h2 {
    font-size: 1.8rem;
    margin-top: 40px;
    margin-bottom: 20px;
}

.pages p, .pages li {
    font-size: 1.05rem;
    line-height: 1.8;
    color: hsl(240, 8%, 85%);
    margin-bottom: 20px;
}

.pages ul {
    list-style-position: outside;
    list-style-type: disc;
    padding-left: 25px;
}

.pages a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid hsla(170, 100%, 50%, 0.5);
    transition: all 0.2s ease;
}

.pages a:hover {
    background-color: hsla(170, 100%, 50%, 0.1);
    border-bottom-color: var(--accent-color);
}

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

/* Responsive for pages */
@media (max-width: 768px) {
    .pages h1 { font-size: 2rem; }
    .pages h2 { font-size: 1.5rem; }
}

.contact-form__group--checkbox {
  display: flex;
  align-items: flex-start; /* Вирівнювання чекбокса по верхньому краю тексту */
  margin-top: 20px; /* Відступ зверху від попереднього поля */
  margin-bottom: 20px; /* Відступ знизу до кнопки */
}

.contact-form__checkbox {
  flex-shrink: 0; /* Запобігає стисненню чекбокса */
  width: 16px; /* Розмір чекбокса */
  height: 16px; /* Розмір чекбокса */
  margin-right: 10px; /* Відступ між чекбоксом і текстом мітки */
  margin-top: 3px; /* Невеликий відступ зверху для візуального вирівнювання з текстом */
  cursor: pointer;
}

.contact-form__label--checkbox {
  font-weight: normal; /* Звичайний шрифт для тексту мітки */
  cursor: pointer;
  line-height: 1.4; /* Міжрядковий інтервал для кращої читабельності */
  /* Тут можуть бути додаткові стилі, якщо вони впливають на вирівнювання */
  /* наприклад, якщо у contact-form__label є margin-bottom, який потрібно прибрати */
  margin-bottom: 0;
}

/* Стилі для посилань всередині чекбокса */
.contact-form__label--checkbox a {
  cursor: pointer;
}

.contact-form__label--checkbox a:hover {
  /* text-decoration: underline; */
}