/* Banner di registrazione opzionale */
.registration-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, rgba(230, 224, 198, 0.97) 0%, rgba(230, 224, 198, 0.92) 100%);
    z-index: 999;
    padding: 8px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    animation: slideDown 0.5s ease;
    backdrop-filter: blur(10px);
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.banner-text {
    display: flex;
    align-items: center;
    gap: 15px;
}

.banner-text h3 {
    margin: 0;
    font-size: 15px;
    color: var(--color--dark);
    font-weight: 600;
}

.banner-text p {
    margin: 0;
    font-size: 13px;
    color: rgba(28, 28, 28, 0.75);
    display: inline;
}

.banner-cta {
    background-color: var(--color--dark);
    color: var(--color--light);
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.banner-cta:hover {
    background-color: rgba(28, 28, 28, 0.85);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.banner-close {
    background: none;
    border: none;
    color: var(--color--dark);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    line-height: 1;
    flex-shrink: 0;
}

.banner-close:hover {
    opacity: 0.6;
}

@media (max-width: 768px) {
    .registration-banner {
        padding: 8px 15px;
    }

    .banner-content {
        gap: 8px;
    }
    
    .banner-text {
        flex-direction: column;
        gap: 3px;
        align-items: flex-start;
        flex: 1;
    }
    
    .banner-text h3 {
        font-size: 13px;
    }
    
    .banner-text p {
        font-size: 11px;
        display: block;
    }
    
    .banner-cta {
        padding: 6px 16px;
        font-size: 12px;
    }
    
    .banner-close {
        font-size: 20px;
        width: 20px;
        height: 20px;
    }
}

/* Stili per il popup di registrazione a step */
.registrazione-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.registrazione-overlay.show {
    display: flex;
}

.registrazione-popup {
    background-color: var(--color--dark);
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(230, 224, 198, 0.1);
    overflow: hidden;
    animation: popup-show 0.5s ease forwards;
    position: relative;
}

@keyframes popup-show {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

.registrazione-header {
    background-color: rgba(230, 224, 198, 0.05);
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(230, 224, 198, 0.08);
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--color--light);
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
    z-index: 10;
}

.close-modal:hover {
    color: var(--color--light-0-7);
    transform: rotate(90deg);
}

.registrazione-header h2 {
    color: var(--color--light);
    font-size: 24px;
    margin: 0;
}

.registrazione-header p {
    color: var(--color--light-0-7);
    font-size: 16px;
    margin: 10px 0 0;
}

/* Progress steps */
.steps-progress {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.step-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(230, 224, 198, 0.2);
    margin: 0 5px;
    transition: all 0.3s ease;
}

.step-indicator.active {
    background-color: var(--color--light);
    transform: scale(1.2);
}

.step-indicator.completed {
    background-color: var(--color--light);
}

.registrazione-body {
    padding: 25px;
    overflow: hidden;
}

.steps-container {
    display: flex;
    transition: transform 0.5s ease;
    width: 400%; /* 4 steps * 100% */
}

.step {
    width: 25%; /* 1/4 of total width */
    padding: 0 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.step.active {
    opacity: 1;
    transform: translateY(0);
}

.step-title {
    color: var(--color--light);
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--color--light-0-8);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(230, 224, 198, 0.15);
    border-radius: 8px;
    background-color: rgba(230, 224, 198, 0.05);
    color: var(--color--light);
    font-size: 16px;
    transition: all 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus {
    border-color: rgba(230, 224, 198, 0.4);
    outline: none;
    box-shadow: 0 0 0 3px rgba(230, 224, 198, 0.1);
}

.form-check {
    padding-left: 28px;
    position: relative;
    margin-bottom: 15px;
    cursor: pointer;
}

.form-check input {
    position: absolute;
    opacity: 0;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 2px;
    left: 0;
    height: 20px;
    width: 20px;
    border: 1px solid rgba(230, 224, 198, 0.2);
    border-radius: 4px;
    background-color: rgba(230, 224, 198, 0.05);
    transition: all 0.2s ease;
}

.form-check:hover .checkmark {
    border-color: rgba(230, 224, 198, 0.4);
}

.form-check input:checked ~ .checkmark {
    background-color: var(--color--light);
    border-color: var(--color--light);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid var(--color--dark);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-check input:checked ~ .checkmark:after {
    display: block;
}

.form-check-label {
    color: var(--color--light-0-8);
    font-size: 14px;
    user-select: none;
    display: block;
    line-height: 1.4;
}

.form-check-label a {
    color: var(--color--light);
    text-decoration: underline;
}

.step-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.btn-prev {
    background-color: transparent;
    color: var(--color--light-0-7);
    border: 1px solid rgba(230, 224, 198, 0.2);
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-prev:hover {
    background-color: rgba(230, 224, 198, 0.05);
    color: var(--color--light);
}

.btn-next, .btn-registrazione {
    background-color: var(--color--light);
    color: var(--color--dark);
    border: none;
    border-radius: 8px;
    padding: 14px 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-next:hover, .btn-registrazione:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.btn-next:disabled, .btn-registrazione:disabled {
    background-color: rgba(230, 224, 198, 0.2);
    color: rgba(230, 224, 198, 0.5);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Stili per il primo step (solo telefono) */
.step-telefono .input-with-icon {
    position: relative;
}

.step-telefono .input-icon {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--color--light-0-5);
    transition: all 0.3s ease;
}

.step-telefono input:focus + .input-icon {
    color: var(--color--light);
}

/* Effetto di completamento per i passi */
.step.completed input {
    border-color: rgba(76, 175, 80, 0.4);
}

.step.completed .step-title::after {
    content: "✓";
    display: inline-block;
    margin-left: 10px;
    color: #4CAF50;
}

/* Indicatore di caricamento */
.form-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    backdrop-filter: blur(3px);
    border-radius: 15px;
}

.spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(230, 224, 198, 0.3);
    border-top-color: var(--color--light);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Stile per messaggi di errore */
.error-message {
    color: #FF6B6B;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.form-group.error input {
    border-color: #FF6B6B;
}

.form-group.error .error-message {
    display: block;
}

/* Animazioni */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.6s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes success-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.success-pulse {
    animation: success-pulse 0.6s ease-in-out;
}

/* Feedback visivo per il completamento */
.success-checkmark {
    display: none;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    position: relative;
}

.success-checkmark.show {
    display: block;
}

.check-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid #4CAF50;
}

.check-icon::before {
    top: 3px;
    left: -2px;
    width: 30px;
    transform-origin: 100% 50%;
    border-radius: 100px 0 0 100px;
}

.check-icon::after {
    top: 0;
    left: 30px;
    width: 60px;
    transform-origin: 0 50%;
    border-radius: 0 100px 100px 0;
    animation: rotate-circle 4.25s ease-in;
}

.check-icon::before, .check-icon::after {
    content: '';
    height: 100px;
    position: absolute;
    background: var(--color--dark);
    transform: rotate(-45deg);
}

.check-icon .icon-line {
    height: 5px;
    background-color: #4CAF50;
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
}

.check-icon .icon-line.line-tip {
    top: 46px;
    left: 14px;
    width: 25px;
    transform: rotate(45deg);
    animation: icon-line-tip 0.75s;
}

.check-icon .icon-line.line-long {
    top: 38px;
    right: 8px;
    width: 47px;
    transform: rotate(-45deg);
    animation: icon-line-long 0.75s;
}

.check-icon .icon-circle {
    top: -4px;
    left: -4px;
    z-index: 10;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: absolute;
    box-sizing: content-box;
    border: 4px solid rgba(76, 175, 80, 0.5);
}

.check-icon .icon-fix {
    top: 8px;
    width: 5px;
    left: 26px;
    z-index: 1;
    height: 85px;
    position: absolute;
    transform: rotate(-45deg);
    background-color: var(--color--dark);
}

@keyframes rotate-circle {
    0% { transform: rotate(-45deg); }
    5% { transform: rotate(-45deg); }
    12% { transform: rotate(-405deg); }
    100% { transform: rotate(-405deg); }
}

@keyframes icon-line-tip {
    0% { width: 0; left: 1px; top: 19px; }
    54% { width: 0; left: 1px; top: 19px; }
    70% { width: 50px; left: -8px; top: 37px; }
    84% { width: 17px; left: 21px; top: 48px; }
    100% { width: 25px; left: 14px; top: 46px; }
}

@keyframes icon-line-long {
    0% { width: 0; right: 46px; top: 54px; }
    65% { width: 0; right: 46px; top: 54px; }
    84% { width: 55px; right: 0px; top: 35px; }
    100% { width: 47px; right: 8px; top: 38px; }
}

/* Responsive */
@media (max-width: 500px) {
    .registrazione-popup {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .registrazione-header {
        padding: 15px;
    }
    
    .registrazione-body {
        padding: 15px;
    }
    
    .steps-container {
        width: 400%; /* Keep the 4 steps */
    }
    
    .step {
        padding: 0 5px;
    }
    
    .step-footer {
        margin-top: 20px;
    }
    
    .btn-prev, .btn-next, .btn-registrazione {
        padding: 10px 15px;
        font-size: 14px;
    }
}