/* =========================================
   VARIABILI
   ========================================= */
:root {
    --primary: #432975;
    --primary-light: #5a3b8a;
    --accent: #00d7b0;
    --accent-dark: #00b894;
    --cream: #f9f7fc;
    --white: #ffffff;
    --text: #1e1e2f;
    --text-light: #4a4a5e;
    --text-muted: #6e6e81;
    --border: #e2dfe8;
    --shadow-sm: 0 1px 3px rgba(67, 41, 117, 0.06);
    --shadow-md: 0 6px 22px rgba(67, 41, 117, 0.10);
    --shadow-lg: 0 14px 44px rgba(67, 41, 117, 0.14);
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 24px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1200px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f5f3f9;
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================
   HERO
   ========================================= */
.hero {
    background: linear-gradient(155deg, #2d1b50 0%, #432975 35%, #3c2268 100%);
    color: var(--white);
    padding: 1px 24px 50px;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 25%, rgba(0, 215, 176, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 65%, rgba(0, 215, 176, 0.07) 0%, transparent 55%);
    pointer-events: none;
}

.hero-accent-line {
    width: 60px;
    height: 3px;
    background: var(--accent);
    margin: 0 auto 28px;
    border-radius: 2px;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(1.92rem, 4.24vw, 2.88rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 2px;
    position: relative;
    z-index: 1;
    line-height: 1.2;
}

.hero .subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.45rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.hero .subtitle .flag {
    font-size: 1.3rem;
}

.hero .company-line {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.hero .company-line .flag {
    font-size: 1.3rem;
}

.hero-contact-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 28px;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
    font-size: 0.95rem;
}

.hero-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

.hero-contact-item:hover {
    color: var(--accent);
}

.hero-contact-item .contact-icon-small {
    font-size: 1.2rem;
}

.hero-logo-container {
    position: relative;
    z-index: 1;
    margin-top: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-logo {
    height: 128px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

/* =========================================
   CONTAINER
   ========================================= */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 32px;
}

@media (min-width: 1400px) {
    .container {
        padding: 0 40px;
    }
}

/* =========================================
   SECTION TITLES
   ========================================= */
.section-title {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.section-underline {
    width: 44px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    margin-bottom: 24px;
}

/* =========================================
   ABOUT
   ========================================= */
.about-section {
    margin-top: -45px;
    position: relative;
    z-index: 2;
    padding-bottom: 42px;
}

.about-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 42px 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.about-card .greeting {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.about-card h2 {
    font-size: 1.55rem;
    color: var(--primary);
    margin-bottom: 16px;
    font-weight: 700;
}

.about-card p {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 12px;
    line-height: 1.7;
}

.about-card .highlight {
    color: var(--primary);
    font-weight: 650;
}

/* =========================================
   SERVICES
   ========================================= */
.services-section {
    padding: 10px 0 50px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.service-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid transparent;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.service-card .icon {
    font-size: 2rem;
    margin-bottom: 14px;
    display: block;
}

.service-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.service-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1;
}

/* =========================================
   PULSANTE "+"
   ========================================= */
.plus-btn {
    margin-top: 16px;
    align-self: flex-start;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    padding: 0;
}

.plus-btn:hover {
    background: var(--primary);
    color: var(--white);
    transform: scale(1.08);
}

/* =========================================
   SIMULATORE ADR
   ========================================= */
.simulator-section {
    padding: 10px 0 50px;
}

.simulator-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 42px 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.simulator-intro {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 32px;
    max-width: 760px;
}

.simulator-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 40px;
    align-items: start;
}

.sim-field {
    margin-bottom: 26px;
}

.sim-field:last-child {
    margin-bottom: 0;
}

.sim-field label {
    display: block;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.sim-control {
    display: flex;
    align-items: center;
    gap: 16px;
}

.simulator-section input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.simulator-section input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--white);
    box-shadow: 0 2px 6px rgba(0, 215, 176, 0.45);
    cursor: pointer;
    transition: transform 0.15s;
}

.simulator-section input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.simulator-section input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--white);
    box-shadow: 0 2px 6px rgba(0, 215, 176, 0.45);
    cursor: pointer;
}

.simulator-section input[type="number"] {
    width: 92px;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    -moz-appearance: textfield;
    appearance: textfield;
    background: var(--white);
}

.simulator-section input[type="number"]::-webkit-outer-spin-button,
.simulator-section input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.simulator-section input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 215, 176, 0.15);
}

.simulator-results {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 30px 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.result-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.result-value {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
    transition: color 0.2s;
}

.result-value.monthly {
    font-size: 1.45rem;
    color: var(--accent-dark);
}

.result-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-top: 2px;
    line-height: 1.5;
}

.simulator-message {
    margin-top: 30px;
    padding: 18px 22px;
    background: linear-gradient(135deg, rgba(0, 215, 176, 0.10), rgba(67, 41, 117, 0.06));
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.6;
}

.simulator-message strong {
    color: var(--primary);
}

.simulator-cta-wrapper {
    margin-top: 28px;
    text-align: center;
}

.simulator-cta {
    display: inline-block;
    padding: 18px 42px;
    background: var(--accent);
    color: #0a0a1a;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    border-radius: 50px;
    text-decoration: none;
    transition: all var(--transition);
    box-shadow: 0 6px 20px rgba(0, 215, 176, 0.35);
}

.simulator-cta:hover {
    background: #00e6be;
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 215, 176, 0.45);
}

/* =========================================
   OVERLAY MODAL
   ========================================= */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 20, 50, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    padding: 20px;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.overlay-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    max-width: 620px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 42px 36px 36px;
    position: relative;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    transform: translateY(12px) scale(0.97);
    transition: transform 0.3s ease;
}

.overlay.active .overlay-content {
    transform: translateY(0) scale(1);
}

.overlay-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--cream);
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    padding: 0;
}

.overlay-close:hover {
    background: var(--primary);
    color: var(--white);
    transform: rotate(90deg);
}

.overlay-content .overlay-icon {
    font-size: 2.6rem;
    margin-bottom: 12px;
}

.overlay-content h2 {
    font-size: 1.6rem;
    color: var(--primary);
    margin-bottom: 4px;
    font-weight: 700;
}

.overlay-content .overlay-underline {
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    margin-bottom: 20px;
}

.overlay-content p {
    color: var(--text-light);
    font-size: 0.98rem;
    line-height: 1.75;
    margin-bottom: 14px;
}

.overlay-content ul {
    list-style: none;
    padding: 0;
    margin: 0 0 14px 0;
}

.overlay-content ul li {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    padding-left: 26px;
    position: relative;
    margin-bottom: 8px;
}

.overlay-content ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-dark);
    font-weight: 700;
}

.overlay-content .overlay-tagline {
    background: var(--cream);
    border-left: 4px solid var(--accent);
    padding: 14px 18px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.92rem;
    color: var(--primary);
    font-weight: 600;
    margin-top: 6px;
}

/* =========================================
   D-EDGE
   ========================================= */
.dedge-section {
    padding: 10px 0 50px;
}

.dedge-card {
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: 38px 34px;
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    align-items: flex-start;
    box-shadow: var(--shadow-lg);
}

.dedge-card .logo-area {
    flex-shrink: 0;
}

.dedge-logo {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--white);
    white-space: nowrap;
}

.dedge-logo span {
    color: var(--accent);
}

.dedge-card .info-area {
    flex: 1;
    min-width: 280px;
}

.dedge-card .info-area p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.98rem;
    margin-bottom: 10px;
    line-height: 1.6;
}

.dedge-card .stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin-top: 18px;
}

@media (max-width: 768px) {
    .dedge-card .stats-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
        width: 100%;
    }
}

.stat-item {
    text-align: center;
    min-width: 70px;
}

.stat-number {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.65);
}

/* =========================================
   CONTACT
   ========================================= */
.contact-section {
    padding: 10px 0 60px;
}

.contact-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 44px 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 8px;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 20px 18px;
    border-radius: var(--radius-sm);
    background: var(--cream);
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.contact-item:hover {
    background: #ede8f5;
    box-shadow: var(--shadow-sm);
}

.contact-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.contact-item .contact-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.contact-item .contact-label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
}

.contact-detail {
    font-size: 0.92rem;
    color: var(--text);
    margin-top: 2px;
    line-height: 1.4;
}

.contact-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* =========================================
   CTA STRIP
   ========================================= */
.cta-strip {
    text-align: center;
    padding: 14px 28px;
    background: var(--accent);
    color: #0a0a1a;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    border-radius: 40px;
    margin-top: 24px;
    display: inline-block;
    text-decoration: none;
    transition: all var(--transition);
    box-shadow: 0 4px 10px rgba(0, 215, 176, 0.25);
}

.cta-strip:hover {
    background: #00e6be;
    box-shadow: 0 8px 18px rgba(0, 215, 176, 0.35);
    transform: translateY(-2px);
}

.cta-wrapper {
    text-align: center;
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
    text-align: center;
    padding: 30px 24px 40px;
    color: var(--text-muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--border);
    margin-top: 10px;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    color: var(--accent-dark);
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 900px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .contact-grid {
        grid-template-columns: 1fr;
    }
    .simulator-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

@media (max-width: 600px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
    .hero-contact-row {
        flex-direction: column;
        gap: 12px;
    }
    .about-card,
    .contact-card,
    .dedge-card,
    .simulator-card {
        padding: 24px 18px;
    }
    .container {
        padding: 0 20px;
    }
    .hero h1 {
        font-size: 1.9rem;
    }
    .dedge-card {
        flex-direction: column;
    }
    .overlay-content {
        padding: 32px 22px 28px;
    }
    .overlay-close {
        top: 10px;
        right: 12px;
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }
    .result-value {
        font-size: 1.7rem;
    }
    .result-value.monthly {
        font-size: 1.25rem;
    }
    .sim-control {
        flex-wrap: wrap;
    }
    .simulator-section input[type="number"] {
        width: 100%;
    }
}