/* ==========================================================================
   SAM S.r.l. - PREMIUM MEDIUM-DARK DESIGN SYSTEM (Sarti del Management)
   ========================================================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;850&display=swap');

:root {
    /* Color Palette SAM - Medium/Dark Accogliente */
    --primary-blue: #38bdf8;       /* Azzurro SAM Brillante per contrasto */
    --primary-blue-glow: rgba(56, 189, 248, 0.15);
    
    --primary-brown: #d97706;      /* Marrone/Bronzo SAM */
    --primary-brown-hover: #f59e0b;
    --primary-brown-glow: rgba(217, 119, 6, 0.2);
    
    --text-light-main: #f8fafc;     /* Bianco sporco / Slate-50 */
    --text-light-muted: #cbd5e1;    /* Grigio chiaro / Slate-300 */
    --text-white: #ffffff;
    
    --border-glass: rgba(255, 255, 255, 0.08);
    --bg-glass: rgba(15, 23, 42, 0.35);
    --bg-glass-card: rgba(255, 255, 255, 0.06);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset and Global Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    background-color: #17202b;
    color: var(--text-light-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
    min-height: 100vh;
}

/* Sfondo animato a due colori senza soluzione di continuità */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background: linear-gradient(135deg, #1b2633 0%, #443226 100%);
    background-size: 200% 200%;
    animation: wave-bg 15s ease-in-out infinite alternate;
}

/* Filtro rumore SVG per unificare il gradiente ed eliminare le strisce (Banding) */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 0.035; /* Molto sottile, crea l'effetto carta premium e fonde i colori */
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 250 250' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

@keyframes wave-bg {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-white);
}

p {
    color: var(--text-light-muted);
    font-size: 1rem;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: var(--transition-smooth);
}

a:hover {
    color: var(--primary-brown);
}

/* Base Layout Containers */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Glassmorphism Card Style - Frost Theme */
.sam-card {
    background: var(--bg-glass-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 2rem;
    transition: var(--transition-smooth);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.3);
}

.sam-card:hover {
    border-color: rgba(56, 189, 248, 0.35);
    transform: translateY(-5px);
    box-shadow: 0 15px 45px -5px rgba(0, 0, 0, 0.45);
}

/* Custom Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.85rem 2rem;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition-smooth);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-brown) 0%, #b45309 100%);
    color: var(--text-white);
    box-shadow: 0 4px 15px var(--primary-brown-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-brown-hover) 0%, #d97706 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-white);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

/* Header / Navigation */
.site-header {
    background: rgba(23, 32, 43, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition-smooth);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 75px;
}

.logo img {
    height: 40px;
    display: block;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    color: var(--text-light-muted);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
}

.main-nav a:hover,
.main-nav li.active a {
    color: var(--primary-blue);
}

/* Hero Section */
.hero-section {
    padding: 8rem 0 6rem 0;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
}

.hero-logo-wrapper {
    margin-bottom: 2.2rem;
    display: flex;
    justify-content: flex-start;
}

.hero-logo-img {
    height: 52px;
    width: auto;
    display: block;
}

.hero-title {
    font-size: 3.8rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
    color: var(--text-dark-main);
}

.hero-title span {
    background: linear-gradient(135deg, var(--primary-brown) 30%, var(--primary-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    color: var(--text-dark-muted);
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
}

.hero-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
}

.hero-image-wrapper::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 80%;
    background: var(--primary-blue-glow);
    filter: blur(85px);
    border-radius: 50%;
    z-index: -1;
    top: 10%;
}

.hero-vector {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 25px rgba(140, 79, 43, 0.15));
    animation: float 6s ease-in-out infinite;
}

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

/* Sections Global */
.section {
    padding: 6rem 0;
}

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

.section-tag {
    color: var(--primary-brown);
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 2.6rem;
    margin-bottom: 1rem;
    color: var(--text-dark-main);
}

/* Team Section */
.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.member-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.member-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, var(--bg-light-wave-1) 100%);
    margin-bottom: 1.5rem;
    border: 3px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary-blue);
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.1);
}

.member-name {
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
}

.member-role {
    color: var(--primary-brown);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.member-bio {
    font-size: 0.95rem;
    color: var(--text-dark-muted);
}

/* Services / Features Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
}

.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-brown);
}

.service-card.blue::before {
    background: var(--primary-blue);
}

.service-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(140, 79, 43, 0.05);
    color: var(--primary-brown);
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.service-card.blue .service-badge {
    background: rgba(2, 132, 199, 0.08);
    color: var(--primary-blue);
}

.service-title {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.service-desc {
    margin-bottom: 1.5rem;
}

.service-price {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 850;
    color: var(--text-dark-main);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.service-price span {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-dark-muted);
}

.service-features {
    list-style: none;
    margin-bottom: 2rem;
}

.service-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
    color: var(--text-dark-muted);
}

.service-features i {
    color: var(--primary-blue);
    font-size: 0.95rem;
}

.service-card.blue .service-features i {
    color: var(--primary-brown);
}

/* Chatbox Section */
.chatbot-section {
    background: rgba(255, 255, 255, 0.35);
    border-top: 1px solid var(--border-glass);
    border-bottom: 1px solid var(--border-glass);
}

.chatbox-container {
    max-width: 800px;
    margin: 0 auto;
}

.chatbox-widget {
    background: var(--bg-glass-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 500px;
    box-shadow: 0 15px 35px -10px rgba(140, 79, 43, 0.1);
}

.chat-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-header-info strong {
    color: #0f172a !important;
}

.chat-header-info span {
    color: #475569 !important;
}

.chat-header i {
    color: #475569 !important;
}

.chat-status-indicator {
    width: 10px;
    height: 10px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(248, 250, 252, 0.5);
}

.chat-bubble {
    max-width: 80%;
    padding: 0.85rem 1.25rem;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.chat-bubble.assistant {
    background: #ffffff !important;
    color: #0f172a !important;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.chat-bubble.user {
    background: var(--primary-brown);
    color: var(--text-white);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-input-area {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    gap: 1rem;
    border-top: 1px solid var(--border-glass);
}

.chat-input-box {
    flex: 1;
    background: #f1f5f9;
    border: 1px solid var(--border-glass);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    color: #0f172a !important;
    font-family: var(--font-body);
    outline: none;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.chat-input-box:focus {
    border-color: var(--primary-blue);
    background: #ffffff !important;
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.15);
}

.chat-send-button {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-brown) !important;
    color: var(--text-white) !important;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.chat-send-button:hover {
    background: #0271a8;
    transform: scale(1.05);
}

/* Typing Indicator */
.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
    height: 10px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-dark-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Contact Form Section */
.contact-section {
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(140, 79, 43, 0.05) 0%, transparent 60%);
}

.contact-card {
    max-width: 650px;
    margin: 0 auto;
}

.sam-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark-main);
}

.form-control {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.85rem 1.2rem;
    color: var(--text-dark-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

.form-control:focus {
    border-color: var(--primary-brown);
    background: var(--text-white);
    box-shadow: 0 0 10px rgba(140, 79, 43, 0.12);
}

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

.form-checkbox input {
    margin-top: 0.25rem;
    cursor: pointer;
}

.form-checkbox label {
    font-size: 0.85rem;
    color: var(--text-dark-muted);
    line-height: 1.4;
}

.form-status-msg {
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
    align-items: center;
    gap: 0.75rem;
}

.form-status-msg.success {
    display: flex;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.form-status-msg.error {
    display: flex;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

/* Footer Section */
.site-footer {
    background: #0d121f;
    padding: 4rem 0 2rem 0;
    border-top: 1px solid var(--border-glass);
    font-size: 0.9rem;
    color: #94a3b8;
}

.site-footer h5 {
    color: var(--text-white);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-brand img {
    height: 35px;
    margin-bottom: 1rem;
}

.footer-brand p {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    color: #94a3b8;
}

.footer-links h5 {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    color: var(--text-white);
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: #94a3b8;
}

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

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 2rem;
    font-size: 0.85rem;
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
        padding: 6rem 0 4rem 0;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .hero-logo-wrapper {
        justify-content: center;
    }
    
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Expandable partner card styling - Dark Glass when closed, White when active */
.member-expandable-card {
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.25) !important;
    transition: var(--transition-smooth);
}

.member-expandable-card:hover {
    border-color: rgba(56, 189, 248, 0.35) !important;
    box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.35) !important;
    transform: translateY(-2px);
}

.member-expandable-card .member-name {
    color: #ffffff !important;
}

.member-expandable-card .member-role {
    color: #cbd5e1 !important; /* Silver-grey for high readability on dark card */
    font-weight: 500;
}

.member-expandable-card .member-avatar {
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.member-expandable-card .expand-icon-wrapper {
    color: rgba(255, 255, 255, 0.5) !important;
    transition: transform 0.4s ease, color 0.4s ease;
}

/* Active State (Clicked Card) */
.member-expandable-card.active {
    border-color: var(--primary-blue) !important;
    box-shadow: 0 15px 35px -5px rgba(56, 189, 248, 0.25) !important;
    background: #ffffff !important;
}

.member-expandable-card.active .member-name {
    color: #0f172a !important;
}

.member-expandable-card.active .member-role {
    color: #8c4f2b !important;
    font-weight: 600;
}

.member-expandable-card.active .member-bio-expand-content div {
    color: #334155 !important;
}

.member-expandable-card.active .member-avatar {
    border-color: rgba(2, 132, 199, 0.15) !important;
    color: #0284c7 !important;
    background: rgba(2, 132, 199, 0.04) !important;
}

.member-expandable-card.active .expand-icon-wrapper {
    color: var(--primary-blue) !important;
}
