/* Paleta de colores y variables MetaIA */
:root {
    --bg-color: #0b0f19;
    --card-bg: rgba(17, 24, 39, 0.7);
    --primary: #10b981; /* Emerald green */
    --primary-hover: #059669;
    --primary-glow: rgba(16, 185, 129, 0.4);
    --secondary: #3b82f6; /* Blue */
    --secondary-glow: rgba(59, 130, 246, 0.4);
    --accent: #8b5cf6; /* Purple */
    --accent-glow: rgba(139, 92, 246, 0.4);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --border: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(0, 0, 0, 0.25);
    --card-border: rgba(16, 185, 129, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 40px 20px;
    position: relative;
}

/* Background animated glow orbs */
.background-orbs {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    top: 0;
    left: 0;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
    animation: float 25s infinite alternate ease-in-out;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: -100px;
    left: -150px;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: var(--secondary);
    bottom: -150px;
    right: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: var(--accent);
    top: 40%;
    left: 30%;
    animation-delay: -14s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -70px) scale(1.1); }
    100% { transform: translate(-30px, 40px) scale(0.9); }
}

/* Container principal con Glassmorphism */
.wizard-container {
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border);
    border-radius: 24px;
    width: 100%;
    max-width: 950px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
    animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    box-shadow: 0 0 15px var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 18px;
}

h1 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff, #9ca3af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

main {
    padding: 30px;
}

.wizard-step {
    display: none;
    animation: slideIn 0.5s ease;
}

.wizard-step.active-step {
    display: block;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(15px); }
    to { opacity: 1; transform: translateX(0); }
}

h3 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

p.subtitle {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Formularios y Controles */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 13px;
    font-weight: 600;
    color: #e5e7eb;
    letter-spacing: 0.3px;
}

.form-control {
    background-color: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: white;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.3s;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background-color: rgba(0, 0, 0, 0.4);
}

textarea.form-control {
    resize: vertical;
}

/* Botones */
.btn {
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #0b0f19;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Pantalla del Chat */
.demo-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
}

.prompt-panel {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 18px;
}

.prompt-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary);
    font-weight: bold;
    font-size: 14px;
    padding: 0;
    font-family: inherit;
}

.prompt-toggle-icon {
    transition: transform 0.2s ease;
    color: var(--text-muted);
    font-size: 12px;
}

.prompt-panel:not(.collapsed) .prompt-toggle-icon {
    transform: rotate(90deg);
}

.prompt-collapsible {
    display: flex;
    flex-direction: column;
    margin-top: 14px;
}

.prompt-panel.collapsed .prompt-collapsible {
    display: none;
}

.chat-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    height: 600px;
}

/* WhatsApp Mockup Interface */
.chat-header {
    background: #075e54;
    color: white;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 38px;
    height: 38px;
    background: #128c7e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.chat-user-info {
    display: flex;
    flex-direction: column;
}

.chat-name {
    font-size: 14px;
    font-weight: 600;
}

.chat-status {
    font-size: 11px;
    opacity: 0.85;
}

.chat-messages {
    flex: 1;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    background-size: contain;
    background-color: #efeae2;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.msg-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.msg-wrapper.user {
    align-self: flex-end;
    align-items: flex-end;
}

.msg-wrapper.bot {
    align-self: flex-start;
    align-items: flex-start;
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.45;
    color: #111827;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.user .msg-bubble {
    background-color: #d9fdd3;
    border-top-right-radius: 0;
}

.bot .msg-bubble {
    background-color: #ffffff;
    border-top-left-radius: 0;
}

/* Markdown renderizado dentro de las burbujas: que respire y se lea bien */
.msg-bubble p {
    margin: 0 0 8px;
}
.msg-bubble p:last-child {
    margin-bottom: 0;
}
.msg-bubble ul,
.msg-bubble ol {
    margin: 4px 0 8px;
    padding-left: 20px;
}
.msg-bubble li {
    margin-bottom: 3px;
}
.msg-bubble strong {
    font-weight: 700;
}

.msg-time {
    font-size: 9px;
    color: #6b7280;
    margin-top: 3px;
}

.chat-footer {
    background: #f0f2f5;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.chat-input {
    flex: 1;
    background: white;
    border: none;
    border-radius: 20px;
    padding: 10px 18px;
    font-family: inherit;
    font-size: 13.5px;
    color: #1f2937;
    outline: none;
    resize: none;
    max-height: 100px;
    line-height: 1.3;
}

.chat-send-btn {
    background: #075e54;
    color: white;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.chat-send-btn:hover {
    transform: scale(1.05);
}

/* Pantalla de Feedback / Estrellas */
.stars-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    font-size: 44px;
    margin: 20px 0 30px;
    cursor: pointer;
}

.star {
    transition: transform 0.2s, filter 0.2s;
}

.star:hover {
    transform: scale(1.2);
}

/* Reporte Final */
.report-card {
    background: linear-gradient(145deg, #111827, #0b0f19);
    border: 1px solid var(--card-border);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.05);
    border-radius: 16px;
    padding: 35px;
    animation: glowBorder 4s infinite alternate;
}

@keyframes glowBorder {
    0% { border-color: rgba(16, 185, 129, 0.15); }
    100% { border-color: rgba(16, 185, 129, 0.35); }
}

.report-summary {
    font-size: 16.5px;
    line-height: 1.7;
    color: #e5e7eb;
    margin-bottom: 30px;
}

.service-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
    transition: transform 0.3s;
}

.service-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255,255,255,0.15);
}

.service-icon {
    font-size: 28px;
    display: flex;
    align-items: center;
}

.service-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.service-title {
    font-size: 16px;
    font-weight: 700;
    color: white;
}

.service-reason {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.45;
}

.cta-box {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    margin-top: 35px;
}

.cta-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 15px;
}
