/* Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
    padding: 20px 0;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-modal {
    background: #FFFFFF;
    border-radius: 25px;
    max-width: 810px;
    width: 90%;
    max-height: 90dvh;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.popup-overlay.active .popup-modal {
    transform: scale(1);
}

.popup-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 10;
    transition: 0.2s ease;
}

.popup-close:hover {
    opacity: 0.8;
}

.popup-close svg {
    width: 100%;
    height: 100%;
}

.popup-content {
    display: flex;
    align-items: stretch;
}

.popup-left {
    flex: 1;
    padding: 40px;
}

.popup-right {
    width: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
}

.popup-image {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.popup-title {
    font-size: 38px;
    font-weight: 500;
    line-height: 1.2;
    margin: 0 0 15px 0;
    color: #000000;
}

.popup-subtitle {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: #666666;
    margin: 0 0 24px 0;
    text-wrap: balance;
}

.popup-form {
    display: flex;
    flex-direction: column;
}

.popup-input-wrapper {
    display: flex;
    flex-direction: column;
    position: relative;
}

.popup-error-message {
    position: absolute;
    top: 100%;
    font-size: 11px;
    font-weight: 400;
    color: #FF5733;
    line-height: 1.3;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    margin-top: -4px;
}

.popup-input-wrapper.error .popup-error-message {
    opacity: 1;
    visibility: visible;
}

.popup-input-wrapper.error .popup-input {
    border-color: #D5401F;
    background: #FDF0ED;
}

.popup-input-wrapper.error .popup-country-selected {
    border-color: #D5401F;
    background: #FDF0ED;
}

.popup-input-wrapper.error .popup-phone {
    border-color: #D5401F;
    background: #FDF0ED;
}

.popup-input {
    width: 100%;
    padding: 22px 16px 8px;
    font-size: 16px;
    font-weight: 400;
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    background: #F5F5F5;
    transition: border-color 0.2s ease, background 0.2s ease;
    font-family: "Graphik LC Web", sans-serif;
}

.popup-input:not(:last-child) {
    margin-bottom: 8px;
}

.popup-input:focus {
    outline: none;
    border-color: #3D3BFF;
    background: #FFFFFF;
}

.popup-input::placeholder {
    color: #666666;
}

.popup-phone-wrapper {
    display: flex;
    position: relative;
}

/* Custom Country Select */

.popup-country-custom {
    position: relative;
    width: 80px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 12px;
    background: #F5F5F5;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    font-weight: 500;
    color: #000;
}

.popup-country-custom:hover {
    border-color: #3D3BFF;
}

.popup-country-custom.active {
    border-color: #3D3BFF;
    border-bottom-left-radius: 0;
}

.popup-country-custom svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.popup-country-custom .icon-kz,
.popup-country-custom .icon-by {
    display: none;
}


.popup-phone {
    padding-left: 97px !important;
    padding-right: 16px !important;
}

.popup-phone::-webkit-contacts-auto-fill-button,
.popup-phone::-webkit-credentials-auto-fill-button {
    visibility: hidden;
    display: none !important;
    pointer-events: none;
    position: absolute;
    right: 0;
}

.popup-phone::-webkit-textfield-decoration-container {
    visibility: hidden;
    display: none !important;
    pointer-events: none;
}

.popup-submit {
    width: 100%;
    padding: 18px 0;
    font-size: 18px;
    font-weight: 500;
    color: #FFFFFF;
    background: #3D3BFF;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: "Graphik LC Web", sans-serif;
    margin-top: 8px;
}

.popup-submit:hover {
    background: #000;
}

.popup-submit:active {
    background: #000;
}

.popup-checkbox-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0 10px 0;
}

.popup-checkbox-wrapper.error .popup-checkbox-custom {
    border-color: #D5401F;
}

.popup-checkbox-wrapper.error .popup-error-message {
    opacity: 1;
    visibility: visible;
}

.popup-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    font-weight: 400;
    line-height: 16px;
    color: #5C5C5C;
    cursor: pointer;
    text-wrap: balance;
    position: relative;
}

.popup-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.popup-checkbox-custom {
    position: relative;
    width: 1rem;
    height: 1rem;
    background: #FFFFFF;
    border: 2px solid #5C5C5C;
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 1px;
    transition: all 0.2s ease;
}

.popup-checkbox input[type="checkbox"]:checked~.popup-checkbox-custom {
    background: #3D3BFF;
    border-color: #3D3BFF;
}

.popup-checkbox-custom::after {
    content: "";
    position: absolute;
    display: none;
    left: 4px;
    top: 0;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.popup-checkbox input[type="checkbox"]:checked~.popup-checkbox-custom::after {
    display: block;
}

.popup-checkbox:hover .popup-checkbox-custom {
    border-color: #3D3BFF;
}

.popup-checkbox-text {
    flex: 1;
}

.popup-checkbox a {
    color: #5C5C5C;
    text-decoration: underline;
}

.popup-checkbox a:hover {
    text-decoration: none;
}

.popup-terms {
    font-size: 13px;
    line-height: 1.5;
    color: #5C5C5C;
}

.popup-terms a {
    color: #5C5C5C;
    text-decoration: underline;
}

.popup-terms a:hover {
    text-decoration: none;
}

.popup-logo {
    display: none;
    width: 90px;
    height: 90px;
    margin-bottom: 1rem;
}

/* Custom scrollbar for popup */
.popup-modal::-webkit-scrollbar {
    width: 8px;
}

.popup-modal::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.popup-modal::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.popup-modal::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive styles */
@media (max-width: 768px) {
    .popup-logo {
        display: block;
    }

    .popup-modal {
        max-width: 95%;
        width: 95%;
        margin: 20px;
    }

    .popup-content {
        flex-direction: column;
    }

    .popup-left {
        padding: 6px 20px 30px 20px;
    }

    .popup-right {
        display: none;
    }

    .popup-title {
        font-size: 28px;
    }

    .popup-subtitle {
        font-size: 1rem;
        margin-bottom: 24px;
        text-wrap: auto;
    }

    .popup-close {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
    }

    .popup-image {
        max-width: 80%;
    }
}

@media (max-width: 710px) {
    .popup-subtitle {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .popup-modal {
        overflow-y: auto;
    }

    .popup-left {
        padding: 24px 20px;
    }

    .popup-title {
        font-size: 26px;
    }

    .popup-subtitle {
        font-size: 1rem;
    }

    .popup-phone-wrapper {
        flex-direction: row;
    }

    .popup-country-select {
        width: 70px;
    }

    .popup-input,
    .popup-country-select {
        font-size: 15px;
    }

    .popup-submit {
        padding: 16px 24px;
        font-size: 15px;
    }

    .popup-terms {
        font-size: 12px;
    }
}

/* For devices with small height */
@media (max-height: 700px) {
    .popup-modal {
        max-height: 95dvh;
    }

    .popup-left {
        padding: 20px;
    }

    .popup-title {
        font-size: 28px;
        margin-bottom: 10px;
    }

    .popup-subtitle {
        font-size: 14px;
        margin-bottom: 16px;
    }
}

@media (max-height: 600px) {
    .popup-modal {
        max-height: 98dvh;
        margin: 10px 0;
    }

    .popup-left {
        padding: 15px;
    }

    .popup-right {
        display: none;
    }

    .popup-title {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .popup-subtitle {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .popup-submit {
        padding: 14px 0;
        font-size: 16px;
    }

    .popup-checkbox-wrapper {
        padding-top: 0.5rem;
    }
}

/* Success Modal Styles */
.success-modal {
    max-width: 800px;
    padding: 124px;
    text-align: center;
}

.success-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.result-title {
    font-size: 28px;
    font-weight: 500;
    line-height: 1.3;
    margin: 0;
    color: #000000;
}

.result-subtitle {
    font-size: 18px;
    font-weight: 400;
    line-height: 1.5;
    color: #5C5C5C;
    margin: 0;
}

/* Show/hide icons based on state */
.success-content .icon-success {
    display: block;
}

.success-content .icon-error {
    display: none;
}

.success-modal.error-state .icon-success {
    display: none;
}

.success-modal.error-state .icon-error {
    display: block;
}

@media (max-width: 768px) {
    .success-modal {
        padding: 40px 30px;
    }

    .result-title {
        font-size: 24px;
    }

    .result-subtitle {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .success-modal {
        padding: 230px 30px;
    }

    .success-content {
        gap: 16px;
    }

    .result-title {
        font-size: 20px;
    }

    .result-subtitle {
        font-size: 15px;
    }
}

/* intl-tel-input custom styles */
.iti {
    width: 100%;
    display: block;
}

.iti__country-container {
    width: 80px;
    background-color: transparent;
    border: none;
    border-radius: 8px 0 0 8px;
    border-right: 1px solid rgba(0, 0, 0, .12);
    z-index: 2;
}

.iti__selected-country {
    width: 100%;
    justify-content: center;
}


.iti__selected-flag {
    padding: 0 12px 0 18px;
    background: #F5F5F5;
    border-right: 1px solid #E0E0E0;
    transition: background 0.2s ease;
}

.iti__selected-flag:hover {
    background: #EBEBEB;
}

.popup-input-wrapper.error .iti__selected-flag {
    background: #FDF0ED;
    border-color: #D5401F;
}

.iti__country-list {
    max-height: 200px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #E0E0E0;
    margin-top: 4px;
    font-family: "Graphik LC Web", sans-serif;
}

.iti__country {
    padding: 8px 12px;
    transition: background 0.2s ease;
}


.iti__country-name {
    margin-left: 8px;
    font-size: 15px;
}

.iti__dial-code {
    color: #666666;
    font-size: 14px;
}

.iti__country.iti__highlight .iti__dial-code {
    color: rgba(255, 255, 255, 0.8);
}

.iti__arrow {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #666666;
    margin-left: 8px;
}

@media (max-width: 768px) {
    .iti__country-list {
        max-height: 150px;
    }
}

@media (max-width: 480px) {
    .iti__selected-flag {
        padding: 0 10px 0 16px;
    }

    .iti__country-name {
        font-size: 14px;
    }

    .iti__dial-code {
        font-size: 13px;
    }
}

.lerna-form-input__placeholder {
    color: #666666;
    font-size: 16px;
    line-height: 24px;
    pointer-events: none;
    position: absolute;
    top: 16px;
    left: 16px;
    transition: all .3s ease;
    background: transparent;
}

.phone-input-wrapper {
    padding-bottom: 8px;
}

.phone-input-wrapper.error {
    margin-bottom: 16px;
}

.phone-input-wrapper .lerna-form-input__placeholder {
    left: 97px;
}

.lerna-form-input__placeholder.focused {
    color: #78747a;
    font-size: 10px;
    line-height: 16px;
    top: 8px;
}

/* Show placeholder (mask) when focused or has value */
.popup-input::placeholder {
    color: #999999;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.popup-input:focus::placeholder {
    opacity: 1;
}

.popup-input.has-value::placeholder {
    opacity: 0;
}

.iti__selected-country-primary {
    padding-left: 0 !important;
}

.iti--allow-dropdown .iti__country-container:not(:has(+ input[disabled])):not(:has(+ input[readonly])) .iti__selected-country-primary:hover,
.iti--allow-dropdown .iti__country-container:not(:has(+ input[disabled])):not(:has(+ input[readonly])) .iti__selected-country:has(+ .iti__dropdown-content:hover) .iti__selected-country-primary {
    background: none !important;
}

.iti__country.iti__highlight {
    background-color: #3D3BFF !important;
}

.iti__country.iti__highlight .iti__dial-code {
    color: #fff !important;
}

.iti__country.iti__highlight .iti__country-name {
    color: #fff !important;
}

.iti__flag {
    border: 1px solid #fff;
}

.iti--container{
    z-index: 10000000000 !important;
}