/* --- IMPORTACIÓN DE FUENTES (SIEMPRE AL PRINCIPIO) --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;800&display=swap');

/* --- Estilo del Contenedor --- */
.aideal-dev-ia-container { font-family: 'Inter', sans-serif; }

/* --- Estilo del Botón de Apertura (Premium) --- */
.aideal-dev-ia-container .aideal-dev-ia-open-chat {
    background: linear-gradient(90deg, #601FE8, #A435B3, #601FE8) !important;
    background-size: 200% auto !important; color: white !important; border: none !important;
    border-radius: 50px !important; padding: 18px 35px !important; font-family: 'Inter', sans-serif !important;
    font-size: 16px !important; font-weight: bold !important; letter-spacing: 0.5px; cursor: pointer !important;
    box-shadow: 0 4px 20px rgba(96, 31, 232, 0.4) !important; transition: all 0.4s ease-out !important;
    display: inline-block !important; text-align: center; line-height: 1.2 !important;
    -webkit-appearance: none !important; appearance: none !important;
}
.aideal-dev-ia-container .aideal-dev-ia-open-chat:hover {
    transform: translateY(-3px) !important; box-shadow: 0 8px 30px rgba(96, 31, 232, 0.6) !important;
    background-position: right center !important;
}

/* --- Estructura del Popup (Efecto Translúcido) --- */
.aideal-dev-ia-popup-overlay {
    position: fixed; inset: 0; background: rgba(10, 10, 10, 0.5);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000; opacity: 0; transition: opacity 0.3s ease; font-family: 'Inter', sans-serif;
}
.aideal-dev-ia-popup-overlay.visible { opacity: 1; }
.aideal-dev-ia-popup-container {
    background: rgba(24, 24, 27, 0.95); color: #E4E4E7;
    border-radius: 20px; width: 90%; max-width: 520px;
    height: 90%; max-height: 720px; display: flex; flex-direction: column;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5); border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.95); opacity: 0; transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.aideal-dev-ia-popup-overlay.visible .aideal-dev-ia-popup-container { transform: scale(1); opacity: 1; }
.aideal-dev-ia-popup-header {
    padding: 15px 20px; display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); flex-shrink: 0;
}
.aideal-dev-ia-brand { font-size: 18px; font-weight: 500; }
.aideal-dev-ia-brand strong { font-weight: 800; background: linear-gradient(90deg, #818CF8, #C084FC); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.aideal-dev-ia-popup-close { background: none; border: none; color: #71717A; font-size: 24px; cursor: pointer; transition: color 0.2s; }
.aideal-dev-ia-popup-close:hover { color: white; }
.aideal-dev-ia-popup-content { flex-grow: 1; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.aideal-dev-ia-step { position: absolute; inset: 0; padding: 20px; display: flex; flex-direction: column; opacity: 0; visibility: hidden; transition: all 0.4s ease; transform: scale(0.98); }
.aideal-dev-ia-step.active { opacity: 1; visibility: visible; transform: scale(1); }
.aideal-dev-ia-chat-messages { flex-grow: 1; overflow-y: auto; padding: 10px 0; display: flex; flex-direction: column; }
.aideal-dev-ia-message { max-width: 85%; padding: 12px 18px; border-radius: 20px; line-height: 1.5; margin-bottom: 10px; opacity: 0; animation: slide-up 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards; }
@keyframes slide-up { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.aideal-dev-ia-message.bot { background: #27272A; border-bottom-left-radius: 5px; align-self: flex-start; }
.aideal-dev-ia-message.user { background: #6366F1; color: white; border-bottom-right-radius: 5px; align-self: flex-end; }
.typing-indicator { display: inline-flex; align-items: center; }
.typing-indicator span { width: 6px; height: 6px; background-color: #A1A1AA; border-radius: 50%; margin: 0 2px; animation: bounce 1.2s infinite ease-in-out; }
.typing-indicator span:nth-child(2) { animation-delay: -0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: -0.4s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }
.aideal-dev-ia-consent-area { padding: 15px 10px 5px; border-top: 1px solid rgba(255, 255, 255, 0.1); flex-shrink: 0; display: flex; align-items: center; }
#aideal-dev-ia-consent-check { -webkit-appearance: none; appearance: none; background-color: transparent; margin: 0; font: inherit; color: #71717A; width: 1.15em; height: 1.15em; border: 0.1em solid currentColor; border-radius: 0.25em; transform: translateY(-0.075em); display: grid; place-content: center; cursor: pointer; margin-right: 10px; }
#aideal-dev-ia-consent-check::before { content: ""; width: 0.65em; height: 0.65em; transform: scale(0); transition: 120ms transform ease-in-out; box-shadow: inset 1em 1em #6366F1; transform-origin: bottom left; clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); }
#aideal-dev-ia-consent-check:checked::before { transform: scale(1); }
.aideal-dev-ia-consent-area label { font-size: 12px; color: #A1A1AA; line-height: 1.5; }
.aideal-dev-ia-consent-area a { color: #A78BFA !important; text-decoration: none; }
.aideal-dev-ia-consent-area a:hover { text-decoration: underline; }
.aideal-dev-ia-chat-input-area { padding-top: 15px; border-top: 1px solid rgba(255, 255, 255, 0.1); flex-shrink: 0; }
.aideal-dev-ia-chat-input-wrapper { display: flex; align-items: center; background: #27272A; border-radius: 12px; }
#aideal-dev-ia-user-input { flex-grow: 1; background: transparent; border: none; color: white; padding: 12px 15px; font-size: 16px; transition: background-color 0.3s; }
#aideal-dev-ia-user-input:focus { outline: none; }
#aideal-dev-ia-user-input:disabled { background-color: rgba(255,255,255,0.05); cursor: not-allowed; }
#aideal-dev-ia-send-btn { background: none; border: none; padding: 10px; cursor: pointer; }
#aideal-dev-ia-send-btn svg { width: 24px; height: 24px; color: #A1A1AA; transition: color 0.2s; }
#aideal-dev-ia-send-btn:hover svg { color: #6366F1; }
#aideal-dev-ia-send-btn:disabled svg { color: #52525B; cursor: not-allowed;}
.aideal-dev-ia-error-message { color: #F87171; font-size: 14px; text-align: center; padding-top: 10px; }
.aideal-dev-ia-step-2, .aideal-dev-ia-step-4 .report-header { text-align: center; justify-content: center; align-items: center; gap: 20px; }
.aideal-dev-ia-step-2 h4 { font-size: 20px; color: white; }
.aideal-dev-ia-loading-status { color: #A1A1AA; line-height: 1.6; max-width: 80%; margin: 0 auto; height: 40px; transition: all 0.5s ease; }
.aideal-dev-ia-logo-loader { width: 60px; height: 60px; border-radius: 50%; border: 4px solid #6366F1; border-top-color: transparent; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.aideal-dev-ia-report-content { flex-grow: 1; overflow-y: auto; padding-right: 10px; }
.aideal-dev-ia-report-actions { padding-top: 20px; flex-shrink: 0; }
.aideal-dev-ia-print-pdf, .aideal-dev-ia-download-pdf { width: 100%; background: #6366F1; color: white; border: none; border-radius: 12px; padding: 15px; font-size: 16px; font-weight: bold; cursor: pointer; transition: background 0.2s; }
.aideal-dev-ia-print-pdf:hover, .aideal-dev-ia-download-pdf:hover { background: #4F46E5; }
.aideal-dev-ia-download-pdf.whatsapp { background: #25D366; }
.aideal-dev-ia-download-pdf.whatsapp:hover { background: #1EBE57; }