.form-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 16px;
    z-index: 2000;
    box-sizing: border-box;
}

.form-loading-container {
    width: min(90vw, 420px);
    background-color: #000049;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.35);
    box-sizing: border-box;
}

.form-loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1.25rem;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--color-green);
    border-radius: 50%;
    animation: form-loading-spin 0.9s linear infinite;
}

.form-loading-title {
    font-family: 'EncodeSans-Regular', sans-serif;
    font-weight: bold;
    color: var(--color-green);
    font-size: clamp(22px, 3.5vw, 32px);
    margin: 0 0 12px;
    line-height: 1.2;
}

.form-loading-text {
    font-family: 'EncodeSans-Regular', sans-serif;
    font-size: clamp(15px, 2.2vw, 20px);
    line-height: 1.5;
    color: var(--color-white);
    margin: 0;
}

@keyframes form-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 16px;
    z-index: 1000;
    overflow-y: auto;
    box-sizing: border-box;
}

.popup .close {
    transition: all .2s;
    position: absolute;
    top: 12px;
    right: 12px;
    width: auto;
    height: auto;
    max-width: 36px;
    max-height: 36px;
    cursor: pointer;
}

.popup .close:hover {
    transition: all .2s;
    transform: scale(1.08);
}

.popup-container {
    position: relative;
    width: min(90vw, 480px);
    background-color: #000049;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.35);
    box-sizing: border-box;
}

.popup-title {
    font-family: 'EncodeSans-Regular', sans-serif;
    font-weight: bold;
    color: var(--color-green);
    font-size: clamp(22px, 3.5vw, 32px);
    margin: 0 0 16px;
    line-height: 1.2;
}

.popup-text {
    font-family: 'EncodeSans-Regular', sans-serif;
    text-align: left;
    font-size: clamp(15px, 2.2vw, 20px);
    line-height: 1.5;
    color: var(--color-white);
    margin: 0;
    font-weight: normal;
}

#popup-password .popup-text {
    text-align: center;
}

.message.error,
.message.success {
    background-color: rgba(0, 0, 0, 0.8);
    border: none;
}

@media screen and (max-width: 1024px) and (orientation: portrait) {
    .popup .close {
        top: 10px;
        right: 10px;
        max-width: 40px;
        max-height: 40px;
    }

    .popup-container {
        width: min(88vw, 420px);
        padding: 2.25rem 1.5rem 1.75rem;
    }

    .popup-title {
        font-size: clamp(24px, 6vw, 34px);
        margin-bottom: 14px;
    }

    .popup-text {
        font-size: clamp(16px, 4vw, 22px);
    }
}

@media screen and (max-width: 1024px) and (orientation: landscape) {
    .popup .close {
        top: 10px;
        right: 10px;
        max-width: 32px;
        max-height: 32px;
    }

    .popup-container {
        width: min(60vw, 520px);
        padding: 2rem 2.5rem 1.75rem;
    }

    .popup-title {
        font-size: clamp(20px, 3vw, 28px);
        margin-bottom: 12px;
    }

    .popup-text {
        font-size: clamp(15px, 2vw, 19px);
    }
}
