:root {
    color-scheme: light;
    --brand: #ff974b;
    --brand-dark: #d96f2d;
    --brand-soft: #fff0e6;
    --brand-pale: #fff8f3;
    --ink: #201d19;
    --muted: #6f675f;
    --panel: #ffffff;
    --chat: #f3eee8;
    --bot: #ffffff;
    --line: #eadfd3;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at 10% 10%, #fff7ed 0, #faf9f7 44%, #f2f0ed 100%);
}

.demo-shell {
    width: min(1180px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 470px);
    gap: 64px;
    align-items: center;
    padding: 42px 0;
}

.intro { max-width: 590px; }

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    color: var(--brand-dark);
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .14em;
}
.brand-link:hover { color: var(--brand); }
.brand-logo {
    width: 54px;
    height: 48px;
    object-fit: contain;
    display: block;
}
.intro h1 {
    margin: 0 0 18px;
    font-size: clamp(38px, 5vw, 64px);
    line-height: 1.02;
    letter-spacing: -.045em;
}
.intro > p {
    font-size: 18px;
    line-height: 1.6;
    color: var(--muted);
}
.suggestions-block {
    margin: 28px 0 22px;
}

.suggestions-title {
    display: block;
    margin-bottom: 16px;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.35;
    font-weight: 800;
}

.suggestions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
    margin: 0;
}

.suggestions button {
    width: 100%;
    min-height: 54px;
    border: 1.5px solid rgba(255, 151, 75, .55);
    background: rgba(255,255,255,.72);
    color: var(--brand-dark);
    border-radius: 999px;
    padding: 12px 18px 12px 20px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    text-align: left;
    transition:
        background-color .18s ease,
        border-color .18s ease,
        transform .18s ease,
        box-shadow .18s ease;
}

.suggestions button:hover {
    background: var(--brand-pale);
    border-color: var(--brand);
    box-shadow: 0 8px 20px rgba(217, 111, 45, .10);
    transform: translateY(-1px);
}

.suggestion-arrow {
    flex: 0 0 auto;
    color: var(--brand);
    font-size: 24px;
    line-height: 1;
    font-weight: 500;
    transform: translateY(-1px);
}

.privacy-note { font-size: 13px !important; margin: 0; }

.intro-footer {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
}
.official-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--brand-dark);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}
.official-link:hover {
    color: var(--brand);
    text-decoration: underline;
}

.phone {
    height: min(760px, calc(100vh - 50px));
    min-height: 590px;
    background: var(--chat);
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(99, 55, 10, .16), 0 3px 12px rgba(99, 55, 10, .08);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(173, 92, 0, .10);
}

.chat-header {
    height: 76px;
    flex: 0 0 76px;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 18px;
    gap: 12px;
}
.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    overflow: hidden;
    
}
.avatar img {
    width: 37px;
    height: 34px;
    object-fit: contain;
    display: block;
}
.chat-header strong { display: block; font-size: 15px; }
.chat-header span { display: block; font-size: 12px; opacity: .82; margin-top: 2px; }
.reset {
    margin-left: auto;
    border: 1px solid rgba(255,255,255,.35);
    color: #fff;
    background: transparent;
    border-radius: 999px;
    padding: 8px 11px;
    cursor: pointer;
}
.reset:hover { background: rgba(255,255,255,.12); }

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 22px 15px 14px;
    background-color: var(--chat);
    background-image:
        radial-gradient(circle at 20px 20px, rgba(255,151,75,.045) 1px, transparent 1.5px);
    background-size: 24px 24px;
}
.message { display: flex; margin: 7px 0; }
.message.user { justify-content: flex-end; }
.message.bot, .message.error { justify-content: flex-start; }
.bubble {
    max-width: 84%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 15px;
    line-height: 1.42;
    box-shadow: 0 1px 1px rgba(0,0,0,.06);
}
.user .bubble { background: var(--brand-soft); border-top-right-radius: 3px; }
.bot .bubble { background: var(--bot); border-top-left-radius: 3px; }
.error .bubble { background: #fff1f0; color: #8c2b23; }

.typing {
    padding: 2px 18px 10px;
    background: var(--chat);
}
.typing span {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 3px;
    border-radius: 50%;
    background: #80918c;
    animation: pulse 1s infinite alternate;
}
.typing span:nth-child(2) { animation-delay: .18s; }
.typing span:nth-child(3) { animation-delay: .36s; }
@keyframes pulse { to { opacity: .25; transform: translateY(-2px); } }

.composer {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px;
    background: #faf7f3;
    border-top: 1px solid rgba(0,0,0,.04);
}
.composer textarea {
    flex: 1;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 11px 15px;
    font: inherit;
    outline: none;
    background: #fff;
}
.composer textarea:focus { border-color: #f2a54d; box-shadow: 0 0 0 3px rgba(255,151,75,.10); }
.composer button {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
    font-size: 18px;
}
.composer button:disabled { opacity: .45; cursor: default; }

@media (max-width: 850px) {
    .demo-shell {
        width: min(100% - 20px, 620px);
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 28px 0 18px;
    }
    .brand-logo { width: 48px; height: 43px; }
    .intro h1 { font-size: 38px; }
    .intro > p { font-size: 16px; }
    .phone { height: 72vh; min-height: 560px; }
}

/* Mensaje de bienvenida: más compacto y legible que una burbuja centrada. */
.welcome-message {
    margin-top: 2px;
}
.welcome-message .bubble {
    max-width: 92%;
    padding: 14px 16px;
    text-align: left;
    line-height: 1.45;
}
.welcome-message .bubble strong {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.4;
}
.welcome-message .bubble span {
    display: block;
    color: var(--ink);
}

@media (max-width: 850px) {
    .welcome-message .bubble {
        max-width: 94%;
        padding: 13px 15px;
    }
}


/* Precios dentro de los mensajes del bot.
   demo.js añade esta clase solo a negritas que son importes en euros. */
.bot .bubble .price-badge {
    display: inline-block;
    margin-left: 3px;
    padding: 2px 8px 3px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    border: 1px solid rgba(255, 151, 75, .32);
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    vertical-align: baseline;
}

/* Un poco más de aire para listas largas de servicios/precios. */
.bot .bubble {
    line-height: 1.48;
}


/* Capacidades principales de la demo */
.demo-features {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 28px 0 4px;
}

.demo-feature {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.28;
    font-weight: 600;
}

.demo-feature-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ffe8d5;
    box-shadow: inset 0 0 0 1px rgba(255, 151, 75, .10);
}

.demo-feature-icon svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: var(--brand-dark);
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 1080px) and (min-width: 851px) {
    .demo-features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 22px;
    }
}

@media (max-width: 850px) {
    .demo-features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 18px;
        margin-top: 24px;
    }
}

@media (max-width: 430px) {
    .demo-features {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .demo-feature-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }
}


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

    .suggestions button {
        min-height: 50px;
    }
}
