:root {
    --rp-primary:        #dc3545;
    --rp-primary-light:  #fff5f5;
    --rp-primary-border: #f5c6cb;
    --rp-success:        #198754;
    --rp-muted:          #6c757d;
    --rp-border:         #e0e0e0;
    --rp-border-hover:   #bbb;
    --rp-card-bg:        #f8f8f8;
    --rp-card-border:    #e5e5e5;
    --rp-radius-card:    12px;
    --rp-radius-option:  8px;
}

.rp-page {
    padding: 2rem 1rem 4rem;
}

.rp-title {
    text-align: center;
    margin-bottom: 1.5rem;
}

.rp-progress-wrapper {
    max-width: 900px;
    margin: 0 auto 2.5rem;
    text-align: center;
}

.rp-progress-track {
    height: 6px;
    background: var(--rp-border);
    border-radius: 3px;
    overflow: hidden;
}

.rp-progress-fill {
    height: 100%;
    background-color: var(--rp-primary);
    transition: width 0.4s ease, background-color 0.4s ease;
}

.rp-progress-fill.complete {
    background-color: var(--rp-success);
}

.rp-progress-label {
    display: block;
    font-size: 0.8rem;
    color: var(--rp-muted);
    margin-top: 0.4rem;
}

.rp-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    gap: 2.5rem;
    align-items: stretch;
}

.rp-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rp-right {
    flex: 1;
}

.rp-card {
    background: var(--rp-card-bg);
    border: 1px solid var(--rp-card-border);
    border-radius: var(--rp-radius-card);
    padding: 1.75rem;
}

.rp-radio-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--rp-border);
    border-radius: var(--rp-radius-option);
    cursor: pointer;
    margin-bottom: 0.75rem;
    background: #fff;
    user-select: none;
    transition: border-color 0.2s, background 0.2s;
}

.rp-radio-option:hover {
    border-color: var(--rp-border-hover);
}

.rp-radio-option input[type="radio"]:focus-visible {
    outline: 2px solid var(--rp-primary);
    outline-offset: 2px;
}

.rp-radio-option.selected {
    border-color: var(--rp-primary);
    background: var(--rp-primary-light);
}

.rp-radio-option input[type="radio"] {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: var(--rp-primary);
    cursor: pointer;
}

.rp-radio-label {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0;
    cursor: pointer;
    display: block;
}

.rp-radio-sub {
    font-size: 0.8rem;
    color: var(--rp-muted);
}

.rp-phone-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    margin-top: 0.5rem;
}

.rp-prefix-select {
    width: auto;
    min-width: 85px;
}

.rp-requirements {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 1.25rem;
}

.rp-requirement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--rp-muted);
    margin-bottom: 0.35rem;
    transition: color 0.2s;
}

.rp-requirement i {
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
    transition: color 0.2s;
}

.rp-req-met { display: none; }

.rp-requirement.met {
    color: var(--rp-success);
}

.rp-requirement.met .rp-req-unmet { display: none; }
.rp-requirement.met .rp-req-met   { display: inline-block; color: var(--rp-success); }

.rp-otp-wrapper {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.rp-otp-input {
    width: 50px;
    height: 58px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    border: 1.5px solid #ced4da;
    border-radius: var(--rp-radius-option);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.rp-otp-input:focus {
    border-color: var(--rp-primary);
    box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, .15);
}

.rp-otp-input.error {
    border-color: var(--rp-primary);
    background: var(--rp-primary-light);
}

.rp-info-box {
    background: var(--rp-primary-light);
    border-color: var(--rp-primary-border);
}

.rp-phone-error {
    background: var(--rp-primary-light);
    border: 1.5px solid var(--rp-primary);
    border-radius: var(--rp-radius-option);
    padding: 0.75rem 1rem;
}

.rp-next-steps {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    counter-reset: steps;
}

.rp-next-steps li {
    counter-increment: steps;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
}

.rp-next-steps li::before {
    content: counter(steps);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--rp-primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    margin-top: 1px;
    flex-shrink: 0;
}

.rp-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 1rem 2rem;
    max-width: 560px;
    margin: 0 auto;
}

.rp-app-redirect-card {
    width: 100%;
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    border-radius: var(--rp-radius-card);
    color: #1d4ed8;
    text-align: left;
}

.rp-app-redirect-card p {
    font-size: 0.9rem;
}

.rp-success-icon {
    display: block;
    font-size: 4rem;
    color: var(--rp-success);
    margin-bottom: 1rem;
}

@media (min-width: 769px) {
    .rp-page {
        background-image:
            url('/img/background/bgk-big-2circle-color-reverse.png'),
            url('/img/background/bgk-2square-color.png');
        background-repeat: no-repeat, no-repeat;
        background-position: left top, right center;
        background-size: 28%, 14%;
    }

    .rp-content {
        background: #fff;
        border-radius: var(--rp-radius-card);
        overflow: hidden;
    }

    .rp-left {
        padding: 1.75rem;
    }

    /* il card destro mantiene il suo sfondo ma perde bordo e radius
       (gli angoli arrotondati vengono dal container via overflow:hidden) */
    .rp-right > .rp-card:not(.rp-info-box) {
        border: none;
        border-radius: 0;
    }

    /* step successo: sfondo bianco su desktop per coprire le immagini decorative */
    .rp-success {
        background: #fff;
        border-radius: var(--rp-radius-card);
        padding: 3rem 2rem 2rem;
    }
}

@media (max-width: 768px) {
    .rp-content {
        flex-direction: column;
        gap: 1.5rem;
    }

    .rp-left,
    .rp-right {
        flex: unset;
        width: 100%;
    }

    .rp-card {
        padding: 1.25rem;
    }

    .rp-success {
        padding: 2rem 0 1.5rem;
    }

    .rp-otp-input {
        width: 42px;
        height: 50px;
        font-size: 1.25rem;
    }
}
