/* ── Pagos: NIT + PSE + captcha (dropdown del header) ── */

.invoice-pay {
    margin-top: 16px;
}

.invoice-pay [hidden] {
    display: none !important;
}

.invoice-pay__step {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.invoice-pay__label {
    font-size: 14px;
    color: var(--tg-color-gray-4);
}

.invoice-pay__field {
    display: flex;
    align-items: center;
    height: 52px;
    padding: 4px 4px 4px 18px;
    background: var(--tg-color-white-default);
    border: 1px solid var(--tg-border-2);
    border-radius: 12px;
    transition: border-color .2s, box-shadow .2s;
}

.invoice-pay__field:focus-within {
    border-color: var(--tg-theme-secondary);
    box-shadow: 0 0 0 3px rgba(111, 86, 218, .12);
}

.invoice-pay__field.is-invalid {
    border-color: var(--tg-theme-primary-3);
}

.invoice-pay__field input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: var(--tg-heading-color);
}

.invoice-pay__field input::placeholder {
    color: var(--tg-color-gray-4);
}

.invoice-pay__btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform .2s, opacity .2s, filter .2s;
}

.invoice-pay__btn:not(:disabled):hover {
    transform: scale(1.06);
}

.invoice-pay__btn:disabled {
    cursor: not-allowed;
    opacity: .45;
    filter: grayscale(1);
}

.invoice-pay__btn.is-loading {
    pointer-events: none;
    animation: invoice-pay-pulse 1s ease-in-out infinite;
}

.invoice-pay__btn--pse {
    background: transparent;
}

.invoice-pay__btn--pse img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.invoice-pay__btn--go {
    background: var(--tg-theme-secondary);
    color: var(--tg-color-white-default);
    font-size: 16px;
}

.invoice-pay__tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 12px;
    z-index: 2;
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1.3;
    color: var(--tg-color-white-default);
    background: var(--tg-theme-primary-3);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
    white-space: nowrap;
}

.invoice-pay__tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 14px;
    border: 6px solid transparent;
    border-bottom-color: var(--tg-theme-primary-3);
}

/* En el paso del captcha el tooltip va debajo del input, no al final del formulario */
#invoice-pay-captcha-form .invoice-pay__tooltip {
    position: static;
    align-self: flex-start;
    margin-top: 2px;
}

#invoice-pay-captcha-form .invoice-pay__tooltip::before {
    display: none;
}

.invoice-pay__captcha {
    display: flex;
    align-items: center;
    gap: 10px;
}

.invoice-pay__captcha img {
    border: 1px solid var(--tg-border-2);
    border-radius: 8px;
    background: var(--tg-color-gray-3);
    user-select: none;
}

.invoice-pay__refresh,
.invoice-pay__back {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--tg-color-gray-4);
    cursor: pointer;
}

.invoice-pay__refresh {
    font-size: 16px;
}

.invoice-pay__refresh:hover,
.invoice-pay__back:hover {
    color: var(--tg-theme-secondary);
}

.invoice-pay__back {
    align-self: flex-start;
    font-size: 13px;
    text-decoration: underline;
}

.invoice-pay__link {
    font-weight: 600;
    color: var(--tg-theme-secondary);
}

@keyframes invoice-pay-pulse {
    50% { opacity: .5; }
}
