/* Desktop: Centered popup */
.ess-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.ess-popup-container {
    background: white;
    width: 90%;
    max-width: 440px;
    border-radius: 24px;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    padding: 32px 28px;
    box-sizing: border-box;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    text-align: center;
}

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

.ess-popup-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s;
}

.ess-popup-close:hover {
    color: #333;
}

.ess-popup-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #1a1a2e;
}

.ess-popup-description {
    font-size: 15px;
    line-height: 1.5;
    color: #666;
    margin-bottom: 24px;
}

.ess-popup-input {
    width: 100%;
    padding: 14px 16px;
    margin: 0 0 14px 0;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.ess-popup-input:focus {
    outline: none;
    border-color: #1a1a2e;
}

.ess-popup-button {
    width: 100%;
    background: #1a1a2e;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.ess-popup-button:hover {
    background: #2d2d44;
}

.ess-popup-footer {
    font-size: 12px;
    color: #aaa;
    margin-top: 20px;
}

.ess-popup-error {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 12px;
}

.ess-popup-success {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 12px;
}

/* Mobile: Bottom sheet */
@media (max-width: 767px) {
    .ess-popup-overlay {
        align-items: flex-end;
    }
    .ess-popup-container {
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        width: 100%;
        max-width: 100%;
    }
    .ess-popup-overlay.active .ess-popup-container {
        transform: translateY(0);
    }
}