/* -- POPUP OVERLAY -- */
.revu-ui-popup-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: var(--revu-ui-popup-z, 12000);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background-color: rgb(13 6 48 / 45%); /* #0D0630 al 45% de opacidad*/
    transition: opacity 0.15s ease;
}

    .revu-ui-popup-overlay.is-visible {
        opacity: 1;
    }

/* -- POPUP TONES -- */
/* The tone decides the color of the icon circle and of the primary button. */
.revu-ui-popup--neutral {
    --revu-ui-action: var(--revu-ui-color-info, #2C95ED);
    --revu-ui-action-soft: var(--revu-ui-soft-info, #2C95ED4D);
}

.revu-ui-popup--positive {
    --revu-ui-action: var(--revu-ui-color-success, #449848);
    --revu-ui-action-soft: var(--revu-ui-soft-success, #4498484D);
}

.revu-ui-popup--destructive {
    --revu-ui-action: var(--revu-ui-color-error, #C92020);
    --revu-ui-action-soft: var(--revu-ui-soft-error, #C920204D);
}

.revu-ui-popup--warning {
    --revu-ui-action: var(--revu-ui-color-warning, #FDBD0E);
    --revu-ui-action-soft: var(--revu-ui-soft-warning, #FDBD0E4D);
}


/* -- POPUP CARD -- */
.revu-ui-popup {
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: 420px;
    max-width: 100%;
    max-height: calc(100vh - 48px);
    overflow: hidden;
    padding: 0;
    background-color: var(--revu-ui-color-white-warm, #FFFEFC);
    border-radius: 20px;
    box-shadow: 0 18px 50px rgba(13, 6, 48, 0.28);
    text-align: center;
    font-family: var(--revu-ui-font, 'Inter', sans-serif);
    transform: translateY(8px) scale(0.98);
    transition: transform 0.15s ease;
}

.revu-ui-popup-overlay.is-visible .revu-ui-popup {
    transform: translateY(0) scale(1);
}

/* -- POPUP BODY -- */
/* Only the body scrolls when the content overflows; the footer stays pinned.
   Uses the custom scrollbar defined by revu-scrollbar-a (same as the form). */
.revu-ui-popup-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 25px 32px 40px;
    margin-top: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--revu-ui-scroll-thumb, #aac5c5) transparent;
}

    /* No footer follows the body: keep the original 40px bottom padding. */
    .revu-ui-popup-body:not(:last-child) {
        padding-bottom: 0;
    }

.revu-ui-popup-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background-color: var(--revu-ui-action-soft);
    color: var(--revu-ui-action, var(--custom-color-info-0));
}

    .revu-ui-popup-icon svg {
        width: 50%;
        height: 50%;
    }

    /* Local/static image icons cannot inherit currentColor, so they only need sizing. */
    .revu-ui-popup-icon img {
        width: 50%;
        height: 50%;
        object-fit: contain;
    }

.revu-ui-popup-title {
    margin: 0;
    color: var(--revu-ui-color-text, var(--custom-color-secondary-0));
    font-weight: 700;
    font-size: 20px;
    line-height: 26px;
    font-family: var(--custom-font-space-grotesk, 'Inter', sans-serif);
}

.revu-ui-popup-description {
    margin: 8px 0 0;
    color: var(--revu-ui-color-text, var(--custom-color-secondary-0));
    font-weight: 400;
    font-size: 14px;
    line-height: 22px;
}

/* -- CUSTOM CONTENT -- */
/* Custom element content replaces the centered icon/title/description body. */
.revu-ui-popup-content {
    text-align: left;
}

/* Custom block added above the form fields. */
.revu-ui-popup-custom {
    margin-bottom: 16px;
}

.revu-ui-popup-buttons {
    display: flex;
    flex: 0 0 auto;
    justify-content: center;
    gap: 12px;
    margin-top: 0;
    padding: 28px 32px 40px;
}

/* -- BUTTONS -- */
.revu-ui-popup-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 120px;
    padding: 6px 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: inherit;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: filter 0.15s ease, background-color 0.15s ease;
}

    .revu-ui-popup-button:disabled {
        cursor: default;
        opacity: 0.7;
    }

.revu-ui-popup-button--secondary {
    background-color: var(--revu-ui-color-white-warm, #FFFEFC);
    border-color: var(--revu-ui-color-text, var(--custom-color-secondary-0));
    color: var(--revu-ui-color-text, var(--custom-color-secondary-0));
}

.revu-ui-popup-button--primary {
    background-color: var(--revu-ui-action, var(--revu-ui-color-info));
    color: var(--revu-ui-color-white-warm, #FFFEFC);
}

.revu-ui-popup-button--danger {
    background-color: var(--revu-ui-color-error);
    color: var(--revu-ui-color-white-warm, #FFFEFC);
}

.revu-ui-popup-button--violet {
    background-color: var(--revu-ui-color-violet);
    color: var(--revu-ui-color-white);
}

.revu-ui-popup-button:not(:disabled):hover {
    filter: brightness(0.95);
}

.revu-ui-popup-button-icon {
    display: inline-flex;
    align-items: center;
    width: 18px;
    height: 18px;
}

    .revu-ui-popup-button-icon svg {
        width: 100%;
        height: 100%;
    }

    /* Local/static image icons cannot inherit currentColor, so they only need sizing. */
    .revu-ui-popup-button-icon img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.revu-ui-popup-button.is-loading .revu-ui-popup-button-label,
.revu-ui-popup-button.is-loading .revu-ui-popup-button-icon {
    visibility: hidden;
}

.revu-ui-popup-button.is-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: var(--revu-ui-color-white-warm, #FFFEFC);
    border-radius: 50%;
    animation: revu-ui-popup-spin 0.7s linear infinite;
}

@keyframes revu-ui-popup-spin {
    to {
        transform: rotate(360deg);
    }
}

/* -- CLOSE BUTTON -- */
.revu-ui-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--revu-ui-color-muted, #898A8D);
    cursor: pointer;
}

    .revu-ui-popup-close:hover {
        color: var(--revu-ui-color-text, #0D0630);
    }

.revu-ui-popup-close--on-header {
    top: 24px;
    right: 20px;
    color: var(--revu-ui-color-muted, #898A8D);
}

    .revu-ui-popup-close--on-header:hover {
        color: var(--revu-ui-color-white-2, #FEFDFA);
    }

/* -- FORM VARIANT -- */
/* The card is a flex column: the header stays pinned on top, the footer stays
   pinned at the bottom, and only the body scrolls when the content overflows. */
.revu-ui-popup--form {
    width: 500px;
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

    .revu-ui-popup--form .revu-ui-popup-header {
        flex: 0 0 auto;
    }

    /* The form fills the remaining height and splits the body and the footer. */
    .revu-ui-popup--form > form {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
    }

.revu-ui-popup-header {
    position: relative;
    padding: 20px 28px 16px;
    background-color: var(--revu-ui-color-violet, #0D0630);
    border-radius: 20px 20px 0 0;
}

.revu-ui-popup-eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--revu-ui-color-neon, #e6ff2a);
    font-size: 12px;
    font-family: var(--custom-font-ibm-plex, monospace, 'Inter', sans-serif);
    letter-spacing: 0.02em;
}

.revu-ui-popup-header-title {
    margin: 0;
    color: var(--revu-ui-color-white-2, #FEFDFA);
    font-weight: 700;
    font-size: 20px;
    font-family: var(--custom-font-space-grotesk, 'Inter', sans-serif);
    line-height: 26px;
}

/* Only the body scrolls when the content overflows, using the custom scrollbar
   defined by revu-scrollbar-a (thin, rounded, muted thumb over a transparent track). */
.revu-ui-popup-form {
    padding: 14px 28px 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--revu-ui-scroll-thumb, #aac5c5) transparent;
}

    .revu-ui-popup-form.revu-scrollbar-a::-webkit-scrollbar,
    .revu-ui-popup-body.revu-scrollbar-a::-webkit-scrollbar {
        width: 8px;
        height: 0;
        background: transparent;
    }

    .revu-ui-popup-form.revu-scrollbar-a::-webkit-scrollbar-track,
    .revu-ui-popup-body.revu-scrollbar-a::-webkit-scrollbar-track {
        background: transparent;
    }

    .revu-ui-popup-form.revu-scrollbar-a::-webkit-scrollbar-thumb,
    .revu-ui-popup-body.revu-scrollbar-a::-webkit-scrollbar-thumb {
        background: var(--revu-ui-scroll-thumb, #aac5c5);
        border-radius: 10px;
    }

        .revu-ui-popup-form.revu-scrollbar-a::-webkit-scrollbar-thumb:hover,
        .revu-ui-popup-body.revu-scrollbar-a::-webkit-scrollbar-thumb:hover {
            background: var(--revu-ui-scroll-thumb-hover, #bcd3d4);
        }

    .revu-ui-popup-form.revu-scrollbar-a::-webkit-scrollbar-button,
    .revu-ui-popup-body.revu-scrollbar-a::-webkit-scrollbar-button {
        display: none;
        height: 0;
        width: 0;
    }

.revu-ui-popup-form-intro {
    margin: 0 0 16px;
    color: var(--revu-ui-color-muted, var(--custom-color-gray));
    font-size: 12px;
    line-height: 19px;
}

/* -- FORM FIELDS -- */
.revu-ui-field {
    margin-bottom: 16px;
}

.revu-ui-field-label {
    display: block;
    margin-bottom: 6px;
    color: var(--revu-ui-color-text, var(--custom-color-secondary-0));
    font-size: 14px;
    font-weight: 600;
}

.revu-ui-field-required {
    color: var(--revu-ui-color-error, #C92020);
}

.revu-ui-field-help {
    margin-left: 6px;
    color: var(--revu-ui-color-muted, var(--custom-color-gray));
    font-size: 10px;
    font-weight: 400;
}



input.revu-ui-field-input,
.revu-ui-field-input {
    width: 100%;
    padding: 12px 16px;
    color: var(--custom-color-secondary-0, #0D0630);
    background-color: var(--custom-color-neutral-warm-0, #FFFEFC);
    border: 1px solid var(--custom-general-color-border-default, #D7E3E4);
    border-radius: var(--custom-border-general-border-radius-low, 8px);
    font-family: var(--custom-font-inter, 'Inter', sans-serif);
    font-size: 14px;
    line-height: 20px;
    outline: none;
    transition: var(--custom-transition-general, all 0.1s ease-in-out);
}

    .revu-ui-field-input:hover {
        border-color: var(--custom-general-color-border-default, #D7E3E4);
        background-color: var(--custom-color-neutral-cool-0, #FAFCFF);
    }

    .revu-ui-field-input:focus {
        outline: none;
        border-color: var(--custom-general-color-border-light, #9CBABC);
        background-color: var(--custom-color-neutral-cool-0, #FAFCFF);
    }

    .revu-ui-field-input::placeholder {
        color: var(--custom-color-gray, #898A8D);
    }

    .revu-ui-field-input.error {
        border-color: var(--custom-color-error, #C92020);
    }

textarea.revu-ui-field-input {
    resize: vertical;
    min-height: 100px;
    max-height: 200px;
}


.revu-ui-field-error {
    margin: 4px 0 0;
    color: var(--revu-ui-color-error, var(--custom-color-error));
    font-size: 12px;
}

.revu-ui-field--error .revu-ui-field-input {
    border-color: var(--revu-ui-color-error, var(--custom-color-error));
}

/* Form footer is aligned to the right and always visible (it never scrolls). */
.revu-ui-popup--form .revu-ui-popup-buttons {
    flex: 0 0 auto;
    justify-content: flex-end;
    margin: 0;
    padding: 20px 28px 24px;
}
