:root {
    /* EDIT THESE TWO COLORS to change the calculator backgrounds and accents.
       Use dark or medium colors so the white banner/button text stays readable. */
    --uc-color-1: #1769aa;
    --uc-color-2: #16896c;
    --uc-bg: #f3f6f9;
    --uc-card: #ffffff;
    --uc-text: #172233;
    --uc-muted: #647084;
    --uc-line: #dce3ea;
    --uc-primary: var(--uc-color-1);
    --uc-primary-dark: color-mix(in srgb, var(--uc-color-1) 75%, black);
    --uc-accent: var(--uc-color-2);
    --uc-soft: #edf6fb;
    --uc-danger: #b42318;
    --uc-success: #087a55;
    --uc-shadow: 0 24px 70px rgba(26, 47, 71, 0.13);
    --uc-radius: 22px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background: transparent;
    color: var(--uc-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.55;
}

button, input, select { font: inherit; }

.ucaas-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    background: #11161d;
    border-radius: 26px;
    padding: 0 12px;
    box-shadow: 0 24px 60px rgba(5, 15, 30, 0.45);
}

.ucaas-bezel {
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ucaas-cam {
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2e3947;
}

.ucaas-card {
    overflow: hidden;
    background: var(--uc-card);
    border: none;
    border-radius: 14px;
    box-shadow: none;
}

.ucaas-chin {
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ucaas-power {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4a5a72;
    box-shadow: 0 0 4px rgba(120, 170, 255, 0.35);
}

.ucaas-stand {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.ucaas-neck {
    width: 110px;
    height: 16px;
    margin: 0 auto;
    background: linear-gradient(#2a3542, #12181f);
    clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%);
}

.ucaas-foot {
    width: 250px;
    height: 10px;
    margin: 0 auto;
    background: linear-gradient(#1a222c, #0d1117);
    border-radius: 6px;
}

.ucaas-keypad-wrap {
    margin: 0 52px 34px;
    background: #edf1f5;
    border: 1px solid #d7dee6;
    border-radius: 12px;
    padding: 12px;
}

.ucaas-keypad-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ucaas-keypad-head span {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #55677c;
}

.ucaas-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.ucaas-key {
    appearance: none;
    border: 1px solid #c9d3dd;
    background: #ffffff;
    color: #12283f;
    font-size: 19px;
    font-weight: 600;
    padding: 11px 0;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(10, 30, 50, .12);
}

.ucaas-key:active { background: #dce7f0; }

.ucaas-key-util { background: #f4f7fa; color: #33475c; }

.ucaas-keypad-head .ucaas-key { font-size: 14px; padding: 7px 14px; }

.ucaas-keypad-note {
    margin: 10px 0 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: #55677c;
}

.ucaas-card input.ucaas-keypad-active {
    outline: 2px solid var(--uc-color-1);
    outline-offset: 1px;
}

@media (max-width: 760px) {
    .ucaas-keypad-wrap { margin: 0 24px 26px; }
}

.ucaas-header {
    padding: 46px 52px 38px;
    color: #fff;
    background:
        linear-gradient(125deg, var(--uc-color-1), var(--uc-color-2));
}

.ucaas-header h1 {
    max-width: 780px;
    margin: 8px 0 12px;
    font-size: clamp(2rem, 4vw, 3.45rem);
    line-height: 1.08;
    letter-spacing: -.035em;
}

.ucaas-header p {
    max-width: 780px;
    margin: 0;
    color: rgba(255,255,255,.86);
    font-size: 1.08rem;
}

.ucaas-eyebrow {
    display: inline-block;
    color: inherit;
    font-size: .77rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.ucaas-progress-wrap {
    padding: 24px 52px 0;
}

.ucaas-progress-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--uc-muted);
    font-size: .85rem;
    font-weight: 700;
}

.ucaas-progress {
    height: 9px;
    overflow: hidden;
    background: #e8edf2;
    border-radius: 999px;
}

.ucaas-progress span {
    display: block;
    width: 20%;
    height: 100%;
    background: linear-gradient(90deg, var(--uc-primary), var(--uc-accent));
    border-radius: inherit;
    transition: width .3s ease;
}

#ucaasCalculator { padding: 34px 52px 46px; }

.ucaas-step { display: none; }
.ucaas-step.is-active { display: block; animation: ucFade .25s ease; }

@keyframes ucFade {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-heading { margin-bottom: 28px; }
.step-heading > span {
    color: var(--uc-primary);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.step-heading h2 { margin: 3px 0 5px; font-size: 1.75rem; }
.step-heading p { margin: 0; color: var(--uc-muted); }

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

.field { display: grid; gap: 8px; }
.field > span { font-size: .92rem; font-weight: 750; }

.field input,
.field select {
    width: 100%;
    min-height: 50px;
    padding: 11px 14px;
    color: var(--uc-text);
    background: #fff;
    border: 1px solid var(--uc-line);
    border-radius: 10px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.field input:focus,
.field select:focus {
    border-color: var(--uc-primary);
    box-shadow: 0 0 0 4px rgba(23,105,170,.12);
}

.field input.is-invalid,
.field select.is-invalid { border-color: var(--uc-danger); }

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

.choice-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    min-height: 104px;
    padding: 18px;
    cursor: pointer;
    border: 1px solid var(--uc-line);
    border-radius: 14px;
    transition: .2s ease;
}

.choice-card:hover { border-color: #93b9d8; transform: translateY(-1px); }

.choice-card:has(input:checked) {
    border-color: var(--uc-primary);
    background: var(--uc-soft);
    box-shadow: 0 0 0 3px rgba(23,105,170,.08);
}

.choice-card input { margin: 4px 12px 0 0; accent-color: var(--uc-primary); }
.choice-card span { display: grid; gap: 4px; }
.choice-card strong { font-size: .98rem; }
.choice-card small { color: var(--uc-muted); line-height: 1.35; }

.ucaas-actions {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 32px;
}

.button {
    min-height: 48px;
    padding: 11px 24px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 800;
    transition: transform .18s, background .18s, box-shadow .18s;
}

.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.button-primary {
    margin-left: auto;
    color: #fff;
    background: var(--uc-primary);
    box-shadow: 0 8px 20px rgba(23,105,170,.22);
}
.button-primary:hover { background: var(--uc-primary-dark); }

.button-secondary { color: var(--uc-text); background: #e9eef2; }
.button-wide { width: 100%; margin-top: 18px; }

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

.estimate-card {
    padding: 22px;
    border: 1px solid #cfe1ee;
    border-radius: 16px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--uc-color-1) 4%, white), color-mix(in srgb, var(--uc-color-2) 4%, white));
}
.estimate-card span, .estimate-card small { display: block; color: var(--uc-muted); }
.estimate-card strong {
    display: block;
    margin: 6px 0 4px;
    color: var(--uc-primary-dark);
    font-size: clamp(1.6rem, 4vw, 2.25rem);
}

.recommendation-intro { margin: 34px 0 16px; }
.recommendation-intro h3 { margin-bottom: 4px; }
.recommendation-intro p { margin: 0; color: var(--uc-muted); }

.recommendations { display: grid; gap: 14px; }

.recommendation {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: start;
    padding: 20px;
    border: 1px solid var(--uc-line);
    border-radius: 15px;
}

.recommendation-rank {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: #fff;
    background: var(--uc-primary);
    border-radius: 50%;
    font-weight: 800;
}

.recommendation h4 { margin: 0 0 4px; font-size: 1.15rem; }
.recommendation p { margin: 0; color: var(--uc-muted); }
.recommendation ul {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}
.recommendation li {
    padding: 5px 9px;
    color: #28536f;
    background: #edf5fa;
    border-radius: 999px;
    font-size: .77rem;
    font-weight: 700;
}
.match-score {
    min-width: 78px;
    padding: 7px 10px;
    color: var(--uc-success);
    background: #eaf8f2;
    border-radius: 999px;
    text-align: center;
    font-size: .82rem;
    font-weight: 800;
}

.lead-panel {
    margin-top: 32px;
    padding: 28px;
    background: #f5f8fa;
    border: 1px solid var(--uc-line);
    border-radius: 17px;
}
.lead-panel h3 { margin: 5px 0 6px; }
.lead-panel p { margin: 0 0 22px; color: var(--uc-muted); }

.consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 18px;
    color: var(--uc-muted);
    font-size: .88rem;
}
.consent input { margin-top: 4px; accent-color: var(--uc-primary); }

.form-status { min-height: 24px; margin: 12px 0 0 !important; font-weight: 700; text-align: center; }
.form-status.success { color: var(--uc-success); }
.form-status.error { color: var(--uc-danger); }

.results-loading { padding: 40px; text-align: center; color: var(--uc-muted); }
.hp-field { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }

@media (max-width: 760px) {
    .ucaas-shell { width: min(100% - 18px, 720px); margin: 0 auto; }
    .ucaas-header, #ucaasCalculator { padding-left: 24px; padding-right: 24px; }
    .ucaas-progress-wrap { padding-left: 24px; padding-right: 24px; }
    .form-grid, .choice-grid, .estimate-grid { grid-template-columns: 1fr; }
    .recommendation { grid-template-columns: auto 1fr; }
    .match-score { grid-column: 2; justify-self: start; }
}

@media (max-width: 440px) {
    .ucaas-header { padding-top: 34px; }
    .ucaas-actions { flex-direction: column-reverse; }
    .button { width: 100%; }
}

/* Version 3: early lead capture and final CTA */
.capture-panel {
    margin-bottom: 28px;
    padding: 24px;
    background: #f5f8fa;
    border: 1px solid var(--uc-line);
    border-radius: 17px;
}
.organization-grid {
    padding-top: 4px;
}
.capture-status {
    min-height: 22px;
    margin: 12px 0 0;
    font-size: .88rem;
    font-weight: 700;
}
.capture-status.saving { color: var(--uc-muted); }
.capture-status.success { color: var(--uc-success); }
.capture-status.error { color: var(--uc-danger); }
.results-cta {
    margin-top: 32px;
    padding: 30px;
    text-align: center;
    background: linear-gradient(145deg, var(--uc-color-1), var(--uc-color-2));
    border-radius: 18px;
    color: #fff;
}
.results-cta h3 {
    margin: 6px 0 8px;
    font-size: clamp(1.45rem, 3vw, 2rem);
}
.results-cta p {
    max-width: 720px;
    margin: 0 auto 18px;
    color: rgba(255,255,255,.84);
}
.results-cta .cta-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: auto;
    min-width: 250px;
    margin: 0 auto;
    text-decoration: none;
    background: #fff;
    color: var(--uc-primary-dark);
    box-shadow: 0 10px 24px rgba(0,0,0,.18);
}
.results-cta .cta-button:hover {
    background: #f3f7fa;
}
.results-cta .form-status {
    margin-top: 14px !important;
    color: rgba(255,255,255,.88);
}
.results-cta .form-status.error { color: #ffd3cf; }
.results-cta .form-status.success { color: #d8fff2; }

/* Version 5: deliberate animated processing transitions */
.ucaas-card { position: relative; }
.ucaas-processing {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(242, 247, 250, .88);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    animation: processingFade .22s ease;
}
.ucaas-processing[hidden] { display: none; }
.processing-card {
    width: min(470px, 100%);
    padding: 34px 30px 30px;
    text-align: center;
    background: rgba(255,255,255,.97);
    border: 1px solid rgba(207,225,238,.95);
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(16,58,91,.18);
}
.processing-card strong {
    display: block;
    margin: 20px 0 6px;
    color: var(--uc-primary-dark);
    font-size: 1.22rem;
}
.processing-card small {
    display: block;
    min-height: 42px;
    color: var(--uc-muted);
    line-height: 1.45;
}
.processing-orbit {
    position: relative;
    width: 70px;
    height: 70px;
    margin: 0 auto;
    border: 2px solid rgba(23,105,170,.14);
    border-radius: 50%;
    animation: orbitSpin 1.65s linear infinite;
}
.processing-orbit::before {
    content: '';
    position: absolute;
    inset: 12px;
    border: 2px dashed rgba(25,164,123,.35);
    border-radius: 50%;
    animation: orbitSpinReverse 1.05s linear infinite;
}
.processing-orbit span {
    position: absolute;
    width: 11px;
    height: 11px;
    background: var(--uc-primary);
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(23,105,170,.10);
}
.processing-orbit span:nth-child(1) { top: -5px; left: 28px; }
.processing-orbit span:nth-child(2) { right: 1px; bottom: 8px; background: var(--uc-accent); }
.processing-orbit span:nth-child(3) { left: 1px; bottom: 8px; background: #6398c1; }
.processing-track {
    height: 7px;
    margin-top: 18px;
    overflow: hidden;
    background: #e8eef3;
    border-radius: 999px;
}
.processing-track i {
    display: block;
    width: 8%;
    height: 100%;
    background: linear-gradient(90deg, var(--uc-primary), var(--uc-accent));
    border-radius: inherit;
    transition: width .45s ease;
}
@keyframes processingFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes orbitSpin { to { transform: rotate(360deg); } }
@keyframes orbitSpinReverse { to { transform: rotate(-720deg); } }
@media (prefers-reduced-motion: reduce) {
    .ucaas-processing, .processing-orbit, .processing-orbit::before { animation: none; }
    .processing-track i { transition: none; }
}
