/* -- 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;
    width: 420px;
    max-width: 100%;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 40px 32px;
    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);
}

.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;
}

.revu-ui-popup-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

/* -- 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 -- */
.revu-ui-popup--form {
    width: 500px;
    padding: 0;
    text-align: left;
    /* Stays scrollable when the content overflows, but without a visible scrollbar. */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.revu-ui-popup--form::-webkit-scrollbar {
    display: none;
}

.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;
}

.revu-ui-popup-form {
    padding: 14px 28px 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);
}

/* Custom Dropdown Select*/
.revu-ui-popup-select {
    position: relative;
    width: 100%;
}

.revu-ui-popup-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.revu-ui-popup-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    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;
    text-align: left;
    cursor: pointer;
    transition: var(--custom-transition-general, all 0.1s ease-in-out);
}

.revu-ui-popup-select-trigger:hover,
.revu-ui-popup-select-trigger:focus {
    border-color: var(--custom-general-color-border-light, #9CBABC);
    background-color: var(--custom-color-neutral-cool-0, #FAFCFF);
    outline: none;
}

.revu-ui-popup-select-trigger.is-placeholder {
    color: var(--custom-color-gray, #898A8D);
}

.revu-ui-field--error .revu-ui-popup-select-trigger,
.revu-ui-popup-select-trigger.error {
    border-color: var(--custom-color-error, #C92020);
}

.revu-ui-popup-select-trigger.success {
    border-color: var(--custom-color-success, #449848);
}

.revu-ui-popup-select-trigger.warning {
    border-color: var(--custom-color-warning, #FDBD0E);
}

.revu-ui-popup-select-chevron {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    margin-left: 12px;
    border-right: 2px solid var(--custom-color-secondary-0, #0D0630);
    border-bottom: 2px solid var(--custom-color-secondary-0, #0D0630);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}

.revu-ui-popup-select.is-open .revu-ui-popup-select-chevron {
    transform: rotate(225deg) translate(-2px, -2px);
}

.revu-ui-popup-select-options {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    z-index: 20;
    display: none;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 0;
    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);
    box-shadow: 0 8px 20px rgba(13, 6, 48, 0.12);
}

.revu-ui-popup-select.is-open .revu-ui-popup-select-options {
    display: block;
}

.revu-ui-popup-select-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
    padding: 10px 16px;
    color: var(--custom-color-secondary-0, #0D0630);
    font-size: 14px;
    cursor: pointer;
}

.revu-ui-popup-select-option:hover,
.revu-ui-popup-select-option:focus {
    background-color: var(--custom-color-primary-20, #D7E3E4);
    outline: none;
}

.revu-ui-popup-select-option.is-selected {
    color: var(--custom-color-primary-75, #2A8383);
    font-weight: 600;
}

.revu-ui-popup-select-option-check {
    display: none;
    width: 7px;
    height: 12px;
    margin-left: 12px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px);
}

.revu-ui-popup-select-option.is-selected .revu-ui-popup-select-option-check {
    display: block;
}

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. */
.revu-ui-popup--form .revu-ui-popup-actions {
    justify-content: flex-end;
    margin: 4px 0 0;
    padding: 20px 28px 24px;
}
