/* "Från fråga till svar" on the VeraChat product page: the question's way through the calling
   system and VeraChat, step by step as the system documentation numbers it. verachat-flow.js
   plays it once the section is in view; without the script, or with reduced motion, every step
   is listed and the whole flow stands lit. */

.vcf {
    --vcf-bg: #f7f5f2;
    --vcf-card: #fff;
    --vcf-line: #d9d4cd;
    --vcf-muted: #7a746c;
    --vcf-text: #333;
    --vcf-orange: #F18C34;
    --vcf-orange-soft: #fff1e4;
    --vcf-orange-line: #f5c79c;
    --vcf-green: #3d7a45;
    --vcf-green-line: #b9d8bd;
    background: var(--vcf-bg);
    color: var(--vcf-text);
    padding: 30px 28px 22px;
    font-family: "Open Sans", "Segoe UI", Arial, sans-serif;
    text-align: left;
}

.vcf-label {
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--vcf-muted);
    margin: 0 0 10px;
}

/* The calling side in a row: user, the customer's system, VeraChat. */
.vcf-row {
    display: flex;
    align-items: stretch;
}

.vcf-node {
    flex: 1 1 0;
    min-width: 0;
    border: 2px solid var(--vcf-line);
    border-radius: 10px;
    background: var(--vcf-card);
    padding: 10px 14px;
    color: var(--vcf-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .4s, background-color .4s, box-shadow .4s;
}

    .vcf-node b {
        display: block;
        font-size: 14px;
        font-weight: 600;
        transition: color .4s;
    }

    .vcf-node small {
        display: block;
        font-size: 11.5px;
        color: var(--vcf-muted);
        line-height: 1.35;
    }

    .vcf-node.is-done {
        border-color: var(--vcf-orange-line);
    }

    .vcf-node.is-current {
        border-color: var(--vcf-orange);
        background: var(--vcf-orange-soft);
        box-shadow: 0 0 0 4px rgba(241, 140, 52, .15), 0 4px 16px rgba(241, 140, 52, .2);
    }

        .vcf-node.is-current b {
            color: #c9661a;
        }

    .vcf-node:focus-visible {
        outline: 2px solid var(--vcf-orange);
        outline-offset: 2px;
    }

.vcf-link {
    position: relative;
    flex: 0 0 36px;
    align-self: center;
    height: 2px;
    background: var(--vcf-line);
}

    .vcf-link::after {
        content: "";
        position: absolute;
        inset: 0;
        background: var(--vcf-orange);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform .6s ease-in-out;
    }

    .vcf-link.is-on::after {
        transform: scaleX(1);
    }

    /* The answer on its way back to the user: a dot running right to left. */
    .vcf-link.is-back::before {
        content: "";
        position: absolute;
        top: -4px;
        right: 0;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: var(--vcf-orange);
        box-shadow: 0 0 0 3px var(--vcf-orange-soft);
        z-index: 1;
        animation: vcf-back 1.1s ease-in-out infinite;
    }

@keyframes vcf-back {
    from { right: 0; opacity: 1; }
    to { right: calc(100% - 10px); opacity: .2; }
}

.vcf-outer {
    margin-bottom: 26px;
}

    .vcf-outer .vcf-link {
        flex: 1 1 auto;
    }

/* Below the calling side: the steps inside VeraChat as a list, numbered as in the system
   documentation, and beside it what happens at the current step. */
.vcf-body {
    display: grid;
    grid-template-columns: minmax(250px, 36%) 1fr;
    gap: 26px;
    align-items: start;
}

.vcf-pipe {
    border: 1px dashed var(--vcf-line);
    border-radius: 12px;
    padding: 14px 14px 16px;
    background: rgba(255, 255, 255, .5);
}

.vcf-list {
    display: flex;
    flex-direction: column;
}

.vcf-step {
    flex: none;
    display: grid;
    grid-template-columns: 24px 1fr;
    column-gap: 10px;
    align-items: center;
    padding: 6px 10px;
    border-radius: 8px;
}

    .vcf-step i {
        grid-row: span 2;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        border: 2px solid var(--vcf-line);
        color: var(--vcf-muted);
        font-style: normal;
        font-size: 11px;
        font-weight: 700;
        display: grid;
        place-items: center;
        transition: border-color .4s, color .4s, background-color .4s;
    }

    .vcf-step b {
        font-size: 13px;
    }

    .vcf-step small {
        font-size: 11px;
    }

    .vcf-step.is-done i {
        border-color: var(--vcf-orange-line);
        color: #c9661a;
    }

    .vcf-step.is-current i {
        border-color: var(--vcf-orange);
        background: var(--vcf-orange);
        color: #fff;
    }

.vcf-link--v {
    flex: 0 0 10px;
    align-self: flex-start;
    width: 2px;
    height: auto;
    margin-left: 23px;
}

    .vcf-link--v::after {
        transform: scaleY(0);
        transform-origin: top;
    }

    .vcf-link--v.is-on::after {
        transform: scaleY(1);
    }

/* What happens at the current step, and what the question looks like by then. */
.vcf-detail {
    padding-top: 4px;
}

    .vcf-detail ol {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .vcf-detail li {
        display: grid;
        grid-template-columns: 44px 1fr;
        column-gap: 14px;
        padding: 10px 0;
    }

    .vcf.is-live .vcf-detail li {
        display: none;
    }

        .vcf.is-live .vcf-detail li.is-current {
            display: grid;
            animation: vcf-in .4s ease-out both;
        }

.vcf-num {
    grid-row: span 3;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--vcf-orange);
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    display: grid;
    place-items: center;
}

.vcf-detail h5 {
    margin: 2px 0 4px;
    color: #222;
    font-size: 15px;
    text-transform: none;
}

.vcf-detail p {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.vcf-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.vcf-chip {
    border: 1px solid var(--vcf-line);
    border-radius: 14px;
    padding: 2px 11px;
    font-size: 12.5px;
    color: #555;
    background: var(--vcf-card);
}

    .vcf-chip.is-add {
        border-color: var(--vcf-orange-line);
        background: var(--vcf-orange-soft);
        color: #b85a12;
    }

    .vcf-chip.is-ok {
        border-color: var(--vcf-green-line);
        background: #eef7ef;
        color: var(--vcf-green);
    }

    .vcf-chip.is-stop {
        border-color: #e8b4b4;
        background: #fbeeee;
        color: #a33a3a;
    }

    .vcf-chip.is-code {
        font-family: Consolas, "Courier New", monospace;
        font-size: 12px;
    }

.vcf-controls {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

.vcf-toggle {
    background: var(--vcf-card);
    border: 1px solid var(--vcf-line);
    border-radius: 14px;
    color: var(--vcf-muted);
    font-size: 12px;
    padding: 3px 12px;
    cursor: pointer;
}

    .vcf-toggle:hover {
        border-color: var(--vcf-orange);
        color: #c9661a;
    }

.vcf:not(.is-live) .vcf-controls {
    display: none;
}

.vcf:not(.is-live) .vcf-node {
    border-color: var(--vcf-orange-line);
}

.vcf:not(.is-live) .vcf-link::after {
    transform: none;
}

@keyframes vcf-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

/* On a phone the flow runs downwards, the list above the explanation. */
@media (max-width: 767px) {
    .vcf {
        padding: 22px 16px 18px;
    }

    .vcf-row {
        flex-direction: column;
    }

    .vcf-node {
        flex: none;
    }

    .vcf-outer .vcf-link {
        flex: 0 0 16px;
        width: 2px;
        height: auto;
    }

        .vcf-outer .vcf-link::after {
            transform: scaleY(0);
            transform-origin: top;
        }

        .vcf-outer .vcf-link.is-on::after {
            transform: scaleY(1);
        }

        .vcf-outer .vcf-link.is-back::before {
            display: none;
        }

    .vcf-body {
        grid-template-columns: 1fr;
    }

    .vcf-detail li {
        grid-template-columns: 34px 1fr;
    }

    .vcf-num {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vcf *, .vcf *::before, .vcf *::after { animation: none !important; transition: none !important; }
}
