/* Contacts Page Styles */

/* Reset base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Page container */
.contacts-page {
    background-color: #f3f4f7;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* First Screen Section */
.contacts-first-screen {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(100% - 64px);
    margin: 80px auto 0;
    padding: 128px 0;
    background: linear-gradient(135deg, #1764ff 0%, #377CF7 100%);
    border-radius: 64px;
    text-align: center;
}

.contacts-badge {
    position: relative;
    display: inline-flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
    max-width: fit-content;
    padding: 4px 16px;
    color: #fff;
    font-weight: 500;
    font-size: 20px;
    line-height: 22px;
    background-color: transparent;
    border: 1px solid #fff;
    border-radius: 4px;
}

.contacts-title {
    position: relative;
    display: block;
    max-width: 1010px;
    margin: 40px auto 0;
    padding: 0;
    color: #fff;
    font-weight: 500;
    font-size: 68px;
    line-height: 110%;
    letter-spacing: -3px;
    text-align: center;
    font-family: 'Gilroy-Medium';
}

.contacts-subtitle {
    position: relative;
    display: block;
    width: 100%;
    max-width: 800px;
    margin: 24px auto 0;
    color: #fff;
    font-weight: 400;
    font-size: 20px;
    line-height: 32px;
    text-align: center;
    font-family: 'Gilroy-Regular';
}

/* Spacer */
.spacer {
    position: relative;
    z-index: -1;
    display: block;
    width: 100%;
    background-color: transparent;
}

.spacer-3 {
    padding: 48px 0;
}

.spacer-4 {
    padding: 64px 0;
}

/* Connect Section */
.contacts-connect {
    background: transparent;
    padding: 0 32px;
}

.contacts-connect-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
    list-style: none;
}

.contacts-connect-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 32px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    flex: 1;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contacts-connect-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}

.contacts-connect-icon {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.contacts-connect-icon img {
    width: 64px;
    height: 64px;
    max-width: 100%;
    object-fit: contain;
}

.contacts-connect-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contacts-connect-title {
    color: #16181d;
    font-weight: 600;
    font-size: 20px;
    line-height: 28px;
    margin-bottom: 16px;
    text-align: center;
}

.contacts-connect-link {
    color: #377CF7;
    font-weight: 500;
    font-size: 16px;
    line-height: 24px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contacts-connect-link:hover {
    color: #1764ff;
    text-decoration: underline;
}

/* Form Section */
.contacts-form {
    position: relative;
    background: transparent;
    padding: 0 32px;
}

.contacts-form-container {
    display: flex;
    gap: 32px;
    justify-content: space-between;
    max-width: 1144px;
    margin: 0 auto;
    padding: 64px;
    background-color: #001133;
    border-radius: 48px;
}

.contacts-form-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.contacts-form-title {
    position: relative;
    color: #fff;
    font-weight: 500;
    font-size: 68px;
    line-height: 110%;
    letter-spacing: -3px;
    margin-bottom: 0;
}

.contacts-form-icon {
    position: absolute;
    bottom: -12px;
    left: 0;
    display: flex;
    width: 334px;
    max-width: 100%;
    height: auto;
}

.contacts-form-subtitle {
    max-width: 347px;
    color: #fff;
    font-weight: 400;
    font-size: 20px;
    line-height: 32px;
    margin-bottom: 0;
}

/* Social Media Icons - Refactored */
.contacts-form-socials {
    display: flex;
    gap: 16px;
    margin-top: auto;
    padding: 0;
    list-style: none;
    align-items: center;
}

.contacts-form-social {
    width: 56px;
    height: 56px;
    padding: 0;
    background-color: #fff;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contacts-form-social:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.contacts-form-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

/* FontAwesome Icons */
.contacts-form-social i {
    font-size: 24px;
    color: #16181d;
    transition: color 0.3s ease;
}

/* VK Icon */
.contacts-form-social:nth-child(1):hover i {
    color: #4c75a3;
}

/* Telegram Icon */
.contacts-form-social:nth-child(2):hover i {
    color: #0088cc;
}

/* Zen Text Icon */
.zen-text-icon {
    color: #ff6600;
    font-size: 24px;
    font-weight: bold;
    font-family: 'Arial', sans-serif;
    line-height: 1;
    transition: color 0.3s ease;
}

.contacts-form-social:nth-child(3):hover .zen-text-icon {
    color: #ff4500;
}

/* Form Wrapper */
.contacts-form-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    max-width: 458px;
    margin: 0 auto;
    font-family: 'Aeonik Pro', sans-serif;
}

.contacts-form-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Input Styles - Based on original design */
.contacts-input-label {
    position: relative;
    width: 100%;
}

.contacts-input-label + .contacts-input-label {
    margin-top: 16px;
}

.contacts-input-box {
    position: relative;
    display: block;
}

.contacts-input {
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    padding: 14px 16px;
    color: #16181d;
    font-weight: 400;
    font-size: 16px;
    font-family: 'Aeonik Pro', sans-serif;
    font-style: normal;
    line-height: 28px;
    background-color: #fff;
    border: 1px solid #cbcfd8;
    border-radius: 8px;
}

.contacts-input:focus {
    border-color: #16181d;
    outline: 2px solid #80aaff;
}

.contacts-input:hover {
    border-color: #16181d;
}

.contacts-input::placeholder {
    color: #667085;
}

/* Tooltip */
.contacts-input-tooltip {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

/* Override any inline transform styles that might cause issues */
.tooltip-content[style*="transform"] {
    transform: none !important;
}

.tooltip-content[style*="translate3d"] {
    transform: none !important;
}

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-icon {
    color: #9ca3af;
    font-size: 18px;
    cursor: help;
}

.tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: -10px;
    right: 100%;
    margin-right: 12px;
    width: 280px;
    max-width: calc(100vw - 60px);
    background-color: #16181d;
    color: #fff;
    text-align: left;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 20px;
    z-index: 1000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    transform: none !important;
    will-change: auto;
}

.tooltip-content::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #16181d;
}

.tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

/* Textarea */
.contacts-textarea-label {
    position: relative;
    width: 100%;
}

.contacts-textarea-label + .contacts-textarea-label,
.contacts-textarea-label:not(:first-child) {
    margin-top: 16px;
}

.contacts-textarea-box {
    position: relative;
}

.contacts-textarea {
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    height: 122px;
    padding: 14px 16px;
    color: #16181d;
    font-weight: 400;
    font-size: 16px;
    font-family: 'Aeonik Pro', sans-serif;
    font-style: normal;
    line-height: 28px;
    background-color: #fff;
    border: 1px solid #cbcfd8;
    border-radius: 8px;
    resize: none;
}

.contacts-textarea:focus {
    border-color: #16181d;
    outline: 2px solid #80aaff;
}

.contacts-textarea:hover {
    border-color: #16181d;
}

.contacts-textarea::placeholder {
    color: #a3adc2;
}

/* Checkbox */
.contacts-checkbox {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    color: #fff;
    font-size: 14px;
    line-height: 20px;
    top: 10px;
    text-align: justify;
}

.contacts-checkbox-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.contacts-checkbox-check {
    position: relative;
    width: 20px;
    height: 20px;
    border: 2px solid rgb(203, 207, 216);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 0;
}

.contacts-checkbox-check::after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 3px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.contacts-checkbox:hover .contacts-checkbox-check {
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.contacts-checkbox-input:checked + .contacts-checkbox-check {
    background-color: #377CF7;
    border-color: #377CF7;
}

.contacts-checkbox-input:checked + .contacts-checkbox-check::after {
    display: block;
}

/* Submit Button */
.contacts-form-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin-top: 16px;
    padding: 16px 24px;
    background: #377CF7;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Aeonik Pro', sans-serif;
}

.contacts-form-button:hover {
    background: #1764ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(55, 124, 247, 0.3);
}

.contacts-form-button:active {
    transform: translateY(0);
}

.contacts-form-button-icon {
    flex-shrink: 0;
}

/* Form Text */
.contacts-form-text {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 16px 0;
    color: #fff;
    font-weight: 400;
    font-size: 11px;
    font-style: normal;
    line-height: 1.5;
}

.contacts-form-link {
    margin-left: 4px;
    color: #fff;
    text-decoration: underline;
}

.contacts-form-link:hover {
    color: #fff;
    text-decoration: underline;
}

/* Responsive Design */
@media screen and (max-width: 1144px) {
    .contacts-first-screen {
        width: calc(100% - 32px);
        margin: 70px auto 0;
        padding: 80px 24px;
        border-radius: 24px;
    }

    .contacts-title {
        margin-top: 32px;
        font-weight: 600;
        font-size: 32px;
        line-height: 44px;
        letter-spacing: unset;
    }

    .contacts-subtitle {
        margin-top: 16px;
        font-size: 18px;
        line-height: 140%;
    }

    .contacts-connect {
        padding: 0 16px;
    }

    ol, ul {
        padding-left: 0;
    }

    .contacts-connect-container {
        flex-direction: column;
        gap: 20px;
    }

    .contacts-connect-item {
        padding: 32px 24px;
    }

    .contacts-form {
        padding: 0 16px;
    }

    .contacts-form-container {
        flex-direction: column;
        margin: 0 16px;
        padding: 24px;
        border-radius: 24px;
    }

    .contacts-form-socials {
        gap: 12px;
        justify-content: center;
    }

    .contacts-form-title {
        font-weight: 500;
        font-size: 30px;
        line-height: 124%;
        letter-spacing: unset;
    }

    .contacts-form-content {
        text-align: center;
    }

    .contacts-form-subtitle {
        max-width: unset;
        font-size: 18px;
        line-height: 140%;
    }

    .contacts-form-icon {
        right: 0;
        width: 164px;
        margin: 0 auto;
    }

    .spacer-3 {
        padding: 24px 0;
    }

    .spacer-4 {
        padding: 32px 0;
    }
}

@media screen and (max-width: 768px) {
    .contacts-first-screen {
        padding: 60px 20px;
    }

    .contacts-title {
        font-size: 28px;
        line-height: 36px;
    }

    .contacts-subtitle {
        font-size: 16px;
        line-height: 24px;
    }

    .contacts-connect-item {
        padding: 24px 20px;
    }

    .contacts-connect-title {
        font-size: 18px;
        line-height: 24px;
    }

    .contacts-form-title {
        font-size: 28px;
        line-height: 36px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .contacts-form-wrapper {
        padding: 24px 20px;
    }

    .contacts-form-socials {
        justify-content: center;
        gap: 12px;
    }

    .contacts-form-social {
        width: 48px;
        height: 48px;
    }

    .contacts-form-social i {
        font-size: 20px;
    }

    .zen-text-icon {
        font-size: 20px;
    }

    .tooltip-content {
        width: 240px;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        top: calc(100% + 12px);
    }

    .tooltip-content::after {
        top: -6px;
        left: 50%;
        transform: translateX(-50%);
        border: 6px solid transparent;
        border-bottom-color: #16181d;
        border-left-color: transparent;
    }
}

@media screen and (max-width: 640px) {
    .contacts-first-screen {
        width: calc(100% - 20px);
        margin: 50px auto 0;
        padding: 48px 16px;
    }

    .contacts-form-icon {
        width: 120px;
        position: relative;
        bottom: auto;
        left: auto;
        margin: 12px auto 0;
    }

    .contacts-form-container {
        padding: 20px 16px;
        margin: 0 8px;
    }

    .contacts-connect {
        padding: 0 8px;
    }

    .contacts-connect-container {
        gap: 16px;
    }

    .contacts-connect-item {
        padding: 20px 16px;
    }

    .tooltip-content {
        width: 240px;
        max-width: calc(100vw - 40px);
        transform: none !important;
        right: auto;
        left: 50%;
        margin-left: -120px;
        margin-right: 0;
        top: calc(100% + 12px);
    }

    .tooltip-content::after {
        top: -6px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        border: 6px solid transparent;
        border-bottom-color: #16181d;
        border-left-color: transparent;
    }

    .contacts-form-wrapper {
        max-width: 100%;
        width: 100%;
        padding: 0;
    }

    .contacts-input,
    .contacts-textarea {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .contacts-form-button {
        width: 100%;
        max-width: 100%;
    }

    /* Ensure no element causes horizontal scroll */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Force override any problematic inline styles */
    .tooltip-content[style] {
        transform: none !important;
        translate: none !important;
        left: 50% !important;
        right: auto !important;
        margin-left: -120px !important;
        width: 240px !important;
        max-width: calc(100vw - 40px) !important;
    }

    .contacts-input-tooltip {
        overflow: visible;
        contain: none;
    }
}

@media screen and (max-width: 480px) {
    .contacts-first-screen {
        padding: 40px 16px;
    }

    .contacts-title {
        font-size: 24px;
        line-height: 32px;
    }

    .contacts-subtitle {
        font-size: 14px;
        line-height: 20px;
    }

    .contacts-connect-item {
        padding: 20px 16px;
    }

    .contacts-form-wrapper {
        padding: 20px 16px;
    }

    .contacts-form-title {
        font-size: 24px;
        line-height: 32px;
    }

    .contacts-input,
    .contacts-textarea {
        padding: 14px 16px;
    }

    .contacts-form-button {
        padding: 14px 20px;
    }
}

/* Extra small mobile devices */
@media screen and (max-width: 390px) {
    .contacts-first-screen {
        width: calc(100% - 16px);
        margin: 40px auto 0;
        padding: 32px 12px;
        border-radius: 16px;
    }

    .contacts-title {
        font-size: 20px;
        line-height: 28px;
    }

    .contacts-subtitle {
        font-size: 13px;
        line-height: 18px;
        margin-top: 12px;
    }

    .contacts-connect-container {
        gap: 16px;
    }

    .contacts-connect-item {
        padding: 20px 16px;
    }

    .contacts-connect-title {
        font-size: 16px;
        line-height: 22px;
    }

    .contacts-form-container {
        padding: 20px 16px;
        border-radius: 20px;
    }

    .contacts-form-title {
        font-size: 20px;
        line-height: 28px;
    }

    .contacts-form-subtitle {
        font-size: 14px;
        line-height: 20px;
    }

    /* Social icons for very small screens */
    .contacts-form-socials {
        gap: 8px;
    }

    .contacts-form-social {
        width: 40px;
        height: 40px;
    }

    .contacts-form-social i {
        font-size: 18px;
    }

    .zen-text-icon {
        font-size: 18px;
    }
}

/* Medium mobile devices */
@media screen and (min-width: 391px) and (max-width: 430px) {
    .contacts-first-screen {
        padding: 36px 16px;
    }

    .contacts-title {
        font-size: 22px;
        line-height: 30px;
    }

    .contacts-connect-item {
        padding: 24px 18px;
    }

    .contacts-form-container {
        padding: 24px 18px;
    }

    .contacts-form-social {
        width: 44px;
        height: 44px;
    }

    .contacts-form-social i {
        font-size: 19px;
    }

    .zen-text-icon {
        font-size: 19px;
    }
}

/* Animation for form submission */
@keyframes submitPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

.contacts-form-button.submitting {
    animation: submitPulse 1s infinite;
}

/* Focus visible for accessibility */
.contacts-checkbox:focus-visible,
.contacts-form-button:focus-visible,
.contacts-input:focus-visible,
.contacts-textarea:focus-visible {
    outline: 2px solid #377CF7;
    outline-offset: 2px;
}

/* Dark Theme Styles */
.dark .contacts-page {
    background-color: #0a0a0a;
}

.dark .contacts-connect-item {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
}

.dark .contacts-connect-title {
    color: #ffffff;
}

.dark .contacts-connect-link {
    color: #377CF7;
}

.dark .contacts-connect-link:hover {
    color: #5a9eff;
}

.dark .contacts-input {
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #ffffff;
}

.dark .contacts-input:focus {
    border-color: #377CF7;
    outline: 2px solid #377CF7;
    background-color: #1a1a1a;
}

.dark .contacts-input:hover {
    border-color: #377CF7;
    background-color: #1a1a1a;
}

.dark .contacts-input::placeholder {
    color: #888888;
}

.dark .contacts-textarea {
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #ffffff;
}

.dark .contacts-textarea:focus {
    border-color: #377CF7;
    outline: 2px solid #377CF7;
    background-color: #1a1a1a;
}

.dark .contacts-textarea:hover {
    border-color: #377CF7;
    background-color: #1a1a1a;
}

.dark .contacts-textarea::placeholder {
    color: #888888;
}

.dark .contacts-form-social {
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
}

.dark .contacts-form-social:hover {
    background-color: #2a2a2a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(55, 124, 247, 0.2);
}

.dark .contacts-form-social i {
    color: #ffffff;
}

.dark .tooltip-content {
    background-color: #2a2a2a;
    color: #ffffff;
    border: 1px solid #3a3a3a;
}

.dark .tooltip-content::after {
    border-left-color: #2a2a2a;
}

.dark .tooltip-icon {
    color: #888888;
}

/* reCAPTCHA styling */
.captcha-group {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.captcha-group .g-recaptcha {
    margin-bottom: 12px;
    align-self: flex-start;
}

.captcha-group .form-error {
    margin-top: 8px;
    align-self: flex-start;
    color: #dc3545;
    font-size: 14px;
}

.form-error {
    color: #dc3545;
    font-size: 14px;
    font-weight: 400;
}

.form-error.show {
    display: block;
}

/* Dark theme reCAPTCHA adjustments */
.captcha-group .g-recaptcha > div {
    border-radius: 8px;
    overflow: hidden;
}

/* Mobile reCAPTCHA adjustments */
@media screen and (max-width: 767px) {
    .captcha-group {
        align-items: center;
        margin-bottom: 20px;
    }
    
    .captcha-group .g-recaptcha {
        align-self: center;
        transform: scale(0.85);
        transform-origin: center;
    }
    
    .captcha-group .form-error {
        align-self: center;
        text-align: center;
        margin-top: 12px;
    }
}