/* Root colour variables inspired by the SGOL pastels */

:root {
    --background: #DFF5DB;
    /* Pastel green */
    --accent: #C2335F;
    /* Deep rose */
    --text-primary: #265946;
    /* Dark green for text */
    --text-secondary: #456d5a;
    /* Slightly lighter green */
    --white: #ffffff;
    --blue-bg: #D8F0F7;
    /* Azzurro tenue per la hero secondaria */
}


/* Global styles */

html {
    scroll-behavior: smooth;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100%;
    /* permette alla hero di espandersi a tutta l'altezza viewport */
}


/* Evita overflow orizzontali: padding/border inclusi nella larghezza */

*,
*::before,
*::after {
    box-sizing: border-box;
}

a {
    color: inherit;
    text-decoration: none;
}


/* Hero section */

.hero {
    position: relative;
    /* Altezza piena della finestra. 100dvh supporta la dimensione dinamica su mobile, fallback 100vh. */
    min-height: 100vh;
    min-height: 100dvh;
    background-image: url('74e51590-cf01-4c23-a89b-ec441467c83f.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}


/* Seconda hero con sfondo azzurro fisso */

.hero.hero-secondary {
    background-color: var(--blue-bg);
    background-image: none;
    /* lo sfondo a onde resta solo nella prima hero */
}


/* Pannello centrale sfumato con immagine e animazione */

.glow-panel {
    position: relative;
    display: inline-block;
    max-width: 1000px;
    width: min(92vw, 1000px);
    padding: clamp(1.25rem, 2vw, 2rem);
    border-radius: 24px;
    overflow: hidden;
}

.glow-bg {
    position: absolute;
    inset: 0;
    background-image: url('74e51590-cf01-4c23-a89b-ec441467c83f.png');
    background-size: cover;
    background-position: center;
    filter: blur(4px) saturate(110%);
    transform: scale(1.05);
}

.glow-panel::before {
    content: '';
    position: absolute;
    inset: -30%;
    background: radial-gradient(60% 60% at 20% 30%, rgba(194, 51, 95, 0.25), transparent 60%), radial-gradient(50% 50% at 80% 70%, rgba(38, 89, 70, 0.25), transparent 60%);
    animation: glow-move 12s ease-in-out infinite;
}

.glow-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.75));
    backdrop-filter: blur(2px);
}

.slogan {
    position: relative;
    z-index: 1;
    margin: 0;
    font-weight: 700;
    color: var(--accent);
    font-size: clamp(1.4rem, 3.5vw, 2.2rem);
    line-height: 1.3;
}

@keyframes glow-move {
    0%,
    100% {
        transform: rotate(0deg) translate3d(0, 0, 0);
    }
    50% {
        transform: rotate(3deg) translate3d(0, -6px, 0);
    }
}


/* Utility per nascondere il titolo mantenendo accessibilità */

.visually-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
    /* prevent line breaks */
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(2px);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 2rem;
    opacity: 0;
    transform: translateY(40px) scale(.98);
    filter: blur(4px);
    transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1), filter .8s ease;
    will-change: opacity, transform, filter;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
    letter-spacing: 1px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    background-color: var(--accent);
    color: var(--white);
    padding: 0.75em 1.75em;
    border-radius: 30px;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: inherit;
    font-size: inherit;
}

.btn:hover {
    background-color: #a4284c;
    transform: translateY(-3px);
}

.btn.large {
    background-color: var(--white);
    color: var(--accent);
    border: 2px solid var(--white);
    margin-top: 1rem;
    font-size: 1.1rem;
}

.btn.large:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: translateY(-3px);
}


/* Freccia scroll in basso alla hero */

.scroll-arrow {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--accent);
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, background-color 0.3s ease;
    animation: bounce 2s ease-in-out infinite;
    z-index: 2;
}

.scroll-arrow:hover,
.scroll-arrow:focus-visible {
    background: rgba(255, 255, 255, 1);
    transform: translateX(-50%) translateY(-4px);
}

@keyframes bounce {
    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-8px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-arrow {
        animation: none;
    }
}


/* Section base styles */

.section {
    padding: 4rem 1.5rem;
    position: relative;
    opacity: 0;
    transform: translateY(40px) scale(.98);
    filter: blur(4px);
    transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1), filter .8s ease;
    will-change: opacity, transform, filter;
}


/* Features/Moduli section - full viewport height with scrollable content */

.section.features {
    min-height: 100vh;
    min-height: 100dvh;
    /* dynamic viewport height for mobile browsers */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 1.5rem;
    /* Limiti minimi per schermi piccoli */
    min-height: max(100vh, 700px);
    min-height: max(100dvh, 700px);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.section-desc {
    max-width: 900px;
    margin: 0 auto 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
}


/* Modules grid */

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 1100px;
    margin: 2rem auto 0;
}


/* Mobile: cards a capo con dimensioni adattive */

@media (max-width: 600px) {
    .module-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 1rem;
    }
}

@media (min-width: 601px) and (max-width: 860px) {
    .module-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

.module-card {
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.module-card:hover {
    transform: translateY(-5px);
}


/* Link "Dettagli" dentro alle card */

.more-link {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: .5px;
    padding: 0.45em 0.9em;
    border: 1px solid var(--accent);
    border-radius: 20px;
    background: var(--white);
    color: var(--accent);
    box-shadow: 0 2px 4px rgba(0, 0, 0, .05);
    transition: background-color .25s ease, color .25s ease, transform .25s ease;
}

.more-link:hover,
.more-link:focus-visible {
    background: var(--accent);
    color: var(--white);
    transform: translateY(-2px);
}


/* Card dettagliate per le sezioni approfondite */

.detail-card {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--accent);
    border-radius: 18px;
    padding: 2rem 1.75rem;
    display: grid;
    gap: 1.5rem;
    align-items: start;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
    max-width: 1100px;
    margin: 0 auto;
}

.detail-card .section-desc {
    margin-bottom: 0;
    /* gestito dal gap */
}

@media (min-width: 860px) {
    .detail-card {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 500px) {
    .more-link {
        font-size: 0.65rem;
        padding: 0.35em 0.75em;
    }
}


/* Evidenza badge pagamenti */

.badge {
    display: inline-block;
    background: var(--accent);
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.35em 0.6em;
    border-radius: 6px;
    letter-spacing: .5px;
    vertical-align: middle;
    margin-right: .5em;
}

.badge.micro {
    font-size: 0.6rem;
    padding: 0.25em 0.5em;
    opacity: 0.95;
}


/* Sezione visual pagamenti */

.payment-visual {
    margin-top: 1rem;
    text-align: center;
    animation: float 6s ease-in-out infinite;
}

.payment-visual svg {
    max-width: 360px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.08));
}

.payment-caption {
    font-size: .75rem;
    color: var(--text-secondary);
    margin-top: .5rem;
    letter-spacing: .5px;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .payment-visual {
        animation: none;
    }
}

.module-card h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.module-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}


/* Bullet lists */

.bullet-list {
    list-style: none;
    max-width: 900px;
    margin: 0 auto;
    padding-left: 0;
    color: var(--text-secondary);
}

.bullet-list li {
    margin: 0.6rem 0;
    padding-left: 1.75rem;
    position: relative;
    font-size: 1rem;
}

.bullet-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.4rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--accent);
}


/* Stato visibile: transizione bidirezionale (entrata/uscita). Quando l'elemento esce, torna allo stato iniziale. */

.section.visible,
.hero-content.visible,
.glow-panel.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}


/* CTA section */

.cta {
    background-color: var(--accent);
    color: var(--white);
    border-radius: 20px;
    text-align: center;
    margin: 4rem auto;
    padding: 3rem 2rem;
    max-width: 900px;
}

.cta .section-title {
    color: var(--white);
}

.cta .section-desc {
    color: var(--white);
}

.cta .btn.large {
    background-color: var(--white);
    color: var(--accent);
    padding: 0.9em 2.2em;
    margin-top: 2rem;
}

.cta-alternative {
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
}

.cta-alternative a {
    color: var(--white);
    text-decoration: underline;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.cta-alternative a:hover {
    opacity: 0.85;
}


/* Modal Contact Form */

.modal[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 1000;
    transition: opacity .25s ease, visibility .25s ease;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    width: min(680px, 92vw);
    background: var(--white);
    border-radius: 18px;
    border: 2px solid var(--accent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
    padding: 1.5rem;
    z-index: 1;
    max-height: min(88vh, 100dvh - 3rem);
    overflow: auto;
}

.modal-close {
    position: absolute;
    top: .5rem;
    right: .75rem;
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

.modal-desc {
    color: var(--text-secondary);
    margin-top: .25rem;
}

.contact-form {
    margin-top: 1rem;
}

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

.form-field {
    min-width: 0;
}

.form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: .4rem;
    color: var(--text-primary);
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    max-width: 100%;
    border: 1.5px solid #d9e7d5;
    border-radius: 10px;
    padding: .7rem .85rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.95);
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.form-field .error-msg {
    color: var(--accent);
    font-size: .8rem;
    margin-top: .25rem;
    min-height: 1em;
    display: block;
}

.field-error {
    border-color: var(--accent) !important;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(194, 51, 95, .15);
    background: #fff;
}

.form-actions {
    margin-top: 1rem;
    text-align: right;
}

@media (min-width: 720px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
    .form-field.full {
        grid-column: 1 / -1;
    }
}


/* body lock quando modal aperta */

body.modal-open {
    overflow: hidden;
}


/* Nota legale sotto il form di contatto */

.form-legal {
    margin-top: .5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-legal a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
}


/* Footer */

.footer {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.footer .footer-link {
    color: var(--accent);
    font-weight: 600;
    margin-left: .5rem;
    text-decoration: underline;
}

.footer .footer-link:hover,
.footer .footer-link:focus-visible {
    color: #a4284c;
}


/* FadeIn animation definitions */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}