/**
 * Netstream Calculator
 *
 * Typography comes from the site, the colours from the brand guide. Only the structure of the
 * calculator is styled here, so the widget sits in an Elementor page without fighting it.
 */

.nsca {
    --nsca-dark-blue: #193750;
    --nsca-blue: #005faa;
    --nsca-light-blue: #4bcdff;
    --nsca-ice-blue: #e9f8fe;
    --nsca-green: #28e6b4;
    --nsca-anthracite: #494949;
    --nsca-dark-grey: #747474;
    --nsca-grey: #cdcdcd;
    --nsca-light-grey: #f7f7f7;
    --nsca-line: #eef2f5;
    --nsca-border: #e4e9ee;

    color: var(--nsca-anthracite);
    font: inherit;
    line-height: 1.55;

    /*
     * Positionsnamen, Mengen und Zeilensummen erben die Textgrösse der Seite, 20 px auf
     * netstream.ch. Alles andere trägt feste Werte: es sind Beschriftungen und Hinweise, keine
     * zweite Ebene Fliesstext. Die Knöpfe folgen den Knöpfen der Website mit 15 px.
     */
}

.nsca *,
.nsca *::before,
.nsca *::after {
    box-sizing: border-box;
}

/* display beats the hidden attribute, so it has to be switched off explicitly */
.nsca [hidden] {
    display: none !important;
}

.nsca-layout {
    align-items: start;
    display: grid;
    gap: 32px;
    grid-template-columns: minmax(0, 1fr) 372px;
}

.nsca-main {
    container-name: nsca;
    container-type: inline-size;
    min-width: 0;
}

/* Configurator ---------------------------------------------------------- */

.nsca-table {
    background: #fff;
    border: 1px solid var(--nsca-border);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(25, 55, 80, .04), 0 12px 32px -18px rgba(25, 55, 80, .22);
}

/*
 * Kein overflow: hidden. Die Karte hat damit die Tooltip-Blase der ersten Zeile abgeschnitten.
 * Die Ecken runden stattdessen die Rand-Kinder selber ab.
 */
.nsca-table > :first-child {
    border-radius: 12px 12px 0 0;
}

.nsca-table > :last-child {
    border-radius: 0 0 12px 12px;
}

.nsca-group {
    align-items: center;
    background: var(--nsca-light-grey);
    color: var(--nsca-dark-grey);
    display: flex;
    font-size: .6875rem;
    font-weight: 500;
    gap: 10px;
    letter-spacing: .16em;
    padding: 14px 22px 12px;
    text-transform: uppercase;
}

.nsca-group span {
    background: var(--nsca-light-blue);
    border-radius: 50%;
    height: 5px;
    width: 5px;
}

.nsca-row {
    align-items: center;
    border-top: 1px solid var(--nsca-line);
    display: grid;
    gap: 6px 20px;
    grid-template-columns: minmax(7em, 1fr) auto;
    padding: 16px 22px;
    transition: background .15s ease;
}

.nsca-row:hover {
    background: #fcfdfe;
}

.nsca-row-name {
    align-items: center;
    position: relative;
    color: var(--nsca-dark-blue);
    display: flex;
    flex-wrap: wrap;
    font-size: 1rem;
    font-weight: 500;
    gap: 4px 8px;
    min-width: 0;
}

/* Lange Positionsnamen brechen um, statt in der Spalte abgeschnitten zu werden. */
.nsca-row-name label {
    cursor: pointer;
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.nsca-row-price {
    color: var(--nsca-dark-grey);
    font-size: .75rem;
    font-variant-numeric: tabular-nums;
    grid-column: 1;
}

.nsca-row-control {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-column: 2;
    grid-row: 1 / span 2;
    grid-template-columns: 7em 3.4em minmax(6em, auto);
}

.nsca-line {
    color: var(--nsca-dark-blue);
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    text-align: right;
}

.nsca-line[data-zero="1"] {
    color: var(--nsca-grey);
}

.nsca-unit {
    color: var(--nsca-dark-grey);
    font-size: .8125rem;
}

/* Quantity ------------------------------------------------------------- */

.nsca-stepper {
    align-items: center;
    background: #fff;
    border: 1px solid var(--nsca-grey);
    border-radius: 999px;
    display: flex;
    height: 36px;
    justify-content: space-between;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.nsca-stepper:focus-within {
    border-color: var(--nsca-blue);
    box-shadow: 0 0 0 3px var(--nsca-ice-blue);
}

.nsca .nsca-stepper button,
.nsca .nsca-stepper button:hover,
.nsca .nsca-stepper button:focus,
.nsca .nsca-stepper button:focus-visible,
.nsca .nsca-stepper button:active {
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: var(--nsca-blue);
    cursor: pointer;
    flex: 0 0 34px;
    font-size: 1.125rem;
    height: 34px;
    line-height: 1;
    padding: 0;
    text-decoration: none;
    transition: transform .16s ease;
}

.nsca .nsca-stepper button:hover {
    transform: scale(1.18);
}

.nsca .nsca-stepper button:active {
    transform: scale(.94);
}

.nsca-stepper input {
    background: transparent;
    border: 0;
    color: var(--nsca-dark-blue);
    font: inherit;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    min-width: 0;
    padding: 0;
    text-align: center;
    width: 100%;
}

.nsca-stepper input:focus {
    outline: none;
}

.nsca-stepper input::-webkit-outer-spin-button,
.nsca-stepper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.nsca-stepper input[type="number"] {
    -moz-appearance: textfield;
}

/* Segmented choice ----------------------------------------------------- */

.nsca-segment {
    border: 1px solid var(--nsca-grey);
    border-radius: 999px;
    display: flex;
    grid-column: 1 / span 2;
    height: 36px;
    overflow: hidden;
}

.nsca-segment input {
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

.nsca-segment label {
    align-items: center;
    color: var(--nsca-blue);
    cursor: pointer;
    display: flex;
    flex: 1;
    font-size: .9375rem;
    font-weight: 500;
    justify-content: center;
    margin: 0;
    transition: background .15s ease, color .15s ease;
}

.nsca-segment input:not(:first-of-type) + label {
    border-left: 1px solid var(--nsca-grey);
}

.nsca-segment input:checked + label {
    background: var(--nsca-blue);
    color: #fff;
}

.nsca-segment input:focus-visible + label {
    box-shadow: inset 0 0 0 2px var(--nsca-light-blue);
}

/* Dropdown and switch -------------------------------------------------- */

.nsca-select {
    background: #fff;
    border: 1px solid var(--nsca-grey);
    border-radius: 999px;
    color: var(--nsca-dark-blue);
    font: inherit;
    font-size: .9375rem;
    grid-column: 1 / span 2;
    height: 36px;
    padding: 0 12px;
    width: 100%;
}

.nsca-select:focus-visible {
    border-color: var(--nsca-blue);
    box-shadow: 0 0 0 3px var(--nsca-ice-blue);
    outline: none;
}

.nsca-toggle {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 10px;
    grid-column: 1 / span 2;
    margin: 0;
}

.nsca-toggle input {
    height: 0;
    opacity: 0;
    position: absolute;
    width: 0;
}

.nsca-toggle-track {
    background: var(--nsca-grey);
    border-radius: 999px;
    flex: 0 0 auto;
    height: 20px;
    position: relative;
    transition: background .16s ease;
    width: 36px;
}

.nsca-toggle-knob {
    background: #fff;
    border-radius: 50%;
    height: 16px;
    left: 2px;
    position: absolute;
    top: 2px;
    transition: transform .16s ease;
    width: 16px;
}

.nsca-toggle input:checked + .nsca-toggle-track {
    background: var(--nsca-blue);
}

.nsca-toggle input:checked + .nsca-toggle-track .nsca-toggle-knob {
    transform: translateX(16px);
}

.nsca-toggle input:focus-visible + .nsca-toggle-track {
    box-shadow: 0 0 0 3px var(--nsca-ice-blue);
}

.nsca-toggle-label {
    color: var(--nsca-dark-grey);
    font-size: .8125rem;
}

/* Weitere Summen neben der grossen Zahl */

.nsca-box-more {
    border-top: 1px solid rgba(255, 255, 255, .16);
    font-size: .8125rem;
    list-style: none;
    margin: 12px 0 0;
    padding: 10px 0 0;
}

.nsca-box-more:empty {
    display: none;
}

.nsca-box-more li {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 3px 0;
}

.nsca-box-more li span:last-child {
    color: #fff;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.nsca-box-more li span:first-child {
    color: rgba(255, 255, 255, .7);
}

/* Tooltip -------------------------------------------------------------- */

.nsca-tip-wrap {
    display: inline-flex;
}

.nsca .nsca-tip,
.nsca .nsca-tip:hover,
.nsca .nsca-tip:focus,
.nsca .nsca-tip:focus-visible,
.nsca .nsca-tip:active {
    align-items: center;
    background: #fff;
    border: 1px solid var(--nsca-grey);
    border-radius: 50%;
    color: var(--nsca-blue);
    cursor: help;
    display: inline-flex;
    font-size: .6875rem;
    font-weight: 300;
    height: 16px;
    justify-content: center;
    padding: 0;
    width: 16px;
}

.nsca-tip-text {
    background: var(--nsca-dark-blue);
    border-radius: 6px;
    bottom: calc(100% + 8px);
    max-width: min(240px, calc(100vw - 48px));
    color: #fff;
    font-size: .8125rem;
    left: 0;
    line-height: 1.45;
    max-width: 240px;
    opacity: 0;
    padding: 9px 12px;
    position: absolute;
    text-align: left;
    transform: translateY(4px);
    transition: opacity .16s ease, transform .16s ease;
    visibility: hidden;
    width: max-content;
    z-index: 5;
}

.nsca-tip-wrap:hover .nsca-tip-text,
.nsca-tip:focus-visible + .nsca-tip-text,
.nsca-tip[aria-expanded="true"] + .nsca-tip-text {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

/* Kein Platz oben: die Blase klappt nach unten. Kein Platz rechts: sie richtet sich rechts aus. */
.nsca-tip-text.is-below {
    bottom: auto;
    top: calc(100% + 8px);
    transform: translateY(-4px);
}

.nsca-tip-wrap:hover .nsca-tip-text.is-below,
.nsca-tip:focus-visible + .nsca-tip-text.is-below,
.nsca-tip[aria-expanded="true"] + .nsca-tip-text.is-below {
    transform: translateY(0);
}

.nsca-tip-text.is-right {
    left: auto;
    right: 0;
}

.nsca-tip-text a {
    color: var(--nsca-light-blue);
    display: inline-block;
    margin-top: 6px;
}

.nsca-note {
    color: var(--nsca-dark-grey);
    font-size: .75rem;
    margin: 14px 2px 0;
}

/* Summary box ---------------------------------------------------------- */

.nsca-box {
    background: var(--nsca-dark-blue);
    border-radius: 12px;
    box-shadow: 0 14px 36px -18px rgba(25, 55, 80, .5);
    color: #fff;
    padding: 22px;
    position: sticky;
    top: 24px;
}

.nsca-summary {
    border-bottom: 1px solid rgba(255, 255, 255, .16);
    margin-bottom: 16px;
}

.nsca-summary summary {
    align-items: center;
    color: #fff;
    cursor: pointer;
    display: flex;
    font-size: .9375rem;
    gap: 10px;
    list-style: none;
    padding: 0 0 13px;
    transition: color .15s ease;
}

.nsca-summary summary::-webkit-details-marker {
    display: none;
}

.nsca-summary summary:hover {
    color: var(--nsca-light-blue);
}

.nsca-summary summary::after {
    border-bottom: 1.5px solid var(--nsca-light-blue);
    border-right: 1.5px solid var(--nsca-light-blue);
    content: "";
    height: 7px;
    margin-left: auto;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .2s ease;
    width: 7px;
}

.nsca-summary[open] summary::after {
    transform: rotate(-135deg) translateY(-2px);
}

.nsca-summary-count {
    color: rgba(255, 255, 255, .6);
    font-size: .75rem;
    font-variant-numeric: tabular-nums;
}

.nsca-summary ul {
    animation: nsca-in .2s ease;
    font-size: .8125rem;
    list-style: none;
    margin: 0;
    padding: 4px 0 6px;
}

.nsca-summary li {
    align-items: baseline;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding: 9px 0;
}

.nsca-summary li:last-of-type {
    border-bottom: 0;
}

.nsca-summary-item {
    color: rgba(255, 255, 255, .86);
}

.nsca-summary-qty {
    color: var(--nsca-light-blue);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    white-space: nowrap;
}

.nsca-summary-amount {
    color: #fff;
    padding-left: 6px;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    text-align: right;
    white-space: nowrap;
}

.nsca-summary-empty {
    border-bottom: 0;
    color: rgba(255, 255, 255, .6);
    display: block;
}

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

.nsca-box-key {
    color: var(--nsca-light-blue);
    font-size: .6875rem;
    font-weight: 500;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.nsca-box-value {
    font-size: 1.75rem;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    line-height: 1.1;
}

.nsca-box-period {
    color: rgba(255, 255, 255, .7);
    font-size: .75rem;
}

.nsca-box-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

/*
 * Buttons: the behaviour is always a small scale, never a colour change.
 *
 * Themes style button states on the element, hello-elementor for instance sets
 * button:hover{background-color:#c36}. An element selector plus a pseudo-class outranks a
 * single class, so every control is anchored to the root container and every state spells out
 * its colours instead of relying on the base rule.
 */

.nsca .nsca-cta,
.nsca .nsca-cta-second,
.nsca .nsca-submit {
    align-items: center;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: .9375rem;
    height: 38px;
    justify-content: center;
    line-height: 1;
    transition: transform .16s ease;
    white-space: nowrap;
}

.nsca .nsca-cta:hover,
.nsca .nsca-cta-second:hover,
.nsca .nsca-submit:hover {
    transform: scale(1.04);
}

.nsca .nsca-cta:active,
.nsca .nsca-cta-second:active,
.nsca .nsca-submit:active {
    transform: scale(.98);
}

.nsca .nsca-cta,
.nsca .nsca-cta:hover,
.nsca .nsca-cta:focus,
.nsca .nsca-cta:focus-visible,
.nsca .nsca-cta:active {
    background: var(--nsca-light-blue);
    /* transparent border so the outlined sibling ends up exactly as tall */
    border: 1px solid transparent;
    color: var(--nsca-dark-blue);
    font-weight: 500;
    padding: 0 18px;
    text-decoration: none;
}

.nsca .nsca-cta-second,
.nsca .nsca-cta-second:hover,
.nsca .nsca-cta-second:focus,
.nsca .nsca-cta-second:focus-visible,
.nsca .nsca-cta-second:active {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .32);
    color: #fff;
    padding: 0 17px;
    text-decoration: none;
}

/* Request form -------------------------------------------------------- */

.nsca-form {
    animation: nsca-in .2s ease;
    background: #fff;
    border: 1px solid var(--nsca-border);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(25, 55, 80, .04), 0 12px 32px -18px rgba(25, 55, 80, .22);
    padding: 26px 24px 24px;
}

.nsca-form-head {
    align-items: baseline;
    display: flex;
    gap: 12px;
    margin-bottom: 4px;
}

.nsca-form-title {
    color: var(--nsca-dark-blue);
    font-size: 1.0625rem;
    font-weight: 500;
}

.nsca-form-ref {
    color: var(--nsca-dark-grey);
    font-size: .8125rem;
    font-variant-numeric: tabular-nums;
    margin-left: auto;
    text-align: right;
}

.nsca-form-lead {
    color: var(--nsca-anthracite);
    font-size: .875rem;
    margin: 0 0 20px;
}

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

.nsca-grid label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0;
}

.nsca-grid label span {
    color: var(--nsca-dark-blue);
    font-size: .8125rem;
}

.nsca-grid label span i {
    color: var(--nsca-dark-grey);
    font-style: normal;
}

.nsca-grid input,
.nsca-grid textarea {
    background: #fff;
    border: 1px solid var(--nsca-grey);
    border-radius: 6px;
    color: var(--nsca-dark-blue);
    font: inherit;
    font-size: .9375rem;
    height: 40px;
    padding: 0 12px;
    transition: border-color .15s ease, box-shadow .15s ease;
    width: 100%;
}

.nsca-grid textarea {
    height: auto;
    min-height: 78px;
    padding: 10px 12px;
    resize: vertical;
}

.nsca-grid input:focus,
.nsca-grid textarea:focus {
    border-color: var(--nsca-blue);
    box-shadow: 0 0 0 3px var(--nsca-ice-blue);
    outline: none;
}

.nsca-grid .nsca-invalid input,
.nsca-grid .nsca-invalid textarea,
.nsca-grid label.nsca-invalid input,
.nsca-grid label.nsca-invalid textarea {
    border-color: #b32d2e;
}

.nsca-wide {
    grid-column: 1 / -1;
}

.nsca-hp {
    height: 0;
    overflow: hidden;
    position: absolute;
    width: 0;
}

.nsca-form-foot {
    align-items: center;
    display: flex;
    gap: 16px;
    margin-top: 20px;
}

.nsca .nsca-submit,
.nsca .nsca-submit:hover,
.nsca .nsca-submit:focus,
.nsca .nsca-submit:focus-visible,
.nsca .nsca-submit:active {
    background: var(--nsca-blue);
    border: 1px solid transparent;
    color: #fff;
    font-size: .9375rem;
    font-weight: 500;
    height: 40px;
    padding: 0 22px;
    text-decoration: none;
}

.nsca-submit[disabled] {
    cursor: default;
    opacity: .6;
    transform: none;
}

.nsca .nsca-cancel,
.nsca .nsca-cancel:hover,
.nsca .nsca-cancel:focus,
.nsca .nsca-cancel:focus-visible,
.nsca .nsca-cancel:active {
    background: none;
    border: 0;
    color: var(--nsca-dark-grey);
    cursor: pointer;
    font: inherit;
    font-size: .875rem;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/*
 * Two states after the button is pressed. While sending, the fields give way to a spinner so
 * nobody types into a form that is already on its way. Afterwards only the confirmation
 * remains: bringing the empty fields back would look like the request had not gone through.
 */
.nsca-form.is-sending .nsca-grid,
.nsca-form.is-sending .nsca-form-foot,
.nsca-form.is-sending .nsca-privacy,
.nsca-form.is-done .nsca-grid,
.nsca-form.is-done .nsca-form-foot,
.nsca-form.is-done .nsca-privacy,
.nsca-form.is-done .nsca-form-lead {
    display: none;
}

.nsca-spinner {
    align-items: center;
    color: var(--nsca-dark-grey);
    display: none;
    font-size: .875rem;
    gap: 10px;
    padding: 8px 0 2px;
}

.nsca-form.is-sending .nsca-spinner {
    display: flex;
}

.nsca-spinner::before {
    animation: nsca-spin .7s linear infinite;
    border: 2px solid var(--nsca-grey);
    border-radius: 50%;
    border-top-color: var(--nsca-blue);
    content: "";
    height: 16px;
    width: 16px;
}

@keyframes nsca-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .nsca-spinner::before {
        animation-duration: 2.4s;
    }
}

.nsca-form.is-done .nsca-message {
    font-size: .9375rem;
    margin-top: 8px;
}

.nsca-message {
    margin: 14px 0 0;
    min-height: 1.4em;
}

.nsca-message[data-state="error"] {
    color: #b32d2e;
}

.nsca-message[data-state="success"] {
    color: var(--nsca-dark-blue);
}

.nsca-privacy {
    color: var(--nsca-dark-grey);
    font-size: .75rem;
    line-height: 1.5;
    margin: 14px 0 0;
}

.nsca-privacy a {
    color: var(--nsca-blue);
}

.nsca-notice {
    background: var(--nsca-light-grey);
    border-left: 3px solid var(--nsca-light-blue);
    padding: 12px 16px;
}

@container nsca (max-width: 34em) {
    .nsca-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .nsca-row-control {
        grid-column: 1;
        grid-row: auto;
        grid-template-columns: 7em 3.4em 1fr;
    }
}

/* Narrow: the box moves below the table and sticks to the bottom edge --- */

@media (max-width: 1023px) {
    .nsca-layout {
        gap: 20px;
        grid-template-columns: minmax(0, 1fr);
    }

    .nsca-box {
        align-items: center;
        bottom: 16px;
        display: flex;
        flex-wrap: wrap;
        gap: 14px 20px;
        padding: 16px 20px;
        top: auto;
    }

    .nsca-summary {
        flex: 1 1 100%;
        margin-bottom: 0;
    }

    .nsca-summary ul {
        max-height: 34vh;
        overflow: auto;
    }

    .nsca-box-total {
        flex: 0 1 auto;
    }

    .nsca-box-actions {
        flex: 0 1 auto;
        flex-wrap: wrap;
        margin-left: auto;
        margin-top: 0;
    }
}

@media (max-width: 600px) {
    .nsca-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .nsca-row-control {
        grid-column: 1;
        grid-row: auto;
        grid-template-columns: 7em 3.4em 1fr;
    }

    .nsca-box-total,
    .nsca-box-actions {
        flex: 1 1 100%;
        margin-left: 0;
    }

    .nsca-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
