/* =================================
   STILI GENERALI E RESET
   ================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #333;
    background: #f9f9f9;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; }
p { margin: 0 0 16px 0; }
a { color: #667eea; text-decoration: none; }
small { font-size: 12px; color: #999; }

/* ========== CONTAINER ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== MAIN CONTENT ========== */
.main-content { min-height: calc(100vh - 200px); }

/* =================================
   PULSANTI (BTN)
   ================================= */
.btn {
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}
.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    color: white;
}

.btn-secondary { background: transparent; color: #007bff; border: 1px solid #007bff; }
.btn-secondary:hover { background-color: #007bff; color: #fff; }

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}
.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-lg { padding: 16px 32px; font-size: 18px; }
.btn-sm { padding: 8px 16px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; display: block; text-align: center; }

/* =================================
   SEZIONE HERO (Mantenuta la tua grafica)
   ================================= */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Ripristinato gradiente originale */
    color: white;
    padding: 100px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 40px;
}

.hero-title {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 20px;
    line-height: 1.2;
    color: white; /* Assicura che sia bianco */
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hero-subtitle {
    font-size: 20px;
    margin-bottom: 40px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Highlight testo */
.highlight {
    background: linear-gradient(to right, #ffd89b, #19547b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =================================
   GENERATORE QR CODE (Stili Home)
   ================================= */
#generator-section { padding-bottom: 40px; }
#qr-generator {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.generator-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: flex-start;
}

/* Tabs */
.tabs { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 2px solid #ddd; }
.tab-button {
    background: none; border: none; padding: 10px 20px; cursor: pointer;
    font-size: 15px; font-weight: 600; color: #888; border-radius: 8px; transition: all 0.3s;
}
.tab-button.active { background-color: #eef2ff; color: #667eea; }
.tab-content { display: none; animation: fadeIn 0.3s; }
.tab-content.active { display: block; }

/* Form Elements */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #444; }
.form-group input, .form-group select {
    width: 100%; padding: 12px; border: 2px solid #eee; border-radius: 8px; font-size: 15px; transition: 0.3s;
}
.form-group input:focus, .form-group select:focus { border-color: #667eea; outline: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

/* Visual Selectors (Radio buttons come card) */
.visual-selector { display: flex; gap: 15px; flex-wrap: wrap; }
.selector-option { cursor: pointer; position: relative; }
.selector-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.selector-box {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 90px; height: 90px; background: #fff; border: 2px solid #eee;
    border-radius: 10px; font-size: 12px; font-weight: 600; color: #666;
    transition: all 0.3s ease; gap: 8px;
}
.selector-option input:checked + .selector-box {
    border-color: #667eea; background-color: #f4f6ff; color: #667eea;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.2); transform: translateY(-2px);
}

/* Preview Area */
.generator-preview {
    width: 100%; position: sticky; top: 100px; background: white; padding: 20px;
    border-radius: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.15); text-align: center; border: 1px solid #eee;
}
.preview-image-container {
    min-height: 340px; width: 100%; max-width: 340px; margin: 0 auto 20px;
    display: flex; align-items: center; justify-content: center;
    background-color: #f8f9fa; border-radius: 10px; overflow: hidden; border: 1px dashed #ccc;
}
.preview-image-container img, #qr-canvas svg { max-width: 100%; height: auto; display: block; }

/* =================================
   SEZIONE FEATURES (VANTAGGI)
   ================================= */
.advantages-section { padding: 80px 20px; background: #f8f9fa; }
.section-title { font-size: 36px; font-weight: 700; text-align: center; margin-bottom: 15px; color: #333; }
.section-subtitle { text-align: center; color: #666; margin-bottom: 60px; font-size: 18px; }

.advantages-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px; max-width: 1200px; margin: 0 auto;
}
.advantage-card {
    background: white; padding: 40px 30px; border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05); transition: transform 0.3s, box-shadow 0.3s;
    text-align: center; border: 1px solid #eee;
}
.advantage-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1); border-color: #667eea; }
.card-icon {
    font-size: 40px; color: white; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 25px; box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* =================================
   FAQ SECTION
   ================================= */
.faq-section { padding: 80px 20px; background: #fff; }
.faq-container { max-width: 800px; margin: 0 auto; }
.faq-item { margin-bottom: 15px; background: white; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); overflow: hidden; border: 1px solid #eee; }
.faq-question {
    width: 100%; padding: 20px 25px; background: white; border: none; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 17px; font-weight: 600; color: #333; text-align: left;
}
.faq-question:hover { background-color: #fcfcfc; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; background: #fff; }
.faq-answer.show { max-height: 300px; border-top: 1px solid #f1f1f1; }
.faq-answer p { padding: 20px 25px; color: #666; margin: 0; line-height: 1.6; }

/* =================================
   FOOTER
   ================================= */
.main-footer, .footer {
    background: #333; color: white; text-align: center;
    padding: 40px 20px; margin-top: 60px; border-top: none;
}

/* =================================
   ALERTS E MESSAGGI
   ================================= */
.alert { padding: 15px 20px; border-radius: 8px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; font-weight: 500; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert-info { background: #cff4fc; color: #055160; border: 1px solid #b6effb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* =================================
   RESPONSIVE UTILS
   ================================= */
@media (max-width: 900px) {
    .generator-layout, .generator-wrapper { grid-template-columns: 1fr; }
    .generator-wrapper { flex-direction: column-reverse; display: flex; }
    .preview-column, .generator-preview { position: static; margin-bottom: 30px; }
    .hero-title { font-size: 36px; }
    .hero { padding: 60px 20px; }
}

@media (max-width: 768px) {
    .btn { width: 100%; text-align: center; }
    .hero-buttons { flex-direction: column; }
}

/* Box "Auth Required" (Guest) */
.auth-required-box {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 30px; border: 2px dashed #007bff; border-radius: 12px; background-color: #f8f9fa;
}
@media (min-width: 576px) {
    .auth-required-box { flex-direction: row; flex-wrap: wrap; justify-content: center; }
    .auth-required-box .btn { width: auto; margin: 0 10px; }
}