﻿:root {
    --cm-bg: #f7f2e9;
    --cm-surface: #ffffff;
    --cm-surface-soft: #fcf8f2;
    --cm-border: #e7dccb;
    --cm-text: #1e2430;
    --cm-muted: #697180;
    --cm-accent: #f58220;
    --cm-accent-dark: #de6f13;
    --cm-accent-soft: rgba(245, 130, 32, 0.12);
    --cm-success: #1f7a4d;
    --cm-failed: #c60101;
    --cm-radius-xl: 24px;
    --cm-radius-lg: 18px;
    --cm-radius-md: 12px;
    --cm-shadow: 0 18px 40px rgba(30, 36, 48, 0.08);
    --cm-shadow-soft: 0 10px 24px rgba(30, 36, 48, 0.06);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Inter", sans-serif;
    color: var(--cm-text);
    background: transparent;
}

body {
    padding: 20px;
}

.km-widget {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    background: linear-gradient(180deg, #fff 0%, var(--cm-surface-soft) 100%);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius-xl);
    box-shadow: var(--cm-shadow);
    overflow: hidden;
}

.km-widget__inner {
    padding: 32px;
}

.km-widget__eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cm-accent);
}

.km-widget__title {
    margin: 0 0 10px;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.05;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.km-widget__intro {
    margin: 0 0 28px;
    max-width: 58ch;
    color: var(--cm-muted);
    font-size: 16px;
    line-height: 1.6;
}

.panel {
    background: var(--cm-surface);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius-lg);
    box-shadow: var(--cm-shadow-soft);
    padding: 22px;
}

.form-grid {
    display: grid;
    gap: 18px;
    margin-bottom: 22px;
}

.field {
    display: grid;
    gap: 10px;
}

    .field label {
        font-size: 14px;
        font-weight: 700;
        color: var(--cm-text);
    }

    .field input[type="text"],
    .field input[type="email"] {
        width: 100%;
        min-height: 56px;
        padding: 16px 18px;
        border: 1px solid var(--cm-border);
        border-radius: var(--cm-radius-md);
        background: #fff;
        color: var(--cm-text);
        font: inherit;
        outline: none;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

        .field input[type="text"]::placeholder,
        .field input[type="email"]::placeholder {
            color: #8b93a1;
        }

        .field input[type="text"]:focus,
        .field input[type="email"]:focus,
        .range-control input[type="range"]:focus {
            border-color: rgba(245, 130, 32, 0.5);
            box-shadow: 0 0 0 4px rgba(245, 130, 32, 0.14);
        }

.email-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

.btn {
    min-height: 56px;
    padding: 0 24px;
    border: 0;
    border-radius: var(--cm-radius-md);
    background: var(--cm-accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 22px rgba(245, 130, 32, 0.24);
    white-space: nowrap;
}

    .btn:hover {
        background: var(--cm-accent-dark);
        transform: translateY(-1px);
    }

.result-card {
    display: grid;
    gap: 22px;
    margin-top: 24px;
    padding: 24px;
    background: linear-gradient(180deg, #fff 0%, #fffaf5 100%);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius-lg);
}

    .result-card[hidden] {
        display: none;
    }

.result-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(31, 122, 77, 0.08);
    font-size: 13px;
    font-weight: 700;
}

    .result-status::before {
        content: "";
        width: 8px;
        height: 8px;
        border-radius: 50%;
    }

.result-status-success {
    color: var(--cm-success);
}

    .result-status-success:before {
        background: var(--cm-success);
    }

.result-status-failed {
    color: var(--cm-failed);
}

    .result-status-failed:before {
        background: var(--cm-failed);
    }

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.result-item {
    padding: 16px;
    border: 1px solid var(--cm-border);
    border-radius: 14px;
    background: #fff;
}

.result-item__label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--cm-muted);
}

.result-item__value {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

    .result-item__value.small {
        font-size: 18px;
        font-weight: 700;
    }

.range-section {
    display: grid;
    gap: 10px;
    padding: 18px;
    border: 1px solid var(--cm-border);
    border-radius: 14px;
    background: var(--cm-surface);
}

.range-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.range-top__label {
    font-size: 15px;
    font-weight: 700;
}

.range-top__value {
    font-size: 15px;
    color: var(--cm-muted);
}

    .range-top__value strong {
        color: var(--cm-text);
        font-size: 24px;
        font-weight: 600;
        letter-spacing: -0.02em;
        margin-right: 6px;
    }

.range-control input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
    outline: none;
}

    .range-control input[type="range"]::-webkit-slider-runnable-track {
        height: 8px;
        border-radius: 999px;
        background: linear-gradient( to right, var(--cm-accent) 0%, var(--cm-accent) var(--range-progress, 25%), #e5dccf var(--range-progress, 25%), #e5dccf 100% );
    }

    .range-control input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        margin-top: -7px;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        border: 3px solid #fff;
        background: var(--cm-accent);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    }

    .range-control input[type="range"]::-moz-range-track {
        height: 8px;
        border-radius: 999px;
        background: #e5dccf;
    }

    .range-control input[type="range"]::-moz-range-progress {
        height: 8px;
        border-radius: 999px;
        background: var(--cm-accent);
    }

    .range-control input[type="range"]::-moz-range-thumb {
        width: 22px;
        height: 22px;
        border-radius: 50%;
        border: 3px solid #fff;
        background: var(--cm-accent);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    }

.summary {
    display: grid;
    gap: 12px;
    padding: 20px;
    background: var(--cm-accent-soft);
    border: 1px solid rgba(245, 130, 32, 0.18);
    border-radius: 16px;
}

.summary__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(30, 36, 48, 0.08);
}

    .summary__row:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

.summary__label {
    font-size: 15px;
    font-weight: 600;
    color: var(--cm-text);
}

.summary__value {
    font-size: 17px;
    font-weight: 600;
    white-space: nowrap;
}

.muted-note {
    margin-top: 14px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--cm-muted);
}

@media (max-width: 720px) {
    body {
        padding: 14px;
    }

    .km-widget__inner {
        padding: 22px;
    }

    .email-row,
    .result-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        width: 100%;
    }

    .summary__row {
        align-items: flex-start;
        flex-direction: column;
    }
}
