/* =========================
   CSS VARIABLES (THEMES)
========================= */
:root {
    --bg: #ffffff;
    --bg-alt: #f4f6f8 ;
    --text: #1e1e1e;
    --muted: #6b7280;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --border: #e5e7eb;
}

html[data-theme="dark"] {
    --bg: #0f172a;
    --bg-alt: #020617;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --border: #1e293b;
}

/* =========================
   BASE
========================= */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* =========================
   HEADER
========================= */
.topbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 64px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 1000;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.brand img {
    height: 28px;
    width: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}


.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.lang-switcher button,
#themeToggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.85rem;
}

.lang-switcher button.active {
    background: var(--primary);
    color: #fff;
}

/* =========================
   HERO
========================= */
.hero {
    position: relative;
    min-height: 100vh;
    background: url("/img/hero.jpg") center/cover no-repeat;
    display: flex;
    align-items: center;
    padding-top: 64px;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.65) 0%,
            rgba(0, 0, 0, 0.55) 40%,
            rgba(0, 0, 0, 0.75) 100%
        );
}


.hero-content {
    position: relative;
    max-width: 800px;
    padding: 2rem;
    color: #fff;
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
}

.description {
    margin: 1.5rem 0;
}

/* =========================
   SECTIONS
========================= */
.section {
    padding: 5rem 1.5rem;
}

.section.alt {
    background: var(--bg-alt);
}
.section strong {
    color: var(--primary);
    font-weight: 600;
}
.section h2 {
    position: relative;
    margin-bottom: 2rem;
    font-weight: 600;
}

.section h2::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    background: var(--primary);
    margin-top: 0.75rem;
    border-radius: 2px;
    opacity: 0.8;
}

.section.contact {
  background: var(--section-alt-bg);
}
.contact-card {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 2.5rem;
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}
.contact-card h2 {
  margin-bottom: 0.5rem;
}

.contact-intro {
  margin-bottom: 2rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

#contact-form input[type="text"],
#contact-form input[type="email"],
#contact-form input[type="tel"],
#contact-form input:not([type]) {
  background-color: var(--bg-alt);
}
#contact-form textarea {
  background-color: var(--bg-alt);
}

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

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-color);
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-color);
  font-size: 0.95rem;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
}
.captcha-group .captcha-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.captcha-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

#refresh-captcha {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.7;
}

#refresh-captcha:hover {
    opacity: 1;
}

#contact-captcha-question {
  font-weight: 500;
  background: var(--badge-bg);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
}
.form-actions {
  margin-top: 2rem;
  text-align: right;
}
.form-feedback {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.container {
    max-width: 1100px;
    margin: auto;
}

.features-list {
    list-style: none;
    padding-left: 0;
}

.features-list li {
    position: relative;
    padding-left: 1.4em;
}

.features-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-size: 1.2em;
    line-height: 1;
}

/* === Liste uniformate === */
.content-list {
    list-style: none;
    padding-left: 0;
    margin: 1.2rem 0;
}

.content-list li {
    position: relative;
    padding-left: 1.6em;
    margin-bottom: 0.6em;
    line-height: 1.5;
}

.content-list li::before {
    content: "●";
    position: absolute;
    left: 0;
    top: 0.1em;
    font-size: 0.6em;
    color: var(--accent-color);
}



.steps-list li {
    margin-bottom: 0.6rem;
}

.muted {
    color: var(--muted);
}

/* =========================
   LAB
========================= */
.lab-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.lab-image img {
    width: 100%;
    border-radius: 14px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.25),
        0 8px 16px rgba(0, 0, 0, 0.15);
    transform: perspective(1200px) rotateX(3deg) rotateY(-3deg);
    transition:
        transform 0.45s ease,
        box-shadow 0.45s ease;
}

.lab-image img:hover {
    transform: perspective(1200px) rotateX(0deg) rotateY(0deg) scale(1.02);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.35),
        0 12px 24px rgba(0, 0, 0, 0.2);
}



/* =========================
   BUTTONS
========================= */
.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 0.75rem 1.4rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    border: 1px solid var(--primary);
    color: var(--primary);
}

/* =========================
   FOOTER
========================= */
footer {
    padding: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--muted);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .lab-grid {
        grid-template-columns: 1fr;
    }
}
.section:not(.hero)::after {
    content: "";
    display: block;
    width: 60px;
    height: 2px;
    background: var(--primary);
    margin: 3rem auto 0;
    opacity: 0.3;
}
@media (max-width: 600px) {
  .contact-card {
    padding: 2rem 1.5rem;
  }
}

/* Scroll fluido */
html {
    scroll-behavior: smooth;
}

/* Animazione highlight sul messaggio */
.alert-highlight {
    animation: highlightPulse 2s ease-in-out;
}

@keyframes highlightPulse {
    0% { 
        transform: scale(1); 
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    25% { 
        transform: scale(1.02); 
        box-shadow: 0 0 20px 5px rgba(40, 167, 69, 0.5);
    }
    50% { 
        transform: scale(1); 
        box-shadow: 0 0 10px 2px rgba(40, 167, 69, 0.3);
    }
    100% { 
        transform: scale(1); 
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* Rendi il messaggio più grande e visibile */
.alert {
    font-size: 1.1rem;
    font-weight: 500;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.alert-success {
    background-color: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border: 2px solid #dc3545;
    color: #721c24;
}
