:root {
    --contact-accent: #ff2c2c;
    --contact-accent-hover: #d82222;
    --contact-text: #f5f6f8;
    --contact-muted: rgba(245, 246, 248, 0.72);
    --contact-line: rgba(255, 255, 255, 0.18);
    --contact-panel: rgba(12, 15, 22, 0.62);
    --contact-field: rgba(255, 255, 255, 0.02);
    --contact-footer-safe-space: 220px;
}



body.contact-footer-on-scroll #page-contact .snap-section {
    min-height: auto !important;
    padding-bottom: 56px !important;
}

body.contact-footer-on-scroll .page-footer {
    position: relative !important;
    left: auto !important;
    bottom: auto !important;
    width: 100% !important;
    z-index: 10 !important;
}

#page-contact .snap-section {
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    min-height: calc(100vh - var(--contact-footer-safe-space)) !important;
    padding: 150px 0 56px !important;
    box-sizing: border-box;
    overflow: visible;
}

#page-contact .contact-layout {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1600px;
    padding: 0 80px;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(520px, 860px);
    gap: 56px;
    align-items: start;
}

#page-contact .sub-header,
#page-contact .contact-container {
    width: 100%;
    padding: 0;
    box-sizing: border-box;
}

#page-contact .sub-header {
    margin: 0;
    padding-top: 8px;
    text-align: left;
    animation: contactFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

#page-contact .sub-header h1 {
    margin: 0;
    font-size: clamp(27px, 3.4vw, 40px);
    font-weight: 700;
    line-height: 1.2;
    color: var(--contact-text);
    letter-spacing: -0.02em;
}

#page-contact .sub-header p {
    margin: 0;
    padding-top: 14px;
    max-width: 560px;
    color: rgba(255, 255, 255, 0.75);
    font-size: clamp(15px, 1.3vw, 18px);
    line-height: 1.7;
}

.contact-container {
    margin: 0;
    animation: contactFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

.contact-box {
    width: 100%;
    max-width: none;
    background: transparent;
    border: 1px solid var(--contact-line);
    border-radius: 0;
    padding: 32px 30px 26px;
    box-sizing: border-box;
    max-height: none;
    overflow: visible;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 18px;
}

.form-grid .input-group {
    margin-bottom: 0;
}

.input-group label {
    margin: 0 0 9px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.35;
    letter-spacing: 0.01em;
}

.input-group label.req-label::after {
    content: "*";
    color: var(--contact-accent);
    margin-left: 4px;
    font-size: 12px;
    vertical-align: super;
}

.input-group.align-top {
    align-items: flex-start !important;
}

.contact-section-margin,
.textarea-group {
    margin-top: 2px !important;
}

input[type="text"],
select,
textarea {
    width: 100%;
    border: 1px solid var(--contact-line) !important;
    background: var(--contact-field) !important;
    color: #ffffff;
    font-size: 15px;
    line-height: 1.5;
    border-radius: 0 !important;
    outline: none;
    font-family: inherit;
    box-shadow: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input[type="text"],
select {
    height: 50px;
    padding: 0 14px;
}

textarea {
    min-height: 160px;
    resize: vertical;
    padding: 14px;
}

input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.36);
    font-size: 14px;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
    border-color: var(--contact-accent) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    box-shadow: 0 0 0 3px rgba(255, 44, 44, 0.16) !important;
}

.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 16px;
    width: 7px;
    height: 7px;
    border-right: 1.6px solid rgba(255, 255, 255, 0.72);
    border-bottom: 1.6px solid rgba(255, 255, 255, 0.72);
    transform: translateY(-60%) rotate(45deg);
    pointer-events: none;
}

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 38px;
    cursor: pointer;
}

select option {
    background: #161a22;
    color: #ffffff;
}

.privacy-agreement {
    display: flex;
    justify-content: flex-start;
    margin: 10px 0 22px;
    width: 100%;
}

.custom-checkbox {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    user-select: none;
    color: rgba(255, 255, 255, 0.84);
    font-size: 14px;
    line-height: 1.42;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    border-radius: 4px;
    border: 1px solid var(--contact-line);
    background: transparent;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.custom-checkbox:hover .checkmark {
    border-color: var(--contact-accent);
}

.custom-checkbox input:checked ~ .checkmark {
    background: var(--contact-accent);
    border-color: var(--contact-accent);
}

.checkmark::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1.5px;
    width: 5px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    display: none;
}

.custom-checkbox input:checked ~ .checkmark::after {
    display: block;
}

.custom-checkbox .req {
    color: var(--contact-accent);
    margin-left: 4px;
}

.contact-send-btn {
    width: 100%;
    height: 52px;
    border-radius: 0 !important;
    border: none !important;
    background: var(--contact-accent) !important;
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.contact-send-btn:hover {
    background: var(--contact-accent-hover) !important;
    transform: translateY(-1px);
}

.contact-send-btn:active {
    transform: translateY(0);
}

.contact-result {
    min-height: 22px;
    margin-top: 14px;
    font-size: 14px;
    text-align: left;
}

@keyframes contactFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    #page-contact .contact-layout {
        padding: 0 40px;
        grid-template-columns: 1fr;
        gap: 28px;
    }

    #page-contact .sub-header {
        padding-top: 0;
    }
}

@media (max-width: 768px) {
    #page-contact .snap-section {
        min-height: 100dvh !important;
        padding: 110px 0 70px !important;
    }

    #page-contact .contact-layout {
        padding: 0 20px;
        gap: 20px;
    }

    #page-contact .sub-header {
        margin: 0;
    }

    #page-contact .sub-header h1 {
        font-size: clamp(24px, 7.2vw, 32px);
    }

    .contact-box {
        max-height: none;
        overflow-y: visible;
        padding: 22px 16px 18px;
        border-radius: 0;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 16px;
    }

    .input-group,
    .form-grid .input-group {
        margin-bottom: 16px;
    }

    .custom-checkbox {
        font-size: 13px;
    }

    .contact-send-btn {
        height: 50px;
        font-size: 15px;
    }

    .contact-result {
        margin-top: 12px;
        font-size: 13px;
    }
}
