/* ============================================
   MER GROUP S.R.L. - Stylesheet
   ============================================ */

/* --------------------------------------------
   Variables
   -------------------------------------------- */
:root {
    --color-primary: #3b82a0;
    --color-primary-light: #5a9dbf;
    --color-accent: #7cc0e0;
    --color-accent-hover: #9bd2ec;
    --color-text: #4a5568;
    --color-text-light: #718096;
    --color-bg: #f0f5f9;
    --color-white: #ffffff;
    --color-success: #10b981;
    --color-error: #ef4444;
    --font-display: 'Playfair Display', serif;
    --font-body: 'DM Sans', sans-serif;
    --transition: all 0.3s ease;
}

/* --------------------------------------------
   Reset & Base
   -------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    line-height: 1.6;
    background-color: var(--color-bg);
}

/* --------------------------------------------
   Typography
   -------------------------------------------- */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
}

.text-accent {
    color: var(--color-accent);
}

.lead {
    font-size: 1.125rem;
}

/* --------------------------------------------
   Layout
   -------------------------------------------- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: 6rem 0;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 4rem;
}

.section-label {
    display: inline-block;
    color: var(--color-accent);
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.section-description {
    font-size: 1.125rem;
    color: var(--color-text-light);
}

/* --------------------------------------------
   Buttons
   -------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-family: var(--font-body);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent) 0%, #5a9dbf 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-accent-hover) 0%, var(--color-accent) 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(59, 130, 160, 0.4);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --------------------------------------------
   Navigation
   -------------------------------------------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-img {
    height: 48px;
    width: auto;
    border-radius: 0.5rem;
    transition: var(--transition);
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
    transition: var(--transition);
}

.navbar.scrolled .logo-icon {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text span:first-child {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.25rem;
    color: white;
    transition: color 0.3s ease;
}

.navbar.scrolled .logo-text span:first-child {
    color: var(--color-primary);
}

.logo-text span:last-child {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease;
}

.navbar.scrolled .logo-text span:last-child {
    color: var(--color-text-light);
}

.nav-links {
    display: none;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    transition: color 0.3s ease;
}

.navbar.scrolled .nav-links a {
    color: var(--color-text);
}

.nav-links a:not(.btn)::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.3s ease;
}

.nav-links a:not(.btn):hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: flex;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-btn i {
    width: 24px;
    height: 24px;
    color: white;
    transition: color 0.3s ease;
}

.navbar.scrolled .mobile-menu-btn i {
    color: var(--color-primary);
}

.mobile-menu {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background: white;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 999;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1),
                opacity 0.3s ease,
                visibility 0.35s ease;
}

.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.mobile-menu a {
    display: block;
    padding: 0.75rem 0;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #eee;
}

.mobile-menu .btn {
    width: 100%;
    margin-top: 1rem;
    text-align: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }
    .mobile-menu-btn {
        display: none;
    }
}

/* --------------------------------------------
   Hero Section
   -------------------------------------------- */
.hero {
    min-height: 100vh;
    background: linear-gradient(165deg, #3b82a0 0%, #5a9dbf 40%, #6db3d4 70%, #3b82a0 100%);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 8rem 0 4rem;
}

.hero::before {
    content: '';
    position: absolute;
    top: 25%;
    right: 0;
    width: 400px;
    height: 400px;
    background: rgba(124, 192, 224, 0.08);
    border-radius: 50%;
    filter: blur(80px);
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 25%;
    left: 0;
    width: 350px;
    height: 350px;
    background: rgba(100, 150, 200, 0.05);
    border-radius: 50%;
    filter: blur(80px);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    margin-bottom: 2rem;
}

.hero-badge .dot {
    width: 8px;
    height: 8px;
    background: var(--color-accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero-badge span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    font-weight: 500;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: white;
    margin-bottom: 1.5rem;
}

.hero h1 .accent {
    color: rgba(180, 225, 245, 0.95);
}

.hero-description {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 4rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 400px;
}

.hero-stat {
    text-align: left;
}

.hero-stat .stat-icon {
    margin-bottom: 0.5rem;
}

.hero-stat .stat-icon i {
    width: 28px;
    height: 28px;
    color: white;
}

.hero-stat .number {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-accent);
}

.hero-stat .label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.25rem;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-indicator div {
    width: 24px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.scroll-indicator div::after {
    content: '';
    width: 4px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
}

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

/* --------------------------------------------
   Chi Siamo Section
   -------------------------------------------- */
.chi-siamo {
    background: white;
    position: relative;
}

.chi-siamo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent) 0%, #a8d8ea 50%, var(--color-accent) 100%);
}

.chi-siamo-grid {
    display: grid;
    gap: 4rem;
    align-items: center;
}

.chi-siamo-content h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--color-primary);
    margin-bottom: 1.5rem;
}

.chi-siamo-content p {
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.chi-siamo-content p strong {
    color: var(--color-primary);
}

.chi-siamo-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
    margin-top: 2.5rem;
}

.ateco-info {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.ateco-info .label {
    font-weight: 600;
    color: var(--color-text);
}

.target-wrapper {
    background: #e8f0f6;
    border-radius: 1.5rem;
    padding: 2rem;
    position: relative;
}

.target-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.target-card {
    background: white;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.target-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.target-card h4 {
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.target-card p {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin: 0;
}

.target-cta {
    background: var(--color-primary);
    border-radius: 1rem;
    padding: 1rem 1.5rem;
    margin-top: 1.5rem;
}

.target-cta .label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.25rem;
}

.target-cta .text {
    color: white;
    font-weight: 500;
}

@media (min-width: 1024px) {
    .chi-siamo-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* --------------------------------------------
   Servizi Section
   -------------------------------------------- */
.servizi {
    background: var(--color-bg);
}

.servizi-grid {
    display: grid;
    gap: 1.5rem;
}

.service-card {
    background: linear-gradient(180deg, white 0%, #f8fafc 100%);
    border: 1px solid rgba(124, 192, 224, 0.15);
    border-radius: 1.5rem;
    padding: 2rem;
    transition: all 0.4s ease;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(59, 130, 160, 0.15);
    border-color: rgba(124, 192, 224, 0.4);
}

.service-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1);
}

.service-icon i {
    width: 28px;
    height: 28px;
    color: white;
}

.service-icon svg {
    width: 28px;
    height: 28px;
    color: white;
    stroke: white;
}

.service-card h3 {
    font-size: 1.25rem;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
}

.service-card > p {
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.service-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.service-item i {
    width: 16px;
    height: 16px;
    color: var(--color-accent);
}

@media (min-width: 768px) {
    .servizi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .servizi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --------------------------------------------
   Metodo Section
   -------------------------------------------- */
.metodo {
    background: linear-gradient(165deg, #3b82a0 0%, #5a9dbf 40%, #6db3d4 70%, #3b82a0 100%);
    position: relative;
    overflow: hidden;
}

.metodo .section-label {
    color: var(--color-accent);
}

.metodo .section-title {
    color: white;
}

.metodo .section-description {
    color: rgba(255, 255, 255, 0.7);
}

.metodo-grid {
    display: grid;
    gap: 1.5rem;
}

.metodo-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 2rem;
    text-align: center;
    transition: background 0.3s ease;
}

.metodo-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

.metodo-card .step {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 700;
    color: rgba(180, 225, 245, 0.35);
    margin-bottom: 1rem;
}

.metodo-card h3 {
    color: white;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.metodo-card p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.metodo-cta {
    margin-top: 4rem;
    text-align: center;
}

.metodo-cta-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 2rem;
}

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

.metodo-cta-text .title {
    color: white;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.metodo-cta-text .subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .metodo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .metodo-cta-box {
        flex-direction: row;
        padding: 1.5rem 2.5rem;
    }
    .metodo-cta-text {
        text-align: left;
    }
}

@media (min-width: 1024px) {
    .metodo-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --------------------------------------------
   Contatti Section
   -------------------------------------------- */
.contatti {
    background: white;
}

.contatti-grid {
    display: grid;
    gap: 4rem;
}

.contatti-info h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--color-primary);
    margin-bottom: 1.5rem;
}

.contatti-info > p {
    color: var(--color-text-light);
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
}

.contatti-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contatto-item {
    display: flex;
    gap: 1rem;
}

.contatto-icon {
    width: 48px;
    height: 48px;
    background: #e8f0f6;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contatto-icon i {
    width: 20px;
    height: 20px;
    color: var(--color-text-light);
}

.contatto-text .label {
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.contatto-text .value {
    color: var(--color-text-light);
}

.contatto-text .value a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contatto-text .value a:hover {
    color: var(--color-accent);
}

.contatti-form {
    background: var(--color-bg);
    border-radius: 1.5rem;
    padding: 2rem;
}

.form-row {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.form-group:last-of-type {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(124, 192, 224, 0.2);
}

.form-group textarea {
    resize: none;
    min-height: 120px;
}

.form-checkbox {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin: 1.5rem 0;
}

.form-checkbox input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--color-accent);
    cursor: pointer;
}

.form-checkbox label {
    font-size: 0.875rem;
    color: var(--color-text-light);
    cursor: pointer;
}

.form-checkbox a {
    color: var(--color-accent);
}

.contatti-form .btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.125rem;
}

/* Form Message */
.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    display: none;
    text-align: center;
    font-weight: 500;
}

.form-message.success {
    display: block;
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
    border: 1px solid var(--color-success);
}

.form-message.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
    border: 1px solid var(--color-error);
}

/* Spinner */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .contatti-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* --------------------------------------------
   Footer
   -------------------------------------------- */
.footer {
    background: #2d3748;
    color: white;
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand .logo {
    margin-bottom: 1.5rem;
}

.footer-brand .logo-icon {
    background: rgba(255, 255, 255, 0.1);
    border-color: transparent;
    color: var(--color-accent);
}

.footer-brand > p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1.5rem;
    max-width: 400px;
}

.footer-legal {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.4);
}

.footer-legal a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Global footer link override */
.footer a:not(.btn):not(.logo) {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:not(.btn):not(.logo):hover {
    color: var(--color-accent);
}

.footer-col h4 {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 0.75rem;
}

.footer-col a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.4);
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
    }
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* --------------------------------------------
   Animations
   -------------------------------------------- */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.8s ease forwards;
}

.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }
.fade-in-delay-4 { animation-delay: 0.4s; }

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