html,
body {
    height: 100%;
    margin: 0;
    font-family: "Montserrat", Arial, sans-serif;
    font-size: 15px;
    background: transparent;
    color: #e7eefd;
    box-sizing: border-box;
    background-color: #292b36;
}
.contact-modal {
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-modal-content {
    background: #292b36;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    font-family: "Montserrat", sans-serif;
    max-width: 90%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.hero-video {
    position: fixed; /* Или absolute, если внутри ограниченного контейнера */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    object-position: center;
    z-index: 0; /* Чтобы не перекрывать контент */
    opacity: 0.3;
    pointer-events: none; /* Чтобы видео не мешало кликам */
}

.form-center {
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.contact-form {
    pointer-events: all;
    background: rgba(33, 35, 46, 0.96);
    border-radius: 16px;
    box-shadow: 0 7px 34px 2px rgba(28, 38, 87, 0.17), 0 2px 7px 1px #28245214;
    padding: 34px 38px 18px 38px;
    width: 100%;
    max-width: 560px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1.5px solid rgba(97, 160, 255, 0.05);
    box-sizing: border-box;
    font-size: 1rem;
    align-items: stretch;
    backdrop-filter: blur(1.3px);
}

.contact-form h2 {
    text-align: center;
    color: #e8edff;
    margin-bottom: 27px;
    font-size: 1.27rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.form-row-2 {
    display: flex;
    gap: 19px;
    margin-bottom: 0;
}

.form-row-2 .form-group {
    flex: 1 1 0;
}

.form-row-2 .form-group.no-margin {
    margin-bottom: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 19px;
    position: relative;
}

.floating-label-group {
    position: relative;
    width: 100%;
}

.floating-label-group input[type="text"],
.floating-label-group input[type="email"],
.floating-label-group input[type="tel"],
.floating-label-group textarea {
    width: 100%;
    border: none;
    border-radius: 0;
    padding: 23px 9px 9px 12px;
    font-size: 1.09rem;
    background: none;
    background-color: transparent;
    color: #e8f0ff;
    box-sizing: border-box;
    box-shadow: none;
    border-bottom: 2px solid #495278;
    transition: border-color 0.22s, background 0.21s;
    font-family: inherit;
    outline: none;
    resize: none;
    min-height: 48px;
}

.floating-label-group textarea {
    padding-top: 21px;
    padding-bottom: 7px;
    min-height: 84px;
    max-height: 250px;
    line-height: 1.6;
    /* overflow-y: auto; */
}

.floating-label-group input:focus,
.floating-label-group textarea:focus {
    border-bottom: 2px solid #5b8fff;
    background: rgba(45, 53, 66, 0.11);
}

.floating-label-group input.error,
.floating-label-group textarea.error {
    border-bottom: 2px solid #ff4a8d !important;
    background: rgba(53, 27, 41, 0.09);
}

.floating-label-group label {
    position: absolute;
    top: 19px;
    left: 12px;
    font-size: 1.1em;
    color: #a8b5d0;
    pointer-events: none;
    font-weight: 500;
    transition: color 0.17s cubic-bezier(0.7, 0.2, 0.35, 1.37), top 0.18s cubic-bezier(0.44, 0, 0.36, 1.24), font-size 0.16s;
    background: transparent;
    z-index: 3;
}

.floating-label-group input:focus + label,
.floating-label-group input:not(:placeholder-shown) + label,
.floating-label-group textarea:focus + label,
.floating-label-group textarea:not(:placeholder-shown) + label {
    top: -13px;
    font-size: 0.92em;
    color: #5b8fff;
    background: transparent;
    padding: 0;
}

.floating-label-group input.error + label,
.floating-label-group textarea.error + label {
    color: #ff4a8d;
}

.form-group .error-msg {
    color: #ff4a8d;
    font-size: 0.97em;
    min-height: 1.1em;
    margin-top: 3px;
    font-weight: 600;
}

.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.98em;
    gap: 10px !important;
}

.checkbox-custom {
    user-select: none;
    color: #a7b6ce;
    font-size: 0.98em;
    gap: 7px;
    display: flex;
    align-items: center;
}

.checkbox-custom input[type="checkbox"] {
    accent-color: #5e83ff;
    width: 17px;
    height: 17px;
}

.auth-btn,
.contact-btn {
    font-family: inherit;
    display: block;
    width: 100%;
    border: none;
    border-radius: 9px;
    padding: 14px 0;
    font-size: 1.15rem;
    font-weight: 600;
    background: linear-gradient(90deg, #729cff 0%, #292ecd 100%);
    color: #fff;
    margin-bottom: 13px;
    box-shadow: 0 2px 9px 0 #4a4cff13;
    cursor: pointer;
    transition: background 0.13s, box-shadow 0.1s;
}

.auth-btn:hover,
.contact-btn:hover {
    background: linear-gradient(90deg, #a4bffc 0%, #5151fb 100%);
    box-shadow: 0 2px 13px 2px #abaaff33;
}

.back-btn {
    position: fixed;
    bottom: 14px;
    right: 14px;
    width: 45px;
    height: 45px;
    border: none;
    background: rgba(44, 44, 100, 0.98);
    color: #a6bfe7;
    font-size: 22px;
    border-radius: 50%;
    box-shadow: 0 2px 14px 2px #02062113;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    cursor: pointer;
    transition: background 0.12s, color 0.13s;
}

.back-btn:hover {
    background: #232469;
    color: #8dd5ff;
}

@media (max-width: 900px) {
    .contact-form {
        max-width: 95vw;
    }

    .form-row-2 {
        gap: 13px;
    }
}

@media (max-width: 630px) {
    .contact-form {
        max-width: 99vw;
        padding: 25px 5vw 25px 5vw;
        width: 90%;
    }

    .form-row-2 {
        flex-direction: column;
        gap: 0;
    }

    .form-row-2 .form-group {
        margin-bottom: 14px;
    }
}

input:-webkit-autofill,
input:-webkit-autofill:focus,
input:-webkit-autofill:hover,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px rgba(33, 35, 46, 0.92) inset !important;
    box-shadow: 0 0 0 1000px rgba(33, 35, 46, 0.92) inset !important;
    -webkit-text-fill-color: #e8f0ff !important;
    caret-color: #fff;
    transition: background-color 5000s ease-in-out 0s;
    border-bottom: 2px solid #5b8fff !important;
}

/* input:-moz-autofill,
textarea:-moz-autofill {
  box-shadow: 0 0 0 1000px rgba(33, 35, 46, 0.92) inset !important;
  -moz-text-fill-color: #e8f0ff !important;
} */

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-thumb {
    background: #24244e;
    border-radius: 6px;
}

.error-msg {
    margin-bottom: 12px;
}

@media (max-width: 630px) {
    html,
    body {
        min-height: 100vh;
        height: auto;
        width: 100vw;
        overflow-x: hidden;
        background-color: #292b36;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .hero-video {
        width: 100%;
        height: auto;
        min-height: 100%;
    }
    .form-center {
        position: static;
        min-height: 100vh;
        width: 100vw;
        height: auto;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        overflow: visible;
        padding: 0;
        box-sizing: border-box;
    }
    .contact-form {
        max-width: 99vw;
        min-width: 0;
        box-sizing: border-box;
        border-radius: 10px;
        margin: 16px 0 24px 0;
        max-height: unset;
        overflow: visible;
        z-index: 1;
    }
    .back-btn {
        width: 45px !important;
        height: 45px !important;
        right: 2vw;
        bottom: 2vw;
    }
}
