/* Condia Popup — frontend styles */

#cp-wrap {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.32s ease;
}

#cp-wrap[hidden] {
    display: none !important;
}

#cp-wrap.cp-visible {
    opacity: 1;
}

#cp-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

#cp-modal {
    position: relative;
    background: #fff;
    border-radius: 14px;
    width: 92%;
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 2.5em 2.25em;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
    z-index: 1;
}

/* Slide animation (default) */
#cp-modal.cp-anim-slide {
    transform: translateY(28px);
    transition: transform 0.32s ease;
}
#cp-wrap.cp-visible #cp-modal.cp-anim-slide {
    transform: translateY(0);
}

/* Zoom animation */
#cp-modal.cp-anim-zoom {
    transform: scale(0.88);
    transition: transform 0.32s ease;
}
#cp-wrap.cp-visible #cp-modal.cp-anim-zoom {
    transform: scale(1);
}

/* Fade — no transform needed, parent opacity handles it */
#cp-modal.cp-anim-fade {
    transition: none;
}

/* Close button */
#cp-close {
    position: absolute;
    top: 0.9em;
    right: 1em;
    background: none;
    border: none;
    font-size: 1.6em;
    line-height: 1;
    cursor: pointer;
    color: #9ca3af;
    padding: 0.1em 0.3em;
    transition: color 0.15s;
}

#cp-close:hover {
    color: #111;
}

/* ── Image popup ─────────────────────────────────────────── */
#cp-modal.cp-type-image {
    padding: 0;
    overflow: hidden;
    max-width: 640px;
}

#cp-modal.cp-type-image #cp-close {
    top: 0.55em;
    right: 0.55em;
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 50%;
    width: 2em;
    height: 2em;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    padding: 0;
    z-index: 2;
}

#cp-modal.cp-type-image #cp-close:hover {
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
}

#cp-image-wrap {
    display: block;
    line-height: 0;
}

#cp-popup-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
}

#cp-image-link:hover #cp-popup-img {
    opacity: 0.94;
}

/* ── Form popup ──────────────────────────────────────────── */
#cp-form-wrap {
    text-align: center;
}

#cp-icon {
    margin-bottom: 1.1em;
}

#cp-icon img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

#cp-title {
    font-size: 1.45em;
    font-weight: 700;
    margin: 0 0 0.35em;
    line-height: 1.25;
    color: #111;
}

#cp-subheadline {
    font-size: 0.93em;
    color: #6b7280;
    margin: 0 0 1.5em;
    line-height: 1.5;
}

#cp-form {
    display: flex;
    flex-direction: column;
    gap: 0.7em;
    text-align: left;
}

.cp-field-row {
    width: 100%;
}

.cp-input {
    width: 100%;
    padding: 0.78em 1em;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95em;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
    font-family: inherit;
    color: #111;
}

.cp-input:focus {
    border-color: #6b7280;
}

#cp-cta {
    padding: 0.88em 2em;
    background: #1e293b;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.88em;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.18s;
    margin-top: 0.2em;
    align-self: center;
    font-family: inherit;
}

#cp-cta:hover:not(:disabled) {
    opacity: 0.86;
}

#cp-cta:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

#cp-error {
    color: #dc2626;
    font-size: 0.875em;
    text-align: center;
    margin: 0.2em 0 0;
}

#cp-success {
    text-align: center;
    padding: 1.5em 0 0.5em;
}

#cp-success p {
    font-size: 1.05em;
    font-weight: 600;
    color: #16a34a;
    margin: 0;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 759px) {
    #cp-modal {
        width: 94%;
        padding: 2.25em 1.5em 2em;
        max-height: 90vh;
        border-radius: 12px;
    }

    #cp-modal.cp-type-image {
        padding: 0;
    }

    #cp-close {
        font-size: 2em;
        padding: 0.3em 0.4em;
        top: 0.5em;
        right: 0.6em;
    }

    #cp-title {
        font-size: 1.25em;
    }

    #cp-subheadline {
        font-size: 0.9em;
        margin-bottom: 1.2em;
    }

    #cp-icon img {
        width: 56px;
        height: 56px;
    }

    /* Prevent iOS Safari zoom on input focus */
    .cp-input {
        font-size: 1em;
    }

    #cp-cta {
        font-size: 0.92em;
        padding: 1em;
        min-height: 44px;
    }
}
