/* ============================================================
   CC Credit Calculator v2 – Multi-step wizard
   Palette: cream background · orange accent · clean Swiss style
   ============================================================ */

:root {
    --cccc-orange: #c53b3a;
    --cccc-orange-dark: #962c2c;
    --cccc-orange-light: #F5C98A;
    --cccc-cream: #FAF6F0;
    --cccc-cream-dark: #F0EBE3;
    --cccc-text: #2D2A26;
    --cccc-text-light: #7A756D;
    --cccc-white: #FFFFFF;
    --cccc-border: #E0DAD1;
    --cccc-radius: 16px;
    --cccc-radius-sm: 8px;
    --cccc-shadow: 0 8px 40px rgba(0,0,0,.10);
}

/* ---------- Wizard container ---------- */
.cccc-wizard {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
                 Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 820px;
    margin: 2rem auto;
    color: var(--cccc-text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

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

.cccc-form {
    margin: 0;
    padding: 0;
}

/* ---------- Step visibility ---------- */
.cccc-step {
    display: none;
}
.cccc-step--active {
    display: block;
    animation: ccccFadeIn .35s ease;
}

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

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.cccc-progress {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.75rem 2rem 1.25rem;
    background: var(--cccc-white);
    border-radius: var(--cccc-radius) var(--cccc-radius) 0 0;
    box-shadow: var(--cccc-shadow);
}

.cccc-progress-line {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    padding-top: 4px;
}

.cccc-progress-line::before,
.cccc-progress-line::after {
    display: none;
}

/* Dots */
.cccc-dot {
    position: relative;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    border: 2px solid var(--cccc-border);
    background: var(--cccc-white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* Connecting line between dots */
.cccc-dot + .cccc-dot {
    margin-left: 0;
}

.cccc-dot:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    height: 3px;
    /* width set dynamically but fallback */
    width: calc((100% * 3) - 28px);
    background: var(--cccc-border);
    z-index: 1;
}

/* We use flex gap to space dots, so connecting lines via border-top on a wrapper */
.cccc-progress-line {
    gap: 0;
    position: relative;
}

.cccc-dot {
    flex: 0 0 28px;
}

/* connector between dots */
.cccc-dot + .cccc-dot::before {
    content: '';
    position: absolute;
    height: 3px;
    background: var(--cccc-border);
    z-index: 1;
    /* These are repositioned by flex; handled via the line trick below */
}

/* Simpler approach: use flexbox with lines as flex-grow items */
/* We'll redo this cleanly: */
.cccc-progress-line {
    display: flex;
    align-items: center;
}

.cccc-progress-line .cccc-line-segment {
    flex: 1;
    height: 3px;
    background: var(--cccc-border);
    transition: background .3s;
}

.cccc-progress-line .cccc-line-segment.cccc-line--done {
    background: var(--cccc-orange);
}

/* Done dot */
.cccc-dot.cccc-dot--done {
    background: var(--cccc-orange);
    border-color: var(--cccc-orange);
    color: var(--cccc-white);
}

.cccc-dot.cccc-dot--done::after {
    content: '✓';
    font-size: 18.2px;
    font-weight: 700;
    line-height: 1;
}

/* Active dot */
.cccc-dot.cccc-dot--active {
    border-color: var(--cccc-orange);
    border-width: 3px;
}

/* Future dot */
.cccc-dot:not(.cccc-dot--done):not(.cccc-dot--active) {
    background: var(--cccc-cream-dark);
    border-color: var(--cccc-border);
}

/* Step info */
.cccc-step-info {
    flex: 0 0 180px;
    text-align: left;
}

.cccc-step-info strong {
    display: block;
    font-size: 1.365rem;
    margin-bottom: .2rem;
}

.cccc-step-info span {
    font-size: 1.066rem;
    color: var(--cccc-text-light);
    line-height: 1.4;
}

/* ============================================================
   STEP CARD (all steps except step 1)
   ============================================================ */
.cccc-step-card {
    background: var(--cccc-cream);
    border-radius: 0 0 var(--cccc-radius) var(--cccc-radius);
    padding: 2rem 2.5rem 1.75rem;
    box-shadow: var(--cccc-shadow);
}

/* Step 1 card is self-contained */
.cccc-step[data-step="1"] .cccc-step-card {
    border-radius: var(--cccc-radius);
    background: var(--cccc-cream);
    padding: 2rem 2.5rem 0;
}

/* ============================================================
   STEP 1 – CREDIT CALCULATOR
   ============================================================ */
.cccc-card-title {
    font-size: 2.015rem;
    font-weight: 800;
    margin: 0 0 1.5rem;
    color: var(--cccc-text);
}

/* Slider row */
.cccc-slider-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.cccc-slider-label {
    flex: 0 0 80px;
    font-size: 1.196rem;
    font-weight: 600;
    color: var(--cccc-text);
}

.cccc-slider-track-wrap {
    flex: 1;
    min-width: 0;
}

.cccc-slider-value-box {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--cccc-white);
    border: 1px solid var(--cccc-border);
    border-radius: var(--cccc-radius-sm);
    padding: .55rem 1rem;
    font-size: 1.43rem;
    font-weight: 700;
    min-width: 155px;
    justify-content: center;
}

.cccc-slider-currency,
.cccc-slider-unit {
    font-weight: 400;
    font-size: 1.105rem;
    color: var(--cccc-text-light);
}

.cccc-slider-sep {
    color: var(--cccc-border);
    font-weight: 300;
}

/* Range slider */
.cccc-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: var(--cccc-border);
    outline: none;
    cursor: pointer;
}

.cccc-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--cccc-white);
    border: 4px solid var(--cccc-orange);
    box-shadow: 0 1px 6px rgba(0,0,0,.15);
    cursor: pointer;
    margin-top: -8px;
    transition: transform .15s;
}

.cccc-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.cccc-range::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
}

.cccc-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--cccc-white);
    border: 4px solid var(--cccc-orange);
    box-shadow: 0 1px 6px rgba(0,0,0,.15);
    cursor: pointer;
}

.cccc-range::-moz-range-progress {
    height: 8px;
    border-radius: 999px;
    background: var(--cccc-orange);
}

.cccc-range::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    background: var(--cccc-border);
}

/* Result bar (bottom of step 1) */
.cccc-result-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-top: 1px solid var(--cccc-border);
    background: var(--cccc-cream);
    padding: 1.5rem 0;
    margin-top: .5rem;
    flex-wrap: wrap;
}

.cccc-result-left {
    flex: 1;
    min-width: 200px;
}

.cccc-result-label {
    display: block;
    font-size: 1.105rem;
    color: var(--cccc-text-light);
    margin-bottom: .15rem;
}

.cccc-result-amount {
    display: block;
    font-size: 2.015rem;
    font-weight: 800;
    color: var(--cccc-text);
    margin-bottom: .2rem;
}

.cccc-result-note {
    display: block;
    font-size: 1.014rem;
    color: var(--cccc-text-light);
}

.cccc-result-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

/* ============================================================
   FORM FIELDS (Steps 2-4)
   ============================================================ */
.cccc-fields {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cccc-field-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--cccc-border);
}

.cccc-field-row:last-child {
    border-bottom: none;
}

.cccc-field-label {
    flex: 0 0 280px;
    font-size: 1.196rem;
    font-weight: 600;
    color: var(--cccc-text);
}

.cccc-input-wrap {
    flex: 1;
    min-width: 0;
}

/* Text / number / date inputs */
.cccc-input {
    display: block;
    width: 100%;
    padding: .7rem 1rem;
    font-size: 1.235rem;
    border: 1px solid var(--cccc-border);
    border-radius: var(--cccc-radius-sm);
    background: var(--cccc-white);
    color: var(--cccc-text);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    font-family: inherit;
}

.cccc-input:focus {
    border-color: var(--cccc-orange);
    box-shadow: 0 0 0 3px rgba(232,145,58,.15);
}

.cccc-input.cccc-input--error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231,76,60,.12);
}

/* Select */
.cccc-select {
    display: block;
    width: 100%;
    padding: .7rem 2.2rem .7rem 1rem;
    font-size: 1.235rem;
    border: 1px solid var(--cccc-border);
    border-radius: var(--cccc-radius-sm);
    background: var(--cccc-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A756D' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 1rem center;
    color: var(--cccc-text);
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
}

.cccc-select:focus {
    border-color: var(--cccc-orange);
    box-shadow: 0 0 0 3px rgba(232,145,58,.15);
}

/* Split input (CAP | City) */
.cccc-split-input {
    display: flex;
    gap: 0;
    border: 1px solid var(--cccc-border);
    border-radius: var(--cccc-radius-sm);
    overflow: hidden;
    background: var(--cccc-white);
}

.cccc-split-input .cccc-input {
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.cccc-split-input .cccc-input-cap {
    flex: 0 0 90px;
    border-right: 1px solid var(--cccc-border);
    text-align: center;
    font-weight: 600;
}

.cccc-split-input .cccc-input-city {
    flex: 1;
}

.cccc-split-input .cccc-input:focus {
    box-shadow: inset 0 0 0 2px rgba(232,145,58,.25);
}

/* Radio buttons (styled as toggle pills) */
.cccc-radio-group {
    flex: 1;
    display: flex;
    gap: 0;
    border: 1px solid var(--cccc-border);
    border-radius: var(--cccc-radius-sm);
    overflow: hidden;
    background: var(--cccc-white);
}

.cccc-radio {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .65rem 1rem;
    cursor: pointer;
    font-size: 1.196rem;
    color: var(--cccc-text);
    border-right: 1px solid var(--cccc-border);
    transition: background .2s;
    user-select: none;
    margin: 0;
    font-weight: 500;
}

.cccc-radio:last-child {
    border-right: none;
}

.cccc-radio input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid var(--cccc-border);
    border-radius: 50%;
    margin: 0;
    cursor: pointer;
    position: relative;
    transition: border-color .2s;
}

.cccc-radio input[type="radio"]:checked {
    border-color: var(--cccc-orange-dark);
}

.cccc-radio input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--cccc-orange-dark);
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
}

.cccc-radio-group.cccc-radio--error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231,76,60,.12);
}

/* Phone wrap */
.cccc-phone-wrap {
    flex: 1;
    display: flex;
    gap: 0;
    border: 1px solid var(--cccc-border);
    border-radius: var(--cccc-radius-sm);
    overflow: hidden;
    background: var(--cccc-white);
}

.cccc-phone-wrap .cccc-phone-prefix {
    flex: 0 0 120px;
    border: none;
    border-right: 1px solid var(--cccc-border);
    border-radius: 0;
    background-color: var(--cccc-white);
    padding-left: .6rem;
    font-size: 1.17rem;
}

.cccc-phone-wrap .cccc-phone-number {
    flex: 1;
    border: none;
    border-radius: 0;
}

.cccc-phone-wrap .cccc-input:focus,
.cccc-phone-wrap .cccc-select:focus {
    box-shadow: inset 0 0 0 2px rgba(232,145,58,.25);
}

/* Checkbox */
.cccc-checkbox-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.144rem;
    cursor: pointer;
    user-select: none;
    color: var(--cccc-text);
    font-weight: 500;
}

.cccc-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--cccc-border);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: border-color .2s, background .2s;
}

.cccc-checkbox:checked {
    background: var(--cccc-orange);
    border-color: var(--cccc-orange);
}

.cccc-checkbox:checked::after {
    content: '✓';
    color: var(--cccc-white);
    font-size: 16.9px;
    font-weight: 700;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
}

.cccc-checkbox.cccc-input--error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231,76,60,.12);
}

.cccc-checkbox-label.cccc-input--error {
    color: #c0392b;
}

.cccc-checkbox-custom {
    display: none; /* using native styled checkbox */
}

.cccc-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-style: normal;
    font-size: 1.014rem;
    color: var(--cccc-text-light);
    cursor: help;
    margin-left: .2rem;
}

/* Privacy */
.cccc-privacy {
    padding: 1.25rem 0 .5rem;
    border-top: 1px solid var(--cccc-border);
    margin-top: .5rem;
}

.cccc-privacy-check {
    align-items: flex-start;
    font-size: 1.066rem;
    color: var(--cccc-text-light);
    line-height: 1.5;
    font-weight: 400;
}

.cccc-privacy-check a {
    color: var(--cccc-text);
    font-weight: 600;
    text-decoration: underline;
}

.cccc-privacy-check a:hover {
    color: var(--cccc-orange-dark);
}

/* ============================================================
   NAVIGATION (indietro / avanti)
   ============================================================ */
.cccc-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    margin-top: .5rem;
}

.cccc-link-back {
    font-size: 1.17rem;
    color: var(--cccc-text);
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    transition: color .2s;
}

.cccc-link-back:hover {
    color: var(--cccc-orange-dark);
}

/* Orange CTA button */
.cccc-btn {
    display: inline-block;
    padding: .8rem 2.2rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--cccc-white);
    background: var(--cccc-orange);
    border: none;
    border-radius: var(--cccc-radius-sm);
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    font-family: inherit;
    text-decoration: none;
    line-height: 1.4;
    letter-spacing: .01em;
}

.cccc-btn:hover {
    background: var(--cccc-orange-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(232,145,58,.35);
}

.cccc-btn:active {
    transform: translateY(0);
}

.cccc-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cccc-btn-submit {
    padding: .85rem 2.5rem;
    font-size: 1.326rem;
}

/* ============================================================
   THANK-YOU SCREEN
   ============================================================ */
.cccc-thankyou-card {
    text-align: center;
    padding: 3.5rem 2rem;
    border-radius: var(--cccc-radius);
    background: var(--cccc-cream);
    box-shadow: var(--cccc-shadow);
}

.cccc-thankyou-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--cccc-orange);
    color: var(--cccc-white);
    font-size: 2.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.cccc-thankyou-card h2 {
    margin: 0 0 .75rem;
    font-size: 2.145rem;
    color: var(--cccc-text);
}

.cccc-thankyou-card p {
    margin: 0;
    font-size: 1.3rem;
    color: var(--cccc-text-light);
    line-height: 1.6;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 700px) {
    .cccc-wizard {
        margin: 1rem .5rem;
    }

    .cccc-progress {
        flex-direction: column;
        gap: 1rem;
        padding: 1.25rem 1.25rem 1rem;
    }

    .cccc-step-info {
        flex: unset;
    }

    .cccc-step-card {
        padding: 1.5rem 1.25rem 1.5rem;
    }

    .cccc-step[data-step="1"] .cccc-step-card {
        padding: 1.5rem 1.25rem 0;
    }

    .cccc-card-title {
        font-size: 1.69rem;
    }

    .cccc-slider-row {
        flex-wrap: wrap;
    }

    .cccc-slider-label {
        flex: 0 0 100%;
        margin-bottom: -.35rem;
    }

    .cccc-slider-track-wrap {
        flex: 1;
        min-width: 100px;
    }

    .cccc-slider-value-box {
        min-width: 130px;
        font-size: 1.274rem;
    }

    .cccc-result-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.25rem 0;
    }

    .cccc-result-right {
        width: 100%;
        justify-content: space-between;
    }

    .cccc-field-row {
        flex-direction: column;
        align-items: flex-start;
        gap: .5rem;
    }

    .cccc-field-label {
        flex: unset;
    }

    .cccc-input-wrap,
    .cccc-radio-group,
    .cccc-phone-wrap {
        width: 100%;
    }

    .cccc-result-amount {
        font-size: 1.69rem;
    }

    .cccc-btn {
        padding: .75rem 1.5rem;
        font-size: 1.235rem;
    }
}

@media (max-width: 420px) {
    .cccc-slider-value-box {
        min-width: 110px;
        padding: .45rem .7rem;
        font-size: 1.17rem;
    }

    .cccc-slider-row {
        gap: .6rem;
    }
}