:root {
    --bg-color: #0a0a0a;
    --card-bg: #1a1a1a;
    --primary-orange: #ff6b00;
    --secondary-orange: #ff9100;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --accent-gradient: linear-gradient(135deg, #ff6b00 0%, #ff9100 100%);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 107, 0, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255, 145, 0, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(255, 107, 0, 0.08) 0%, transparent 60%);
    z-index: -1;
    pointer-events: none;
    filter: blur(60px);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: -2px;
    margin-bottom: 0.5rem;
}

@media (max-width: 600px) {
    header h1 {
        font-size: 2.5rem;
    }
}

header h1 span {
    color: var(--primary-orange);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

@media (max-width: 600px) {
    header p {
        font-size: 1rem;
    }
}

.card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@media (max-width: 600px) {
    .card {
        padding: 1.5rem;
    }
}

h2, h3 {
    margin-bottom: 1.5rem;
    font-weight: 700;
}

@media (max-width: 600px) {
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.3rem; }
}

.form-group {
    margin-bottom: 1.5rem;
}

.distance-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.quick-distances {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-chip {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: var(--text-muted);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-chip:hover {
    border-color: var(--primary-orange);
    color: white;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

input {
    width: 100%;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    padding: 1rem;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

select {
    width: 100%;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    padding: 1rem;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.2);
}

select:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.2);
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    background: var(--accent-gradient);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 0, 0.4);
}

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

.hidden {
    display: none;
}

.results-container {
    animation: fadeIn 0.5s ease forwards;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 15px;
}

.stat-item .label {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.stat-item .value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary-orange);
}

.comparison-bar-container {
    width: 100%;
    height: 12px;
    background: #2a2a2a;
    border-radius: 6px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.comparison-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: 6px;
    transition: width 1s cubic-bezier(0.17, 0.67, 0.83, 0.67);
}

#advice-text {
    font-size: 1.1rem;
    color: #e0e0e0;
}

.target-message {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.upgrade-container {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.btn-upgrade {
    background: var(--accent-gradient);
    color: white;
    text-decoration: none;
    padding: 1.2rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px rgba(255, 107, 0, 0.3);
    border: none;
    cursor: pointer;
}

.btn-upgrade:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(255, 107, 0, 0.4);
}

.btn-upgrade svg {
    transition: transform 0.3s ease;
}

.btn-upgrade:hover svg {
    transform: translateX(5px);
}

@media (max-width: 600px) {
    .upgrade-container {
        margin-bottom: 1.5rem;
    }
    .btn-upgrade {
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
        width: 100%;
        justify-content: center;
        border-radius: 12px;
    }
    .btn-upgrade span {
        font-size: 0.85rem;
        line-height: 1.2;
    }
}

/* Box Prodotti Promo */
.products-promo-card {
    display: none;
    margin-top: 2rem;
    padding: 1.5rem;
    overflow: hidden;
    background: linear-gradient(145deg, var(--card-bg), #252525);
}

.products-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.products-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
}

.products-info {
    flex: 1;
}

.products-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.products-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
}

.btn-products {
    display: inline-block;
    width: auto;
    padding: 0.7rem 1.5rem;
    text-decoration: none;
    text-align: center;
}

/* Link nelle Intestazioni Card */
.card-header-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
    transition: all 0.3s ease;
}

.card-header-link h3 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header-link h3 span {
    font-size: 1.2rem;
    opacity: 0.5;
    transition: transform 0.3s ease, opacity 0.3s ease;
    color: var(--primary-orange);
    -webkit-text-fill-color: var(--primary-orange); /* Sovrascrive il gradiente del logo se necessario */
}

.card-header-link:hover h3 span {
    opacity: 1;
    transform: translateX(5px);
}

.card-header-link:hover h3 {
    color: var(--primary-orange);
}

/* Modal Overlay e Card (Generico e per PDF) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none; /* Inizia nascosto */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

/* Quando il modal non ha la classe .hidden, mostralo con flex */
.modal-overlay:not(.hidden) {
    display: flex;
}

.modal-card {
    background: #1a1a1a;
    border: 1px solid rgba(255, 107, 0, 0.3);
    border-radius: 24px;
    padding: 2rem 1.4rem;
    max-width: 420px;
    width: min(92vw, 420px);
    max-height: 88vh;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    position: relative;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card::-webkit-scrollbar {
    width: 0;
    height: 0;
}

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

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: white;
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}

.modal-benefit {
    text-align: left;
    background: rgba(255, 107, 0, 0.05);
    padding: 1rem;
    border-radius: 16px;
    margin: 1rem 0 0.8rem 0;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: #eee;
    line-height: 1.3;
}

.benefit-icon {
    font-size: 1.2rem;
    min-width: 24px;
    text-align: center;
}

.elite-slogan {
    color: #ffd700;
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 1rem;
    margin-top: 0.6rem;
    font-style: italic;
    line-height: 1.4;
}

.pdf-modal-card .btn-primary {
    margin-bottom: 0.9rem !important;
}

.pdf-modal-card .btn-secondary {
    margin-top: 0.9rem !important;
    margin-bottom: 0.9rem !important;
    line-height: 1.4;
    display: block;
}

/* Badge e Nuova Sezione Piani */
.badge-new {
    background: var(--primary-orange);
    color: black;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 900;
    margin-bottom: 0.8rem;
    display: inline-block;
}

.plans-promo-card {
    border: 1px solid rgba(255, 107, 0, 0.2);
    background: linear-gradient(145deg, #151515, #222);
}

/* Identita' visiva Premium (riutilizzabile) */
.premium-identity {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 214, 122, 0.16) 0%, transparent 40%),
        radial-gradient(circle at 88% 82%, rgba(255, 107, 0, 0.14) 0%, transparent 42%),
        linear-gradient(145deg, #161616 0%, #1d1d1d 100%);
    border: 1px solid rgba(255, 153, 51, 0.35);
    box-shadow: 0 10px 30px rgba(255, 107, 0, 0.12);
}

.premium-identity::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #ffb14a 0%, #ff6b00 100%);
    opacity: 0.9;
}

.premium-title {
    display: inline-block;
    background: linear-gradient(135deg, #ffd37a 0%, #ff8f3d 55%, #ff6b00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Effetto Premium per la sezione principale guide */
.premium-section {
    border: 1px solid rgba(255, 176, 74, 0.5) !important;
    box-shadow: 0 0 20px rgba(255, 176, 74, 0.15);
}

.premium-section::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #ffb14a 0%, #ff6b00 100%);
    opacity: 0.9;
}

.plans-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

@media (max-width: 600px) {
    .plans-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-card {
        padding: 2rem 1.5rem;
        width: 95%;
    }
    
    .modal-icon {
        font-size: 3rem;
        margin-bottom: 1rem;
    }
    
    .modal-card h3 {
        font-size: 1.4rem;
    }
    
    .benefit-item {
        font-size: 0.85rem;
    }
    
    .price-new {
        font-size: 1.2rem;
    }
}

.plan-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.plans-promo-card {
    padding-top: 1.6rem;
}

.plans-box-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.plans-box-header h3 {
    margin-bottom: 0;
    max-width: 75%;
}

.plans-info > p {
    margin-bottom: 1.2rem;
}

.sales-message-card h2 {
    margin-bottom: 0.6rem;
}

.sales-message-card p {
    color: var(--text-muted);
    margin-bottom: 0;
}

.sales-message-card {
    border-color: rgba(255, 176, 74, 0.45);
}

.sales-message-card::before {
    opacity: 1;
}

.plan-offer .btn-primary {
    font-size: 0.9rem;
}

.personalized-preview {
    border-color: rgba(255, 176, 74, 0.45);
}

.preview-label {
    font-size: 0.75rem;
    letter-spacing: 1.4px;
    color: #ffd700;
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.preview-highlights {
    display: grid;
    gap: 0.8rem;
    margin: 1.5rem 0;
}

.highlight-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    color: #e6e6e6;
    font-size: 0.9rem;
}

.blurred-guide-wrapper {
    position: relative;
    margin: 1rem 0 1.5rem 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.blurred-guide-content {
    padding: 1.2rem;
    filter: blur(7px);
    user-select: none;
}

.blurred-guide-content h3 {
    margin-bottom: 0.5rem;
}

.blurred-guide-content p {
    margin-bottom: 1rem;
    color: #d9d9d9;
}

.blur-lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.55);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
    padding: 1rem;
}

.blur-lock-overlay p {
    color: var(--text-muted);
    margin: 0;
    max-width: 450px;
    font-size: 0.9rem;
}

.unlock-btn {
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.profile-modal-card {
    max-width: 460px;
    width: min(92vw, 460px);
    text-align: left;
}

.profile-modal-card h3,
.profile-modal-card p {
    text-align: center;
}

.profile-modal-card h3 {
    margin-bottom: 0.5rem;
}

.profile-modal-card p {
    margin-bottom: 1rem;
}

.profile-modal-card .form-group {
    margin-bottom: 1rem;
}

.profile-modal-card input,
.profile-modal-card select {
    padding: 0.8rem;
}

.plan-item h4 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: var(--primary-orange);
}

.plan-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.plan-price {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.price-old {
    text-decoration: line-through;
    color: #888;
    font-size: 0.9rem;
}

.price-new {
    color: #ffd700;
    font-size: 1.4rem;
    font-weight: 900;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--primary-orange);
    color: var(--primary-orange);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s ease;
    display: inline-block;
}

.btn-secondary:hover {
    background: var(--primary-orange);
    color: black;
}

.premium-link-button {
    display: inline-block;
    width: auto;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    border-color: rgba(255, 177, 74, 0.6);
    color: #ffd37a;
    background: rgba(255, 145, 0, 0.06);
    box-shadow: inset 0 0 0 1px rgba(255, 214, 122, 0.08);
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.premium-link-button:hover {
    background: rgba(255, 145, 0, 0.14);
    color: #fff1cf;
    border-color: rgba(255, 177, 74, 0.85);
}

@media (max-width: 600px) {
    .plans-box-header {
        align-items: flex-start;
        gap: 0.75rem;
    }

    .plans-box-header h3 {
        max-width: 62%;
    }

    .premium-link-button {
        padding: 0.5rem 0.85rem;
        font-size: 0.78rem;
    }
}

/* Box Blog Promo */
.blog-promo-card {
    margin-top: 1.5rem;
    padding: 2rem;
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
    border: 1px solid rgba(255, 107, 0, 0.1);
}

.blog-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.blog-info {
    flex: 1;
}

.blog-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.blog-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.blog-icon {
    color: var(--primary-orange);
    opacity: 0.8;
    background: rgba(255, 107, 0, 0.05);
    padding: 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-blog {
    display: inline-block;
    width: auto;
    padding: 0.8rem 2rem;
    text-decoration: none;
}

/* Box Progressi Promo */
.progress-promo-card {
    margin-top: 1.5rem;
    padding: 2.5rem;
    background: linear-gradient(145deg, #151515, #222222);
    border: 1px solid rgba(255, 107, 0, 0.2);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.progress-promo-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-orange);
    box-shadow: 0 15px 40px rgba(255, 107, 0, 0.15);
}

.progress-promo-card::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 107, 0, 0.05) 0%, transparent 70%);
    z-index: 0;
}

.progress-content {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    position: relative;
    z-index: 1;
}

.progress-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.progress-icon-wrapper {
    background: rgba(255, 107, 0, 0.1);
    padding: 1.5rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 107, 0, 0.1);
    transition: all 0.3s ease;
}

.progress-promo-card:hover .progress-icon-wrapper {
    background: rgba(255, 107, 0, 0.15);
    transform: scale(1.05);
}

.progress-info h3 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.progress-info p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    max-width: 400px;
}

.btn-progress {
    display: inline-block;
    width: auto;
    padding: 0.8rem 2.2rem;
    text-decoration: none;
    font-size: 1rem;
}

@media (max-width: 600px) {
    .progress-content,
    .predictor-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    .progress-info p,
    .predictor-info p {
        margin: 0 auto 1.5rem;
    }
}

/* Footer & About Section */
.footer-about {
    margin-top: 4rem;
    padding: 2rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-about h3 {
    color: var(--primary-orange);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.footer-about p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto 2rem;
}

.main-footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 2rem;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-orange);
}

.iubenda-embed {
    display: none !important;
}

@media (max-width: 600px) {
    .blog-content,
    .products-content {
        flex-direction: column-reverse;
        text-align: center;
    }
    .products-content {
        flex-direction: column;
    }
    .products-img {
        width: 100px;
        height: 100px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
