/* #region Common */
body {
    font-family: 'Roboto', sans-serif;
    color: #434455;
    background-color: #fff;
}

img {
    display: block;
}

ul,
ol {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
}

h1, h2, h3, h4, h5, h6, p {
    margin: 0;
}

h1 {
    font-size: 56px;
    line-height: 1.07;
    text-align: center;
    letter-spacing: 0.02em;
}

.container {
    max-width: 1158px;
    padding: 0 15px;
    margin: 0 auto;
}
/* #endregion */
/* #region Header */
.logo {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 1.17;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #4d5ae5;
}

.header-logo {
    padding: 24px 0;
    margin-right: 76px;
}

.header-logo .logo-part {
    color: #2e2f42;
}

.footer-logo .footer-logo-part {
    color: #f4f4fd;
}

.nav-link {
    display: block;
    padding: 24px 0;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #2e2f42;
    transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link.current {
    position: relative;
}

.nav-link.current::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100%;
    height: 4px;
    background-color: #404BBF;
    border-radius: 2px;
}

.contacts {
    font-style: normal;
    margin-left: auto;
}

.contacts-link {
    display: block;
    padding: 24px 0;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #434455;
    transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.contacts-list {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-link:hover,
.nav-link:focus,
.contacts-link:hover,
.contacts-link:focus,
.nav-link.current {
    color: #404bbf;
}

.page-header {
    border-bottom: 1px solid #e7e9fc;
    box-shadow: 0 1px 6px 0 rgba(46, 47, 66, 0.08),
            0 1px 1px 0 rgba(46, 47, 66, 0.16), 0 2px 1px 0 rgba(46, 47, 66, 0.08);
}

.header-container {
    display: flex;
    align-items: center;
}

.header-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 40px;
}
/* #endregion */
/* #region First section */
.first-section {
    padding: 188px 0;
    color: #FFFFFF;
    background-image: linear-gradient(rgba(46, 47, 66, 0.7),
                rgba(46, 47, 66, 0.7)),
            url(../images/background/background.jpg);
    max-width: 1440px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    margin: 0 auto;
}

.first-section-order-button {
    display: block;
    min-width: 169px;
    height: 56px;
    border: none;
    border-radius: 4px;
    background-color: #4D5AE5;
    color: #FFFFFF;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.first-section-order-button:hover,
.first-section-order-button:focus {
    background-color: #404BBF;
    letter-spacing: 0.04em;
}

.first-section-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.first-section-header {
    max-width: 496px;
    margin-bottom: 48px;
}
/* #endregion */
/* #region Second section */
.second-section {
    padding: 120px 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    border: 0;
    padding: 0;
    white-space: nowrap;
    clip-path: inset(100%);
    /* Сучасний спосіб */
    clip: rect(0 0 0 0);
    /* Застарілий, але для сумісності */
    overflow: hidden;
}

.icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 112px;
    background-color: #f4f4fd;
    border-radius: 4px;
    border: 1px solid #8e8f99;
    margin-bottom: 8px;
}

.second-section-list {
    display: flex;
    gap: 24px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.second-section-element {
    width: calc((100% - 72px) / 4);
}

.second-section-subtitle {
    font-weight: 500;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: #2e2f42;
    margin-bottom: 8px;
}

.second-section-paragraphs {
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #434455;
}
/* #endregion */
/* #region Third section */
.third-section {
    background-color: #F4F4FD;
    padding: 120px 0;
}

.third-section-header {
    margin-bottom: 72px;
    font-size: 36px;
    line-height: 1.11;
    text-align: center;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    color: #2e2f42;
}

.third-section-list {
    display: flex;
    gap: 24px;
}

.third-section-list-item {
    background-color: #FFFFFF;
    width: calc((100% - 72px) / 4);
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 4px;
    
}

.container-name-title {
    padding: 32px 0;
}

.third-section-subtitle {
    font-weight: 500;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: #2e2f42;
    text-align: center;
    margin-bottom: 8px
}

.third-section-paragraph {
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    text-align: center;
}

.social-list {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.social-item {
    width: 40px;
    height: 40px;
}

.social-link {
    width: 100%;
    height: 100%;
    background-color: var(--color-primary, #4d5ae5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.social-link:hover,
.social-link:focus {
    background-color: #404bbf;
}

.social-icon {
    fill: var(--icon-color, #f4f4fd);
}

.third-section-list-item:first-child {
    box-shadow:
        0px 1px 6px rgba(46, 47, 66, 0.08),
        0px 1px 1px rgba(46, 47, 66, 0.16),
        0px 2px 1px rgba(46, 47, 66, 0.08);
}
/* #endregion */
/* #region Fourth section */
.fourth-section {
    padding-top: 120px;
    padding-bottom: 120px;
}

.third-section-header {
    margin-bottom: 72px;
}

.fourth-section-list {
    display: flex;
    flex-wrap: wrap;
    column-gap: 24px;
    row-gap: 48px;
}

.fourth-section-list-item {
    transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.container-fourth-section-name {
    padding: 32px 16px;
    border: 1px solid #e7e9fc;
    border-top: none;
}

.fourth-section-header {
    font-weight: 500;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: #2e2f42;
    margin-bottom: 8px;
}

.fourth-section-paragraph {
    line-height: 1.5;
    letter-spacing: 0.02em;
}

.img-wrap {
    position: relative;
    overflow: hidden;
}

.overlay-text {
    position: absolute;
    top: 0;
    padding: 40px 32px;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: var(--color-cloud, #f4f4fd);
    background-color: #4d5ae5;
    height: 100%;
    width: 100%;
    transform: translateY(100%);
    transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.fourth-section-list-item:hover {
    box-shadow: 0px 1px 6px rgba(46, 47, 66, 0.08),
        0px 1px 1px rgba(46, 47, 66, 0.16),
        0px 2px 1px rgba(46, 47, 66, 0.08);
}

.fourth-section-list-item:hover .overlay-text {
    transform: translateY(0%);
}
/* #endregion */
/* #region Footer */
.footer {
    background-color: #2e2f42;
    padding: 100px 0;
}

.container-footer {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    .footer-socials {
            position: relative;
            left: -100px;
        }
}

.footer-logo {
    display: inline-block;
    margin-bottom: 16px;
}

.footer-paragraph {
    line-height: 1.5;
    color: #f4f4fd;
    letter-spacing: 0.02em;
    max-width: 264px;
}

.social-media-text {
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: var(--white-color, #ffffff);
    margin-bottom: 16px;
}

.social-media-list {
    display: flex;
    gap: 16px;
}

.social-media-item {
    width: 40px;
    height: 40px;
}

.social-media-link {
    width: 100%;
    height: 100%;
    background-color: var(--icon-bg-color, #4d5ae5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.social-media-link:hover,
.social-media-link:focus {
    background-color: #31d0aa;
}

.social-media-icon {
    fill: var(--icon-color, #f4f4fd);
}
/* Subscribe */
.subscribe-container {
    display: flex;
    flex-direction: column;
    color: #ffffff;
    margin-left: -100px;
}

.subscribe-text {
    margin-bottom: 16px;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
}

.subscribe-form {
    display: flex;
    gap: 80px;
    align-items: center;
}

.subscribe-label {
    display: block;
}

.subscribe-input {
    width: 230px;
    height: 40px;
    border: 1px solid #ffffff;
    background-color: transparent;
    font-size: 12px;
    line-height: 2;
    letter-spacing: 0.04em;
    padding-left: 16px;
    color: #ffffff;
    box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    outline: none;
}

.subscribe-input::placeholder {
    color: #ffffff;
}

.subscribe-btn {
    min-width: 165px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: "Roboto", sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.04em;
    color: #ffffff;
    background-color: #4d5ae5;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    padding: 0 16px;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.subscribe-btn:hover,
.subscribe-btn:focus {
    background-color: #404bbf;
}

.subscribe-icon {
    margin-left: 16px;
    fill: #ffffff;
}
/* #endregion */
/* #region Modal */
:root {
    --navy: #2E2F42;
    --muted: #8e8f99;
    --accent: #4D5AE5;
    --accent-dark: #404bbf;
    --light: #F4F4FD;
}

/* Backdrop + modal */
.backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(46, 47, 66, 0.4);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1),
        visibility 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 408px;
    min-height: 584px;
    border-radius: 4px;
    transform: translate(-50%, -50%);
    background-color: #fcfcfc;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.14),
        0 1px 3px rgba(0, 0, 0, 0.12),
        0 2px 1px rgba(0, 0, 0, 0.2);
    padding: 72px 24px 24px 24px;
    transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.backdrop:not(.is-open) .modal {
    transform: translate(-50%, -100%);
}

/* Close button */
.modal-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e7e9fc;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0;
    cursor: pointer;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
        border 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close-icon {
    transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close-btn:hover,
.modal-close-btn:focus {
    background-color: var(--accent-dark);
    border: none;
}

.modal-close-btn:hover .modal-close-icon,
.modal-close-btn:focus .modal-close-icon {
    fill: #ffffff;
}

/* Title paragraph */
.modal-title {
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    text-align: center;
    letter-spacing: 0.02em;
    color: var(--navy);
    margin-bottom: 16px;
}

/* Form fields */
.field {
    margin-bottom: 8px;
}

.field-label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    line-height: 1.17;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.input-wrap {
    position: relative;
}

.text-input {
    width: 100%;
    height: 40px;
    border: 1px solid rgba(46, 47, 66, 0.4);
    border-radius: 4px;
    background-color: transparent;
    padding-left: 38px;
    outline: transparent;
    transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.text-input:focus {
    border-color: var(--accent);
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.text-input:focus+.input-icon {
    fill: var(--accent);
}

/* Textarea */
.field-area {
    margin-bottom: 16px;
}

.area-input {
    width: 100%;
    height: 120px;
    font-size: 12px;
    line-height: 1.17;
    letter-spacing: 0.04em;
    color: rgba(46, 47, 66, 0.4);
    border: 1px solid rgba(46, 47, 66, 0.4);
    border-radius: 4px;
    background-color: transparent;
    padding: 8px 16px;
    outline: transparent;
    resize: none;
    transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.area-input:focus {
    border-color: var(--accent);
}

/* Checkbox */
.agree {
    margin-bottom: 24px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    border: 0;
    padding: 0;
    white-space: nowrap;
    clip-path: inset(100%);
    clip: rect(0 0 0 0);
    overflow: hidden;
}

.agree-label {
    font-size: 12px;
    line-height: 1.17;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.checkbox-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(46, 47, 66, 0.4);
    border-radius: 2px;
    fill: transparent;
    margin-right: 8px;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
        border 250ms cubic-bezier(0.4, 0, 0.2, 1),
        fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

#user-privacy:checked+.agree-label .checkbox-box {
    background-color: var(--accent-dark);
    border: none;
    fill: var(--light);
}

.agree-link {
    color: var(--accent);
}

/* Submit button */
.form-btn {
    display: block;
    min-width: 169px;
    height: 56px;
    font-family: "Roboto", sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.04em;
    color: #ffffff;
    cursor: pointer;
    background-color: var(--accent);
    border: none;
    margin: 0 auto;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.form-btn:hover,
.form-btn:focus {
    background-color: var(--accent-dark);
}
/* #endregion */