/**
 * LegalFlow AI — Product demo flow (TASK-CURSOR-002.1)
 * WhatsApp → Intake → CRM → Agenda
 */

#demo-flujo.demo-flow-section--commercial {
    padding-block: clamp(3rem, 7vw, 4.75rem);
    background: var(--lf-surface-muted);
    border-top: 1px solid var(--lf-border);
    border-bottom: 1px solid var(--lf-border);
}

#demo-flujo.demo-flow-section--commercial .demo-flow-section-head {
    margin-inline: auto;
    text-align: center;
    margin-bottom: clamp(2rem, 4vw, 2.75rem);
}

#demo-flujo.demo-flow-section--commercial .landing-section-kicker {
    font-size: var(--lf-text-xs);
    font-weight: 600;
    letter-spacing: var(--lf-tracking-wider);
    text-transform: uppercase;
}

#demo-flujo.demo-flow-section--commercial .demo-flow-section-head h2 {
    max-width: 26rem;
    margin-inline: auto;
    font-family: var(--lf-font-display);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.12;
    text-wrap: balance;
}

#demo-flujo.demo-flow-section--commercial .demo-flow-section-lead {
    max-width: 40rem;
    margin-inline: auto;
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.65;
    color: var(--lf-ink-muted);
}

#demo-flujo .demo-flow-visual {
    min-width: 0;
}

#demo-flujo .demo-flow-stages {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--lf-space-4);
    align-items: stretch;
}

#demo-flujo .demo-flow-stage {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: var(--lf-space-3);
    min-width: 0;
    min-height: 16.5rem;
    padding: var(--lf-space-4);
    border-radius: var(--lf-radius-lg);
    background: var(--lf-surface);
    border: 1px solid var(--lf-border);
    box-shadow: var(--lf-shadow-xs);
    opacity: 0.42;
    transform: translateY(6px);
    transition:
        opacity 0.55s var(--lf-ease),
        transform 0.55s var(--lf-ease),
        border-color 0.35s var(--lf-ease),
        box-shadow 0.35s var(--lf-ease);
}

#demo-flujo .demo-flow-visual.is-complete .demo-flow-stage,
#demo-flujo .demo-flow-stage.is-active {
    opacity: 1;
    transform: translateY(0);
    border-color: var(--lf-border-strong);
    box-shadow: var(--lf-shadow-sm);
}

#demo-flujo .demo-flow-stage.is-active {
    border-top: 2px solid var(--lf-brand);
}

#demo-flujo .demo-flow-stage-head {
    display: flex;
    align-items: center;
    gap: var(--lf-space-3);
}

#demo-flujo .demo-flow-stage-icon {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--lf-radius-sm);
    background: var(--lf-surface-muted);
    border: 1px solid var(--lf-border);
    color: var(--lf-brand);
    flex-shrink: 0;
}

#demo-flujo .demo-flow-stage.is-active .demo-flow-stage-icon {
    background: var(--lf-brand);
    border-color: var(--lf-brand);
    color: #fff;
}

#demo-flujo .demo-flow-stage-icon svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: currentColor;
    stroke: none;
}

#demo-flujo .demo-flow-stage-icon svg path[fill="none"],
#demo-flujo .demo-flow-stage-icon svg path:not([fill]) {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#demo-flujo .demo-flow-stage-title {
    margin: 0;
    font-size: var(--lf-text-base);
    font-weight: 600;
    color: var(--lf-ink);
}

#demo-flujo .demo-flow-stage-body {
    min-width: 0;
    display: grid;
    align-content: start;
}

/* WhatsApp */
#demo-flujo .demo-flow-whatsapp {
    gap: var(--lf-space-2);
}

#demo-flujo .demo-flow-chat {
    padding: var(--lf-space-3);
    border-radius: var(--lf-radius-md);
    font-size: var(--lf-text-sm);
    line-height: 1.5;
}

#demo-flujo .demo-flow-chat-label {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

#demo-flujo .demo-flow-chat p {
    margin: 0;
}

#demo-flujo .demo-flow-chat-user {
    background: #e8f5ec;
    border: 1px solid #c8e6d0;
}

#demo-flujo .demo-flow-chat-user .demo-flow-chat-label {
    color: #1f5c40;
}

#demo-flujo .demo-flow-chat-ai {
    background: var(--lf-surface-muted);
    border: 1px solid var(--lf-border);
}

#demo-flujo .demo-flow-chat-ai .demo-flow-chat-label {
    color: var(--lf-brand);
}

/* Intake */
#demo-flujo .demo-flow-fields {
    margin: 0;
    display: grid;
    gap: var(--lf-space-2);
}

#demo-flujo .demo-flow-field {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--lf-space-3);
    align-items: baseline;
    padding: var(--lf-space-2) 0;
    border-bottom: 1px solid var(--lf-border);
}

#demo-flujo .demo-flow-field:last-child {
    border-bottom: 0;
}

#demo-flujo .demo-flow-field dt {
    margin: 0;
    font-size: var(--lf-text-xs);
    font-weight: 500;
    color: var(--lf-ink-subtle);
}

#demo-flujo .demo-flow-field dd {
    margin: 0;
    font-size: var(--lf-text-sm);
    font-weight: 600;
    color: var(--lf-ink);
    text-align: right;
}

#demo-flujo .demo-flow-pill {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

#demo-flujo .demo-flow-pill-high {
    background: var(--lf-danger-soft);
    color: var(--lf-danger);
}

/* CRM */
#demo-flujo .demo-flow-lead-card {
    padding: var(--lf-space-4);
    border-radius: var(--lf-radius-md);
    background: var(--lf-surface-muted);
    border: 1px solid var(--lf-border);
}

#demo-flujo .demo-flow-lead-name {
    margin: 0 0 var(--lf-space-3);
    font-size: var(--lf-text-lg);
    font-weight: 600;
    color: var(--lf-ink);
}

#demo-flujo .demo-flow-lead-meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--lf-space-2);
}

#demo-flujo .demo-flow-lead-meta li {
    display: flex;
    justify-content: space-between;
    gap: var(--lf-space-3);
    font-size: var(--lf-text-sm);
}

#demo-flujo .demo-flow-lead-meta span {
    color: var(--lf-ink-subtle);
}

#demo-flujo .demo-flow-lead-meta strong {
    font-weight: 600;
    color: var(--lf-ink);
}

/* Agenda */
#demo-flujo .demo-flow-appointment {
    padding: var(--lf-space-4);
    border-radius: var(--lf-radius-md);
    background: linear-gradient(180deg, var(--lf-success-soft) 0%, var(--lf-surface) 100%);
    border: 1px solid rgba(31, 92, 64, 0.2);
}

#demo-flujo .demo-flow-appointment-status {
    margin: 0 0 var(--lf-space-2);
    font-size: var(--lf-text-xs);
    font-weight: 600;
    letter-spacing: var(--lf-tracking-wider);
    text-transform: uppercase;
    color: var(--lf-success);
}

#demo-flujo .demo-flow-appointment-slot {
    margin: 0 0 var(--lf-space-2);
    font-size: var(--lf-text-lg);
    color: var(--lf-ink);
}

#demo-flujo .demo-flow-appointment-slot strong {
    font-weight: 700;
}

#demo-flujo .demo-flow-appointment-lawyer {
    margin: 0;
    font-size: var(--lf-text-sm);
    color: var(--lf-ink-muted);
}

/* Connectors */
#demo-flujo .demo-flow-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 1.5rem;
    background: center / 1rem no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M8 3v10M5 6l3-3 3 3' stroke='%236b7a90' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    opacity: 0.35;
    transition: opacity 0.4s var(--lf-ease);
}

#demo-flujo .demo-flow-visual.is-complete .demo-flow-connector,
#demo-flujo .demo-flow-connector.is-active {
    opacity: 1;
}

@media (min-width: 992px) {
    #demo-flujo.demo-flow-section--commercial .demo-flow-section-head h2 {
        max-width: 34rem;
    }

    #demo-flujo .demo-flow-stages {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
        gap: var(--lf-space-3);
        align-items: stretch;
    }

    #demo-flujo .demo-flow-stage {
        min-height: 18rem;
    }

    #demo-flujo .demo-flow-connector {
        min-height: auto;
        align-self: center;
        width: 1.5rem;
        min-width: 1.5rem;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 8h10M9 5l3 3-3 3' stroke='%236b7a90' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    }
}

@media (max-width: 767.98px) {
    #demo-flujo.demo-flow-section--commercial {
        padding-block: 2.5rem;
    }

    #demo-flujo.demo-flow-section--commercial .demo-flow-section-head h2 {
        max-width: none;
        font-size: clamp(1.5rem, 6vw, 1.85rem);
    }

    #demo-flujo .demo-flow-stage {
        min-height: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    #demo-flujo .demo-flow-stage,
    #demo-flujo .demo-flow-connector {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
