/* HouseTech Valutazione Premium - Apple Style CSS */

/* Reset e Font */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.htv-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Display', sans-serif;
    color: #1d1d1f;
    line-height: 1.5;
    background: #ffffff;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Progress Bar */
.htv-progress-bar {
    margin-bottom: 60px;
    position: relative;
}

.htv-progress-fill {
    position: absolute;
    top: 30px;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, #A705B1 0%, #8e04a0 100%);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.htv-progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.htv-step {
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.4;
}

.htv-step.active {
    opacity: 1;
}

.htv-step.completed {
    opacity: 1;
}

.htv-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #ffffff;
    border: 2px solid #e5e5e7;
    border-radius: 50%;
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.htv-step.active .htv-step-number {
    background: #A705B1;
    color: white;
    border-color: #A705B1;
    transform: scale(1.1);
}

.htv-step.completed .htv-step-number {
    background: #ffffff;
    color: #A705B1;
    border-color: #A705B1;
}

.htv-step-label {
    display: block;
    font-size: 14px;
    color: #86868b;
    font-weight: 500;
}

.htv-step.active .htv-step-label {
    color: #1d1d1f;
    font-weight: 600;
}

/* Step Content */
.htv-step-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.htv-step-content.active {
    display: block;
}

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

/* Headers */
.htv-header {
    text-align: center;
    margin-bottom: 50px;
}

.htv-title {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #1d1d1f 0%, #A705B1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.htv-subtitle {
    font-size: 21px;
    color: #86868b;
    font-weight: 400;
}

/* Device Grid */
.htv-device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.htv-device-card {
    background: #ffffff;
    border: 2px solid #f5f5f7;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.htv-device-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #A705B1 0%, #8e04a0 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.htv-device-card:hover {
    border-color: #A705B1;
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(167, 5, 177, 0.15);
}

.htv-device-card:hover::before {
    transform: scaleX(1);
}

.htv-device-card:hover .htv-device-arrow {
    transform: translateX(5px);
    opacity: 1;
}

.htv-device-icon {
    margin-bottom: 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.htv-device-name {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1d1d1f;
}

.htv-device-desc {
    font-size: 15px;
    color: #86868b;
    margin-bottom: 20px;
}

.htv-device-arrow {
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 24px;
    color: #A705B1;
    opacity: 0;
    transition: all 0.3s ease;
}

/* Back Button */
.htv-back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #A705B1;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 30px;
    transition: all 0.2s ease;
}

.htv-back-button:hover {
    transform: translateX(-4px);
}

/* Search Box */
.htv-search-box {
    position: relative;
    max-width: 500px;
    margin: 0 auto 40px;
}

.htv-search-input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    font-size: 17px;
    border: 2px solid #f5f5f7;
    border-radius: 12px;
    background: #f5f5f7;
    transition: all 0.3s ease;
    outline: none;
}

.htv-search-input:focus {
    border-color: #A705B1;
    background: #ffffff;
}

.htv-search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #86868b;
}

/* Model List */
.htv-model-list {
    display: grid;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
}

.htv-model-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #ffffff;
    border: 2px solid #f5f5f7;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.htv-model-item:hover {
    border-color: #A705B1;
    background: #faf0fb;
    transform: translateX(4px);
}

.htv-model-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-right: 20px;
}

.htv-model-info {
    flex: 1;
}

.htv-model-name {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.htv-model-price {
    font-size: 14px;
    color: #86868b;
}

/* Condition Cards */
.htv-conditions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* Questions Container - NUOVO DESIGN */
.htv-questions-container {
    max-width: 900px;
    margin: 0 auto;
}

.htv-question-group {
    margin-bottom: 40px;
    background: #ffffff;
    padding: 25px;
    border-radius: 16px;
    border: 1px solid #f5f5f7;
    transition: all 0.3s ease;
}

.htv-question-group.hidden {
    display: none;
}

.htv-question-group.fading-out {
    opacity: 0;
    transform: translateY(-10px);
}

.htv-question-title {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.htv-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f5f5f7;
    color: #86868b;
    font-size: 12px;
    cursor: help;
}

/* Options Grid */
.htv-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.htv-options-grid.htv-grid-6 {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.htv-option-card {
    padding: 16px 20px;
    background: #ffffff;
    border: 2px solid #e5e5e7;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
}

.htv-option-card:hover {
    border-color: #A705B1;
    background: #faf0fb;
}

.htv-option-card.selected {
    background: #84c225;
    border-color: #84c225;
    color: white;
}

.htv-option-card.selected .htv-option-text {
    color: white;
    font-weight: 600;
}

.htv-option-text {
    font-size: 15px;
    color: #1d1d1f;
    font-weight: 500;
}

/* Info Box */
.htv-info-box {
    margin-top: 15px;
    padding: 15px;
    background: #f5f5f7;
    border-radius: 8px;
    font-size: 14px;
    color: #6e6e73;
    line-height: 1.5;
}

/* Comment Field */
.htv-comment-field {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 2px solid #e5e5e7;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
    background: #f5f5f7;
}

.htv-comment-field:focus {
    outline: none;
    border-color: #A705B1;
    background: #ffffff;
}

.htv-comment-field::placeholder {
    color: #86868b;
}

/* Continue Button */
.htv-btn-continue {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 40px auto 0;
    padding: 18px 32px;
    background: linear-gradient(135deg, #A705B1 0%, #8e04a0 100%);
    color: white;
    font-size: 17px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.htv-btn-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(167, 5, 177, 0.3);
}

.htv-btn-continue:disabled {
    background: #e5e5e7;
    color: #86868b;
    cursor: not-allowed;
    transform: none;
}

/* Model Preview in Step 3 */
.htv-model-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.htv-model-preview img {
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
}

/* Device Thumb in Results */
.htv-device-thumb {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.htv-device-specs {
    display: flex;
    gap: 15px;
    margin: 8px 0;
    font-size: 14px;
    color: #6e6e73;
}

.htv-device-specs span {
    padding: 4px 12px;
    background: #f5f5f7;
    border-radius: 20px;
}

/* Model List with Images */
.htv-model-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #ffffff;
    border: 2px solid #f5f5f7;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 20px;
}

.htv-model-item:hover {
    border-color: #A705B1;
    background: #faf0fb;
    transform: translateX(4px);
}

.htv-model-item.selected {
    background: linear-gradient(135deg, #faf0fb 0%, #f3e4f5 100%);
    border-color: #A705B1;
}

.htv-model-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    flex-shrink: 0;
}

.htv-model-info {
    flex: 1;
}

.htv-model-name {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.htv-model-price {
    font-size: 14px;
    color: #86868b;
}

.htv-condition-card {
    background: #ffffff;
    border: 2px solid #f5f5f7;
    border-radius: 20px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.htv-condition-card:hover {
    border-color: #A705B1;
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(167, 5, 177, 0.1);
}

.htv-condition-card.selected {
    background: linear-gradient(135deg, #faf0fb 0%, #f3e4f5 100%);
    border-color: #A705B1;
}

.htv-condition-icon {
    font-size: 40px;
    margin-bottom: 16px;
}

.htv-condition-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1d1d1f;
}

.htv-condition-desc {
    font-size: 15px;
    color: #86868b;
    margin-bottom: 16px;
    line-height: 1.4;
}

.htv-condition-list {
    list-style: none;
    margin-bottom: 20px;
}

.htv-condition-list li {
    font-size: 14px;
    color: #6e6e73;
    padding: 4px 0;
    padding-left: 20px;
    position: relative;
}

.htv-condition-list li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #A705B1;
}

.htv-condition-value {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #A705B1;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* Additional Info */
.htv-additional-info {
    background: #f5f5f7;
    border-radius: 20px;
    padding: 30px;
}

.htv-additional-info h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.htv-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.htv-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 16px;
    background: white;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.htv-checkbox:hover {
    background: #faf0fb;
}

.htv-checkbox input[type="checkbox"] {
    display: none;
}

.htv-checkbox-box {
    width: 24px;
    height: 24px;
    border: 2px solid #d2d2d7;
    border-radius: 6px;
    margin-right: 12px;
    position: relative;
    transition: all 0.2s ease;
}

.htv-checkbox input:checked + .htv-checkbox-box {
    background: #A705B1;
    border-color: #A705B1;
}

.htv-checkbox input:checked + .htv-checkbox-box::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
}

.htv-checkbox span:nth-child(3) {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
}

.htv-bonus {
    color: #A705B1;
    font-weight: 600;
    font-size: 14px;
}

/* Result Container */
.htv-result-container {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #ffffff 0%, #faf0fb 100%);
    border-radius: 30px;
}

.htv-result-header {
    margin-bottom: 40px;
}

.htv-success-icon {
    display: inline-block;
    margin-bottom: 20px;
    animation: scaleIn 0.6s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.htv-result-title {
    font-size: 36px;
    font-weight: 700;
    color: #1d1d1f;
}

/* Device Summary */
.htv-device-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    padding: 30px;
    background: white;
    border-radius: 20px;
}

#device-image {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.htv-device-details h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.htv-device-details p {
    color: #86868b;
}

/* Price Display */
.htv-price-display {
    margin-bottom: 40px;
}

.htv-price-label {
    font-size: 18px;
    color: #86868b;
    margin-bottom: 12px;
}

.htv-price-amount {
    font-size: 72px;
    font-weight: 700;
    color: #A705B1;
    margin-bottom: 12px;
    animation: priceReveal 0.8s ease;
}

@keyframes priceReveal {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.htv-price-note {
    font-size: 14px;
    color: #86868b;
}

/* Action Buttons */
.htv-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 400px;
    margin: 0 auto 40px;
}

.htv-btn-primary,
.htv-btn-secondary,
.htv-btn-ghost {
    padding: 18px 32px;
    font-size: 17px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.htv-btn-primary {
    background: linear-gradient(135deg, #A705B1 0%, #8e04a0 100%);
    color: white;
}

.htv-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(167, 5, 177, 0.3);
}

.htv-btn-secondary {
    background: white;
    color: #A705B1;
    border: 2px solid #A705B1;
}

.htv-btn-secondary:hover {
    background: #faf0fb;
}

.htv-btn-ghost {
    background: transparent;
    color: #86868b;
}

.htv-btn-ghost:hover {
    color: #1d1d1f;
}

.htv-btn-block {
    width: 100%;
}

/* Trust Badges */
.htv-trust-badges {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.htv-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6e6e73;
}

.htv-badge svg {
    flex-shrink: 0;
}

/* Modal */
.htv-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.htv-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.htv-modal-content {
    background: white;
    border-radius: 30px;
    padding: 40px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: slideUp 0.4s ease;
}

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

.htv-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: #f5f5f7;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.htv-modal-close:hover {
    background: #e5e5e7;
}

.htv-modal-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.htv-modal-content p {
    color: #86868b;
    margin-bottom: 30px;
}

/* Form */
.htv-form-group {
    margin-bottom: 24px;
}

.htv-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.htv-form-group input,
.htv-form-group textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #f5f5f7;
    border-radius: 12px;
    background: #f5f5f7;
    transition: all 0.3s ease;
    outline: none;
}

.htv-form-group input:focus,
.htv-form-group textarea:focus {
    border-color: #A705B1;
    background: white;
}

/* Responsive */
@media (max-width: 768px) {
    .htv-title {
        font-size: 36px;
    }
    
    .htv-subtitle {
        font-size: 18px;
    }
    
    .htv-device-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .htv-device-card {
        padding: 20px;
    }
    
    .htv-conditions {
        grid-template-columns: 1fr;
    }
    
    .htv-progress-steps {
        justify-content: space-between;
    }
    
    .htv-step-number {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }
    
    .htv-step-label {
        font-size: 12px;
    }
    
    .htv-price-amount {
        font-size: 48px;
    }
    
    .htv-device-summary {
        flex-direction: column;
    }
    
    .htv-trust-badges {
        gap: 20px;
    }
    
    .htv-action-buttons {
        width: 100%;
    }
}