:root {
    --primary-color: #2f81f7;
    --accent-color: #60a5fa;
}

/* Renace Chat Widget (copiado y aislado para PrestApp) */
.rg-chat-root {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 12000;
}

.rg-chat-toggle {
    width: 72px;
    height: 72px;
    border-radius: 9999px;
    border: none;
    padding: 0;
    cursor: pointer;
    background: transparent;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease-out, box-shadow 0.18s ease-out, opacity 0.18s ease-out;
}

.rg-chat-toggle:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.4);
}

.rg-chat-toggle-icon {
    width: 62px;
    height: 62px;
    border-radius: 9999px;
    object-fit: cover;
}

.rg-chat-window {
    position: fixed;
    right: 1.5rem;
    bottom: 5.25rem;
    width: min(420px, 100vw - 2rem);
    max-height: min(560px, 80vh);
    background: #020617;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.55);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}

.rg-chat-root.rg-chat-open .rg-chat-window {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.rg-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.9rem;
    background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.35), rgba(15, 23, 42, 0.95));
    border-bottom: 1px solid rgba(148, 163, 184, 0.55);
}

.rg-chat-header-main {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.rg-chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px #e5e5e5;
}

.rg-chat-avatar-icon {
    width: 42px;
    height: 42px;
    border-radius: 9999px;
    object-fit: cover;
}

.rg-chat-heading h2 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e5e7eb;
    margin: 0;
}

.rg-chat-heading p {
    margin: 0.1rem 0 0;
    font-size: 0.75rem;
    color: #9ca3af;
}

.rg-chat-close {
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 9999px;
    font-size: 1rem;
    line-height: 1;
    transition: background 0.18s ease, color 0.18s ease;
}

.rg-chat-close:hover {
    background: rgba(15, 23, 42, 0.85);
    color: #e5e7eb;
}

.rg-chat-body {
    padding: 0.15rem 0.75rem 0.5rem;
    flex: 1;
    min-height: 0;
    background: radial-gradient(circle at top, rgba(37, 99, 235, 0.18), transparent 55%);
    overflow-y: auto;
    scroll-behavior: smooth;
}

.rg-chat-messages {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rg-chat-message {
    display: flex;
    padding: 0.35rem 0.35rem;
}

.rg-chat-user {
    justify-content: flex-end;
}

.rg-chat-bot {
    justify-content: flex-start;
}

.rg-chat-bubble {
    max-width: 80%;
    padding: 0.5rem 0.7rem;
    border-radius: 0.5rem;
    font-size: 0.88rem;
    line-height: 1.4;
}

.rg-chat-user .rg-chat-bubble {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #f9fafb;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.55);
}

.rg-chat-bot .rg-chat-bubble {
    background: rgba(15, 23, 42, 0.95);
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.6);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.9);
}

.rg-chat-input {
    padding: 0.4rem 0.75rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    border-top: 1px solid rgba(15, 23, 42, 0.95);
    background: radial-gradient(circle at bottom, rgba(37, 99, 235, 0.2), transparent 60%);
}

.rg-chat-input textarea {
    flex: 1;
    resize: none;
    min-height: 34px;
    max-height: 90px;
    border-radius: 9999px;
    border: 1px solid rgba(148, 163, 184, 0.65);
    padding: 0.45rem 0.75rem;
    background: rgba(15, 23, 42, 0.95);
    color: #e5e7eb;
    font-size: 0.85rem;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.rg-chat-input textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.6);
}

.rg-chat-input button {
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    border: none;
    background: var(--primary-color);
    color: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
}

.rg-chat-input button:hover {
    transform: translateY(-1px) scale(1.02);
    background: #1d4ed8;
}

.rg-chat-input button:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.rg-chat-input button[disabled] {
    opacity: 0.55;
    cursor: default;
    box-shadow: none;
}

@media (max-width: 768px) {
    .rg-chat-root {
        right: 1rem;
        bottom: 1rem;
    }

    .rg-chat-window {
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
        bottom: 4.75rem;
    }
}
