/* Mespack Calculator — visual layer only.
   Reuses the duravant-oc theme's real design tokens (--color-*) and a few
   already-compiled Tailwind utility classes applied directly in the markup
   (text-h3/h4/h5, text-body-medium, gradient-light/bg-linear-to-l divider,
   button-regular-primary). Everything calculator-specific (grid, odometer,
   result card, tooltip, pulse) is plain CSS here, scoped under
   .mespack-calculator so it can never leak into the rest of the theme. */

.mespack-calculator {
    display: flex;
    gap: 40px;
    font-family: var(--font-aktiv-grotesk, inherit);
    color: var(--color-gray-dark, #1d222a);
}

.mespack-calculator .is-hidden {
    display: none;
}

/* ---------- Input column ---------- */

.input-data {
    padding: 32px;
    width: 40%;
    background-color: var(--color-bone, #f2f2f2);
    border-radius: 12px;
}

.input-data .message {
    color: var(--color-gray, #3a4453);
    margin: 0 0 24px;
}

.input-data > div {
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.input-data label {
    font-weight: 700;
    min-width: 55%;
    text-align: right;
}

.input-data label span {
    display: block;
    font-weight: 400;
    font-size: 0.8em;
    color: var(--color-gray, #3a4453);
}

.subtitle {
    margin: 28px 0 16px;
}

.mespack-calculator input[type="number"] {
    width: 45%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--color-gray-light, #bec8d2);
    border-radius: var(--radius-md, 8px);
    color: var(--color-gray, #3a4453);
    background-color: #fff;
    font-weight: 700;
    box-shadow: none;
    transition: border-color 0.2s ease;
}

.mespack-calculator input[type="number"]:focus {
    outline: none;
    border-color: var(--color-blue-dark, #2da0c3);
}

.mespack-calculator input[type="number"].activated {
    color: var(--color-blue-deep, #1b7a96);
    border-color: var(--color-blue-dark, #2da0c3);
}

.mespack-calculator input[type="number"]:disabled {
    background-color: var(--color-bone, #f2f2f2);
    color: var(--color-blue-deep, #1b7a96);
}

.has-help {
    position: relative;
}

.has-help label {
    cursor: help;
}

.hidden-help {
    display: none;
    position: absolute;
    z-index: 2;
    background: #fff;
    top: 100%;
    margin-top: 8px;
    left: 0;
    padding: 12px 16px;
    border: 1px solid var(--color-gray-light, #bec8d2);
    border-radius: 8px;
    font-size: 14px;
    width: 90%;
    box-shadow: 0 8px 24px rgb(29 34 42 / 0.12);
}

/* ---------- Results column ---------- */

.results {
    width: 60%;
}

.results div.value {
    font-size: 40px;
    font-weight: 700;
    color: var(--color-blue-dark, #2da0c3);
    line-height: 1;
}

.result-group {
    display: flex;
    gap: 48px;
    margin-top: 12px;
}

.total-result {
    background: linear-gradient(135deg, var(--color-blue-deep, #1b7a96), var(--color-blue-dark, #2da0c3));
    padding: 36px 40px;
    margin-bottom: 16px;
    border-radius: 12px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 32px;
}

.total-result-label {
    width: 42%;
    flex-shrink: 0;
}

.total-result-label h3 {
    color: #fff;
    margin: 0;
}

.total-result-label span {
    display: block;
    color: var(--color-blue-baby, #bfe9f6);
    margin-top: 6px;
}

.total-result-group {
    flex: 1;
}

.total-result div.value {
    color: #fff;
    font-size: 48px;
    margin-bottom: 6px;
}

.total-result h4 {
    margin: 0 0 20px;
    color: var(--color-blue-baby, #bfe9f6);
    font-weight: 400;
}

.results-bottom {
    background-color: var(--color-bone, #f2f2f2);
    border-radius: 12px;
    padding: 36px 40px;
}

.result-group-wrapper {
    display: flex;
    gap: 20px;
    padding: 20px 0;
}

.result-group-wrapper + .result-group-wrapper {
    border-top: 1px solid var(--color-gray-light, #bec8d2);
}

.result-group-wrapper .result-icon {
    width: 44px;
    flex-shrink: 0;
}

.result-group-wrapper .result-icon img {
    width: 100%;
    height: auto;
    display: block;
}

.result-data h3 {
    margin: 0 0 10px;
}

.result-data h4 {
    margin: 0;
    font-weight: 400;
    color: var(--color-gray, #3a4453);
}

/* ---------- Odometer ---------- */

.mp-odometer {
    display: inline-flex;
    align-items: baseline;
    font-variant-numeric: tabular-nums;
}

.mp-odometer-digit {
    display: inline-block;
    height: 1em;
    overflow: hidden;
    vertical-align: bottom;
}

.mp-odometer-strip {
    display: block;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.mp-odometer-num {
    display: block;
    height: 1em;
    line-height: 1;
    text-align: center;
}

.mp-odometer-sep {
    display: inline-block;
    margin: 0 0.02em;
}

/* brief highlight flash on every value refresh, so the UI visibly
   reacts to an input change even before the roll finishes */
@keyframes mp-pulse {
    0% { color: var(--color-blue-deep, #1b7a96); }
    40% { color: var(--color-blue, #80d3ed); }
    100% { color: var(--color-blue-dark, #2da0c3); }
}

.results div.value.is-pulsing {
    animation: mp-pulse 0.7s ease-out;
}

.total-result div.value.is-pulsing {
    animation: none;
}

@keyframes mp-pulse-total {
    0% { text-shadow: 0 0 0 rgb(255 255 255 / 0); }
    35% { text-shadow: 0 0 18px rgb(255 255 255 / 0.65); }
    100% { text-shadow: 0 0 0 rgb(255 255 255 / 0); }
}

.total-result div.value.is-pulsing {
    animation: mp-pulse-total 0.7s ease-out;
}

/* ---------- CTA ---------- */

.mp-cta {
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--color-gray-light, #bec8d2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.mp-cta-text {
    margin: 0;
    max-width: 60ch;
    font-weight: 700;
    color: var(--color-gray-dark, #1d222a);
}

@media (max-width: 1024px) {
    .mespack-calculator {
        flex-direction: column;
        gap: 24px;
    }
    .input-data, .results {
        width: 100%;
    }
    .result-group {
        flex-direction: column;
        gap: 20px;
    }
    .total-result {
        flex-direction: column;
        align-items: flex-start;
    }
    .total-result-label {
        width: 100%;
    }
    .mp-cta {
        justify-content: flex-start;
    }
}
