* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #000000 0%, #333333 30%, #ffcc00 70%, #ff6600 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Login Modal */
.login-modal {
    display: block;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
}

.login-content {
    background: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

.login-header {
    background: linear-gradient(135deg, #ffcc00, #ff6600);
    color: #000;
    padding: 25px 30px;
    border-radius: 15px 15px 0 0;
    text-align: center;
}

.login-header h2 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 700;
}

.login-body {
    padding: 30px;
}

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

.login-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #000;
}

.login-form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.login-form-group input:focus {
    outline: none;
    border-color: #ffcc00;
    box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.1);
}

.login-btn {
    background: linear-gradient(135deg, #ffcc00, #ff6600);
    color: #000;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 204, 0, 0.3);
}

.login-error {
    color: #e74c3c;
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    overflow: hidden;
    display: none;
}

.container.show {
    display: block;
}

.header {
    background: linear-gradient(135deg, #ffcc00, #ff6600);
    color: #000;
    padding: 30px;
    text-align: center;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(0,0,0,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.header-content {
    position: relative;
    z-index: 1;
}

.header h1 {
    font-size: 2.8em;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.header p {
    font-size: 1.3em;
    opacity: 0.9;
    font-weight: 400;
}

.fastweb-logo {
    position: absolute;
    top: 20px;
    right: 30px;
    background: #000;
    color: #ffcc00;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.2em;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.logout-btn {
    position: absolute;
    top: 20px;
    left: 30px;
    background: rgba(0,0,0,0.2);
    color: #000;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(0,0,0,0.3);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 0;
    min-height: 700px;
}

.form-section {
    padding: 40px;
    background: #f8f9fa;
}

.preview-section {
    padding: 40px;
    background: white;
    border-left: 3px solid #ffcc00;
}

.section-title {
    font-size: 1.6em;
    color: #000;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 3px solid #ffcc00;
    font-weight: 600;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: #ff6600;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #000;
    font-size: 1.1em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #ffcc00;
    box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.1);
}

.radio-group {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 15px 20px;
    border: 2px solid #ddd;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: white;
    flex: 1;
    min-width: 150px;
    justify-content: center;
}

.radio-option:hover {
    border-color: #ffcc00;
    background: #fffbf0;
    transform: translateY(-2px);
}

.radio-option input[type="radio"]:checked + label {
    color: #ff6600;
    font-weight: 700;
}

.radio-option input[type="radio"]:checked {
    accent-color: #ffcc00;
}

.radio-option.selected {
    border-color: #ffcc00;
    background: #fffbf0;
    box-shadow: 0 4px 12px rgba(255, 204, 0, 0.3);
}

/* Coverage Button */
.coverage-btn {
    background: linear-gradient(135deg, #4caf50, #388e3c);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin: 10px 0 20px 0;
    position: relative;
    overflow: hidden;
}

.coverage-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.3);
}

.coverage-btn::before {
    content: '🌐';
    margin-right: 10px;
    font-size: 1.2em;
}

/* Suggest Button */
.suggest-btn {
    background: linear-gradient(135deg, #ff6600, #e55100);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin: 10px 0 20px 0;
    position: relative;
    overflow: hidden;
}

.suggest-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 102, 0, 0.3);
}

.suggest-btn::before {
    content: '🎯';
    margin-right: 10px;
    font-size: 1.2em;
}

/* STRUTTURA OFFERTE COMPATTE */
.offer-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.offer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ffcc00, #ff6600);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.offer-card:hover::before,
.offer-card.selected::before {
    transform: scaleX(1);
}

.offer-card:hover {
    border-color: #ffcc00;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 204, 0, 0.2);
}

.offer-card.selected {
    border-color: #ffcc00;
    background: #fffbf0;
    box-shadow: 0 8px 25px rgba(255, 204, 0, 0.3);
}

.offer-card.recommended {
    border-color: #4caf50;
    background: #f8fff8;
    position: relative;
}

.offer-card.recommended::after {
    content: '⭐ CONSIGLIATA';
    position: absolute;
    top: 15px;
    right: 15px;
    background: #4caf50;
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: bold;
    z-index: 10;
}

/* Header compatto dell'offerta */
.offer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.offer-title {
    font-size: 1.3em;
    font-weight: 700;
    color: #000;
    margin: 0;
}

.offer-price {
    font-size: 1.6em;
    font-weight: 800;
    color: #ff6600;
    margin: 0;
}

.offer-price-original {
    font-size: 0.7em;
    color: #999;
    text-decoration: line-through;
    margin-left: 10px;
}

/* Anteprima compatta */
.offer-preview {
    color: #666;
    font-size: 0.95em;
    line-height: 1.4;
    margin-bottom: 15px;
}

/* NUOVA SEZIONE PER MOBILE - Controlli SIM */
.mobile-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ffcc00;
}

.sim-counter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sim-counter label {
    font-weight: 600;
    color: #000;
    margin: 0;
    font-size: 1em;
}

.sim-input {
    width: 80px !important;
    padding: 8px 12px !important;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
}

.sim-btn {
    background: linear-gradient(135deg, #ffcc00, #ff6600);
    color: #000;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sim-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(255, 204, 0, 0.3);
}

.sim-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.mobile-total {
    margin-left: auto;
    text-align: right;
}

.mobile-total-label {
    font-size: 0.9em;
    color: #666;
    margin: 0;
}

.mobile-total-price {
    font-size: 1.4em;
    font-weight: 800;
    color: #ff6600;
    margin: 0;
}

/* Pulsante espandi */
.expand-btn {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.expand-btn:hover {
    background: linear-gradient(135deg, #5a6268, #343a40);
    transform: translateY(-1px);
}

.expand-btn .icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.expand-btn.expanded .icon {
    transform: rotate(45deg);
}

/* Dettagli espandibili */
.offer-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-top: 15px;
}

.offer-details.expanded {
    max-height: 1000px;
}

.offer-features {
    list-style: none;
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ffcc00;
}

.offer-features li {
    padding: 6px 0;
    color: #555;
    position: relative;
    padding-left: 25px;
    line-height: 1.4;
    font-size: 0.9em;
}

.offer-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4caf50;
    font-weight: bold;
    font-size: 1.1em;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.service-option {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.service-option:hover {
    border-color: #ffcc00;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 204, 0, 0.2);
}

.service-option.selected {
    border-color: #ffcc00;
    background: #fffbf0;
    box-shadow: 0 6px 15px rgba(255, 204, 0, 0.3);
}

.service-name {
    font-weight: 600;
    color: #000;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.service-price {
    color: #ff6600;
    font-weight: 700;
    font-size: 1.1em;
}

.preview-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
}

.preview-title {
    font-size: 1.4em;
    color: #000;
    margin-bottom: 20px;
    font-weight: 700;
}

.preview-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
    align-items: center;
}

.preview-item:last-child {
    border-bottom: none;
    font-weight: 700;
    font-size: 1.2em;
    color: #ff6600;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid #ffcc00;
}

.btn {
    background: linear-gradient(135deg, #ffcc00, #ff6600);
    color: #000;
    border: none;
    padding: 18px 35px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 204, 0, 0.4);
}

.btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Preview Button */
.btn-preview {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    border: none;
    padding: 18px 35px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(108, 117, 125, 0.4);
}

.btn-preview:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.hidden {
    display: none;
}

.convergence-discount {
    background: linear-gradient(135deg, #4caf50, #388e3c);
    color: white;
    padding: 10px 12px;
    border-radius: 6px;
    margin-top: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9em;
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.fixed-only-discount {
    background: linear-gradient(135deg, #ff6600, #e55100);
    color: white;
    padding: 10px 12px;
    border-radius: 6px;
    margin-top: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9em;
    box-shadow: 0 4px 8px rgba(255, 102, 0, 0.3);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #ffcc00, #ff6600);
    color: #000;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    display: none;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 204, 0, 0.6);
}

.back-to-top.show {
    display: block;
    animation: fadeInUp 0.3s ease;
}

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

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

/* Modal per suggerimenti - CON SCROLLBAR */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: linear-gradient(135deg, #ffcc00, #ff6600);
    color: #000;
    padding: 25px 30px;
    border-radius: 15px 15px 0 0;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 700;
}

/* CORPO SCROLLABILE */
.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex-grow: 1;
}

/* STILE SCROLLBAR PERSONALIZZATO */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #ffcc00;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #ff6600;
}

.question {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #ffcc00;
}

.question h3 {
    color: #000;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.question-options {
    display: flex;
    gap: 15px;
}

.question-option {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 600;
}

.question-option:hover {
    border-color: #ffcc00;
    background: #fffbf0;
}

.question-option.selected {
    border-color: #ffcc00;
    background: #ffcc00;
    color: #000;
}

.close {
    color: #000;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.close:hover {
    opacity: 1;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
    text-align: right;
    flex-shrink: 0;
}

.btn-secondary {
    background: #6c757d;
    margin-right: 10px;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Preview Modal */
.preview-modal {
    display: none;
    position: fixed;
    z-index: 1500;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.preview-modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 15px;
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

.preview-modal-header {
    background: linear-gradient(135deg, #ffcc00, #ff6600);
    color: #000;
    padding: 20px 30px;
    border-radius: 15px 15px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.preview-modal-header h2 {
    margin: 0;
    font-size: 1.6em;
    font-weight: 700;
}

.preview-modal-body {
    padding: 30px;
    font-size: 14px;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .radio-group {
        flex-direction: column;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }

    .question-options {
        flex-direction: column;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .preview-modal-content {
        width: 98%;
        margin: 1% auto;
        max-height: 95vh;
    }

    .preview-modal-body {
        padding: 20px;
        font-size: 13px;
    }

    /* MOBILE: Header offerta in colonna */
    .offer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .offer-price {
        font-size: 1.4em;
    }

    /* MOBILE: Controlli SIM in colonna */
    .mobile-controls {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .mobile-total {
        margin-left: 0;
        text-align: left;
    }
}