/* ====================================
   DocumentiFacili.it â€” Stile
   ==================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', -apple-system, sans-serif; color: #1a1a2e; background: #f8f9fc; line-height: 1.65; font-size: 16px; }
a { color: #2b5ea7; text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid #e5e7ef; position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: #1a1a2e; }
.logo:hover { text-decoration: none; }
.logo-icon { font-size: 24px; }
.main-nav { display: flex; gap: 28px; }
.main-nav a { color: #5a5d73; font-size: 15px; font-weight: 500; padding: 4px 0; border-bottom: 2px solid transparent; transition: all 0.2s; }
.main-nav a:hover, .main-nav a.active { color: #1a1a2e; border-bottom-color: #2b5ea7; text-decoration: none; }
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; padding: 6px; }
.mobile-menu-btn span { display: block; width: 22px; height: 2px; background: #1a1a2e; }

/* Hero */
.hero { background: linear-gradient(135deg, #1a2a4a 0%, #2b5ea7 100%); color: #fff; padding: 70px 20px; text-align: center; }
.hero h1 { font-family: 'DM Serif Display', Georgia, serif; font-size: 42px; font-weight: 400; line-height: 1.2; margin-bottom: 16px; }
.hero .highlight { color: #7db8ff; }
.hero-sub { font-size: 18px; color: rgba(255,255,255,0.8); max-width: 600px; margin: 0 auto 28px; }
.hero-badges { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-badges .badge { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 8px 16px; border-radius: 8px; font-size: 14px; }

/* Sections */
.section { padding: 60px 0; }
.section-title { font-family: 'DM Serif Display', Georgia, serif; font-size: 30px; font-weight: 400; text-align: center; margin-bottom: 8px; }
.section-sub { text-align: center; color: #5a5d73; font-size: 16px; margin-bottom: 36px; }

/* Categories */
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.category-card { background: #fff; border: 1px solid #e5e7ef; border-radius: 12px; padding: 24px; transition: all 0.2s; position: relative; display: block; color: inherit; }
.category-card:hover { border-color: #2b5ea7; box-shadow: 0 4px 20px rgba(43,94,167,0.1); text-decoration: none; transform: translateY(-2px); }
.category-icon { font-size: 32px; display: block; margin-bottom: 12px; }
.category-card h3 { font-size: 18px; margin-bottom: 6px; }
.category-card p { font-size: 14px; color: #5a5d73; }
.card-arrow { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 20px; color: #c0c3d1; transition: all 0.2s; }
.category-card:hover .card-arrow { color: #2b5ea7; right: 16px; }
.category-icon-lg { font-size: 48px; }
.category-header { text-align: center; margin-bottom: 36px; }
.category-header h1 { font-family: 'DM Serif Display', Georgia, serif; font-size: 32px; margin: 12px 0 8px; }
.category-header p { color: #5a5d73; }

/* Packages */
.packages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.package-card { background: #fff; border: 1px solid #e5e7ef; border-radius: 12px; padding: 24px; transition: all 0.2s; display: flex; flex-direction: column; color: inherit; }
.package-card:hover { border-color: #2b5ea7; box-shadow: 0 4px 20px rgba(43,94,167,0.1); text-decoration: none; }
.package-card h3 { font-size: 17px; margin-bottom: 8px; }
.package-card p { font-size: 14px; color: #5a5d73; flex: 1; }
.package-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid #f0f1f5; }
.package-price { font-weight: 700; color: #2b5ea7; }
.package-cta { color: #2b5ea7; font-size: 14px; font-weight: 500; }

/* Popular */
.popular-section { background: #fff; }
.popular-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.popular-card { border: 1px solid #e5e7ef; border-radius: 12px; padding: 20px; transition: all 0.2s; display: block; color: inherit; }
.popular-card:hover { border-color: #2b5ea7; box-shadow: 0 4px 16px rgba(43,94,167,0.08); text-decoration: none; }
.popular-category { font-size: 12px; color: #2b5ea7; font-weight: 600; text-transform: uppercase; }
.popular-card h3 { font-size: 16px; margin: 8px 0 6px; }
.popular-card p { font-size: 13px; color: #5a5d73; }
.popular-price { display: inline-block; margin-top: 10px; font-weight: 700; color: #2b5ea7; font-size: 14px; }

/* Steps */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step-card { text-align: center; padding: 24px; }
.step-num { width: 48px; height: 48px; border-radius: 50%; background: #2b5ea7; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; margin: 0 auto 16px; }
.step-card h3 { font-size: 17px; margin-bottom: 8px; }
.step-card p { font-size: 14px; color: #5a5d73; }
.steps-vertical .step-card-lg { display: flex; gap: 24px; align-items: flex-start; padding: 24px; background: #fff; border-radius: 12px; border: 1px solid #e5e7ef; margin-bottom: 16px; }
.steps-vertical .step-card-lg .step-num { flex-shrink: 0; margin: 0; }  /* resta un cerchio anche con testi lunghi */
.steps-vertical .step-card-lg h3 { font-size: 18px; margin-bottom: 8px; }
.steps-vertical .step-card-lg p { font-size: 15px; color: #5a5d73; }

/* CTA */
.cta-section { padding: 40px 0; }
.cta-box { background: linear-gradient(135deg, #1a2a4a, #2b5ea7); color: #fff; border-radius: 16px; padding: 48px; text-align: center; }
.cta-box h2 { font-family: 'DM Serif Display', Georgia, serif; font-size: 28px; margin-bottom: 12px; font-weight: 400; }
.cta-box p { color: rgba(255,255,255,0.8); margin-bottom: 24px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 24px; border-radius: 8px; font-size: 15px; font-weight: 600; border: none; cursor: pointer; transition: all 0.2s; text-decoration: none; font-family: inherit; }
.btn:hover { text-decoration: none; }
.btn-primary { background: #2b5ea7; color: #fff; }
.btn-primary:hover { background: #234d8c; }
.btn-secondary { background: #fff; color: #1a1a2e; border: 1px solid #e5e7ef; }
.btn-secondary:hover { background: #f0f1f5; }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* Document Page */
.document-layout { display: grid; grid-template-columns: 1fr 420px; gap: 32px; align-items: start; }
.document-guide h1 { font-family: 'DM Serif Display', Georgia, serif; font-size: 32px; margin-bottom: 12px; font-weight: 400; }
.price-badge { display: inline-block; padding: 4px 14px; border-radius: 20px; font-size: 14px; font-weight: 600; margin-bottom: 20px; background: #e8f4e8; color: #2d7a2d; }
.guide-content { font-size: 15px; line-height: 1.75; color: #3a3d50; margin-bottom: 24px; }
.guide-content strong { color: #1a1a2e; }
.disclaimer-box { background: #fff8e6; border: 1px solid #ffe0a0; border-radius: 8px; padding: 14px 18px; font-size: 13px; color: #7a6520; }
.info-box { background: #fff8e6; border: 1px solid #ffe0a0; border-radius: 12px; padding: 24px; }
.info-box h3 { margin-bottom: 8px; }
.info-box p { font-size: 15px; color: #5a5d50; }

/* Form */
.form-card, .preview-card { background: #fff; border: 1px solid #e5e7ef; border-radius: 12px; padding: 28px; position: sticky; top: 80px; }
.form-card h2, .preview-card h2 { font-size: 18px; margin-bottom: 6px; }
.form-hint { font-size: 13px; color: #5a5d73; margin-bottom: 20px; }
.document-form .form-group { margin-bottom: 18px; }
.document-form label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 5px; color: #1a1a2e; }
.document-form .required { color: #e53935; }
.document-form input, .document-form select, .document-form textarea { width: 100%; padding: 10px 14px; border: 1px solid #d5d8e3; border-radius: 8px; font-size: 14px; font-family: inherit; background: #f8f9fc; color: #1a1a2e; }
.document-form input:focus, .document-form select:focus, .document-form textarea:focus { outline: none; border-color: #2b5ea7; background: #fff; box-shadow: 0 0 0 3px rgba(43,94,167,0.1); }
.document-form textarea { resize: vertical; min-height: 80px; }

/* Preview */
.preview-toolbar { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.preview-content { background: #fafbfd; border: 1px solid #e5e7ef; border-radius: 8px; padding: 20px; max-height: 500px; overflow-y: auto; margin-bottom: 16px; }
.preview-content pre { white-space: pre-wrap; word-wrap: break-word; font-family: 'DM Sans', sans-serif; font-size: 14px; line-height: 1.7; }
.preview-edit textarea { width: 100%; min-height: 300px; padding: 16px; font-family: 'DM Sans', sans-serif; font-size: 14px; border: 1px solid #d5d8e3; border-radius: 8px; margin-bottom: 10px; }
.preview-actions { display: flex; flex-direction: column; gap: 10px; }

/* Loading */
.loading-overlay { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px; }
.loading-spinner { width: 40px; height: 40px; border: 3px solid #e5e7ef; border-top-color: #2b5ea7; border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Blog */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.blog-card { background: #fff; border: 1px solid #e5e7ef; border-radius: 12px; padding: 24px; transition: all 0.2s; display: block; color: inherit; }
.blog-card:hover { border-color: #2b5ea7; text-decoration: none; }
.blog-category, .article-category { font-size: 12px; color: #2b5ea7; font-weight: 600; text-transform: uppercase; }
.blog-card h3 { font-size: 17px; margin: 8px 0; }
.blog-card p { font-size: 14px; color: #5a5d73; }
.blog-date { font-size: 13px; color: #9a9db0; margin-top: 10px; display: block; }
.article { max-width: 760px; }
.article-header { margin-bottom: 32px; }
.article-header h1 { font-family: 'DM Serif Display', Georgia, serif; font-size: 34px; margin: 8px 0 12px; font-weight: 400; }
.article-date { font-size: 14px; color: #9a9db0; }
.article-content { font-size: 16px; line-height: 1.8; }
.article-content h2 { font-size: 22px; margin: 32px 0 12px; }
.article-content p { margin-bottom: 16px; }
.article-content ul, .article-content ol { margin: 16px 0; padding-left: 24px; }
.article-content li { margin-bottom: 6px; }

/* Legal */
.legal-page h1 { font-family: 'DM Serif Display', Georgia, serif; font-size: 32px; margin-bottom: 8px; font-weight: 400; }
.legal-updated { color: #5a5d73; font-size: 14px; margin-bottom: 32px; }
.legal-content h2 { font-size: 18px; margin: 28px 0 10px; }
.legal-content p { margin-bottom: 14px; font-size: 15px; color: #3a3d50; }

/* Breadcrumb */
.breadcrumb { font-size: 14px; color: #5a5d73; margin-bottom: 24px; }
.breadcrumb a { color: #2b5ea7; }
.breadcrumb span { margin: 0 6px; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: #5a5d73; }
.empty-state p { margin-bottom: 20px; }

/* Footer */
.site-footer { background: #1a1a2e; color: rgba(255,255,255,0.7); padding: 48px 0 0; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.footer-desc { font-size: 14px; line-height: 1.6; }
.footer-col a { display: block; color: rgba(255,255,255,0.6); font-size: 14px; padding: 4px 0; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-disclaimer { border-top: 1px solid rgba(255,255,255,0.1); padding: 20px 0; }
.footer-disclaimer p { font-size: 12px; color: rgba(255,255,255,0.4); line-height: 1.6; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 16px 0; }
.footer-bottom p { font-size: 13px; color: rgba(255,255,255,0.3); text-align: center; }

/* Article cover image */
.article-cover { margin-bottom: 28px; border-radius: 12px; overflow: hidden; max-height: 420px; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Article CTA */
.article-cta { margin-top: 48px; padding: 28px 32px; background: linear-gradient(135deg, #1a2a4a, #2b5ea7); border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.article-cta p { color: rgba(255,255,255,0.9); font-size: 16px; margin: 0; }

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 28px; }
  .hero { padding: 48px 20px; }
  .main-nav { display: none; }
  .mobile-menu-btn { display: flex; }
  /* Menu mobile aperto (stessi stili che prima venivano scritti dal JavaScript) */
  .main-nav.is-open {
    display: flex; flex-direction: column; gap: 12px;
    position: absolute; top: 64px; left: 0; right: 0;
    background: #fff; padding: 16px 20px;
    border-bottom: 1px solid #e5e7ef; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
  .document-layout { grid-template-columns: 1fr; }
  .form-card, .preview-card { position: static; }
  .steps-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════
   GENERATORE DOCUMENTI
   ══════════════════════════════════════════════════════════════════ */

.gen-section {
  position: relative;
  padding: 60px 0;
  background: #0d1117;
  overflow: hidden;
}

/* Doppio layer per cross-fade fluido */
.gen-bg { position: absolute; inset: 0; z-index: 0; }
.gen-bg-layer {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  filter: saturate(0.6) brightness(0.35);
}
.gen-bg-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    135deg,
    rgba(13,17,23,0.93) 0%,
    rgba(13,17,23,0.78) 50%,
    rgba(13,17,23,0.93) 100%
  );
}

.gen-container { position: relative; z-index: 1; max-width: 900px; }

/* Header motore */
.gen-engine-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 36px; padding-bottom: 28px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-wrap: wrap;
}
.gen-engine-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #1e3a5f, #2b5ea7);
  border: 1px solid rgba(43,94,167,0.45);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #7db8ff; flex-shrink: 0;
  box-shadow: 0 0 24px rgba(43,94,167,0.25);
}
.gen-engine-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 26px; font-weight: 400;
  color: #fff; margin-bottom: 3px; letter-spacing: -0.3px;
}
.gen-engine-sub {
  font-size: 12px; color: rgba(255,255,255,0.38);
  letter-spacing: 0.8px; text-transform: uppercase;
}
.gen-engine-badge {
  margin-left: auto;
  background: rgba(43,94,167,0.18);
  border: 1px solid rgba(43,94,167,0.35);
  color: #7db8ff; font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 5px 12px; border-radius: 20px;
}

/* Steps row */
.gen-steps-row {
  display: flex; align-items: stretch; gap: 0;
  margin-bottom: 20px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px; overflow: hidden;
}
.gen-step-block {
  flex: 1; display: flex; align-items: flex-start; gap: 14px;
  padding: 22px 24px;
  transition: opacity 0.3s ease;
}
.gen-step-block:first-child { border-right: 1px solid rgba(255,255,255,0.07); }
.gen-step-divider {
  display: flex; align-items: center; padding: 0 2px;
  color: rgba(255,255,255,0.15); font-size: 22px;
  flex-shrink: 0; align-self: center;
}
.gen-step-num {
  font-size: 26px; font-weight: 800;
  color: rgba(43,94,167,0.45); line-height: 1;
  flex-shrink: 0; letter-spacing: -1px; padding-top: 3px;
}
.gen-step-content { flex: 1; }
.gen-step-label {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: rgba(255,255,255,0.35); margin-bottom: 8px;
}
.gen-select {
  width: 100%; padding: 11px 40px 11px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; color: #fff; font-size: 15px;
  font-family: inherit; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.35)' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.gen-select:focus {
  outline: none; border-color: rgba(43,94,167,0.6);
  background-color: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px rgba(43,94,167,0.14);
}
.gen-select option { background: #1a1f2e; color: #fff; }

/* Sezione campi */
.gen-fields-section {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px; padding: 22px 24px; margin-top: 4px;
}
.gen-fields-header {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 18px; padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.gen-fields-hint {
  font-size: 13px; color: rgba(255,255,255,0.4);
  margin-top: 4px; line-height: 1.5;
}
.gen-form-grid { display: flex; flex-direction: column; }
.gen-field-group { margin-bottom: 14px; }
.gen-field-label {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: rgba(255,255,255,0.45); margin-bottom: 6px;
}
.gen-field-label .req { color: #ff6b6b; }
.gen-field-input {
  width: 100%; padding: 11px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px; color: #fff; font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
}
.gen-field-input:focus {
  outline: none; border-color: rgba(43,94,167,0.65);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px rgba(43,94,167,0.13);
}
.gen-field-input::placeholder { color: rgba(255,255,255,0.22); }
textarea.gen-field-input { resize: vertical; min-height: 80px; }
.gen-field-input option { background: #1a1f2e; }
.gen-no-fields { font-size: 13px; color: rgba(255,255,255,0.35); margin-bottom: 14px; }

.gen-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(43,94,167,0.85);
  margin: 18px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.gen-section-label:first-child {
  margin-top: 0;
}

/* Bottone genera */
.gen-generate-btn {
  background: linear-gradient(135deg, #1e3a5f 0%, #2b5ea7 100%);
  color: #fff;
  border: 1px solid rgba(43,94,167,0.5);
  padding: 15px 32px; font-size: 16px; font-weight: 600;
  border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(43,94,167,0.28);
  text-decoration: none; margin-top: 10px;
}
.gen-generate-btn:hover {
  background: linear-gradient(135deg, #243f6a 0%, #3268b8 100%);
  box-shadow: 0 6px 28px rgba(43,94,167,0.48);
  transform: translateY(-1px);
  text-decoration: none; color: #fff;
}
.gen-btn-icon { font-size: 18px; }

.gen-secondary-btn {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.75);
  border: 1px solid rgba(255,255,255,0.11);
  padding: 15px 24px; font-size: 15px; border-radius: 10px;
  cursor: pointer; transition: all 0.2s; margin-top: 10px;
}
.gen-secondary-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* Loading animato */
.gen-loading-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 56px; gap: 20px;
}
.gen-loading-state p { color: rgba(255,255,255,0.45); font-size: 14px; }
.gen-loading-bars { display: flex; gap: 5px; align-items: flex-end; height: 36px; }
.gen-loading-bars span {
  display: block; width: 5px; border-radius: 3px; background: #2b5ea7;
  animation: genBar 1s ease-in-out infinite;
}
.gen-loading-bars span:nth-child(1) { animation-delay: 0s;    height: 16px; }
.gen-loading-bars span:nth-child(2) { animation-delay: 0.15s; height: 26px; }
.gen-loading-bars span:nth-child(3) { animation-delay: 0.3s;  height: 36px; }
.gen-loading-bars span:nth-child(4) { animation-delay: 0.45s; height: 26px; }
.gen-loading-bars span:nth-child(5) { animation-delay: 0.6s;  height: 16px; }
@keyframes genBar {
  0%, 100% { opacity: 0.25; transform: scaleY(0.55); }
  50%       { opacity: 1;   transform: scaleY(1); }
}

/* Risultato */
.gen-result-state { color: #fff; }
.gen-result-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}
.gen-result-header h3 { font-size: 18px; color: #fff; }
.gen-reset-btn {
  background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.65);
  border: 1px solid rgba(255,255,255,0.1); font-size: 13px;
}
.gen-reset-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* Preview documento */
.gen-doc-wrap { position: relative; margin-bottom: 20px; }
.gen-doc-content { border-radius: 4px; overflow: hidden; border: none; }
.gen-doc-visible {
  font-family: 'Helvetica', 'Arial', sans-serif; font-size: 12.5px; line-height: 1.7;
  background: #ffffff;
  padding: 56px 64px; margin: 16px auto 0; color: #1a1a1a;
  border: none;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18), 0 1px 3px rgba(0,0,0,0.1);
  max-width: 660px;
  border-radius: 3px;
}
.gen-doc-blurred {
  font-family: 'Helvetica', 'Arial', sans-serif; font-size: 12.5px; line-height: 1.7;
  background: #ffffff;
  padding: 56px 64px; margin: 0 auto; color: #1a1a1a;
  max-width: 660px;
  filter: blur(5px); user-select: none; pointer-events: none;
  max-height: 50px; overflow: hidden;
  border-radius: 0 0 3px 3px;
}

/* Anteprima a pagamento: paragrafi nascosti (testo finto, sfocato) */
.doc-letter-filler { filter: blur(4px); user-select: none; pointer-events: none; }

/* Layout lettera nell'anteprima */
.doc-letter-mittente { margin-bottom: 24px; font-size: 11px; line-height: 1.65; color: #1a1a1a; }
.doc-letter-mittente strong { font-size: 12px; }
.doc-letter-dest { text-align: right; margin-bottom: 32px; font-size: 11px; line-height: 1.65; color: #1a1a1a; }
.doc-letter-dest strong { font-size: 12px; }
.doc-letter-luogo { font-size: 11px; margin-bottom: 24px; color: #1a1a1a; }
.doc-letter-oggetto { margin-bottom: 28px; font-size: 12px; color: #1a1a1a; }
.doc-letter-oggetto strong { font-weight: 700; }
.doc-letter-corpo { font-size: 12px; line-height: 1.75; }
.doc-letter-corpo p { margin: 0 0 10px 0; text-align: justify; }
.doc-letter-firma { text-align: right; font-weight: 700; margin-top: 36px; font-size: 12px; }  /* come nel PDF */

/* Paywall */
.gen-paywall {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to bottom,
    rgba(13,17,23,0) 0%,
    rgba(13,17,23,0.88) 30%,
    rgba(13,17,23,0.99) 60%
  );
  display: flex; align-items: flex-end; justify-content: center;
  padding: 28px 20px; min-height: 220px;
  border-radius: 0 0 10px 10px;
}
.gen-paywall-box { text-align: center; max-width: 380px; }
.gen-paywall-icon { font-size: 32px; margin-bottom: 10px; }
.gen-paywall-box h4 { font-size: 18px; color: #fff; margin-bottom: 8px; }
.gen-paywall-box p { font-size: 13px; color: rgba(255,255,255,0.5); margin-bottom: 16px; line-height: 1.6; }
.gen-paywall-price { font-size: 32px; font-weight: 800; color: #7db8ff; margin-bottom: 18px; letter-spacing: -1px; }

.gen-free-actions { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.gen-disclaimer { font-size: 12px; color: rgba(255,255,255,0.28); }

/* "I più utilizzati" senza prezzo */
.popular-cta {
  display: inline-block; margin-top: 12px;
  font-size: 13px; font-weight: 600; color: #2b5ea7;
}
.popular-card { transition: all 0.2s; }
.popular-card:hover { border-color: #2b5ea7; box-shadow: 0 4px 16px rgba(43,94,167,0.1); transform: translateY(-2px); }

/* Blog con foto */
.blog-page-header { text-align: center; margin-bottom: 28px; }
.blog-page-header h1 { font-family: 'DM Serif Display', Georgia, serif; font-size: 32px; margin-bottom: 8px; }

.blog-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.blog-filter-btn {
  padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 500;
  border: 1px solid #e5e7ef; color: #5a5d73; transition: all 0.15s;
}
.blog-filter-btn:hover, .blog-filter-btn.active {
  background: #2b5ea7; color: #fff; border-color: #2b5ea7; text-decoration: none;
}

/* Articolo in evidenza */
.blog-featured {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border-radius: 16px; overflow: hidden; border: 1px solid #e5e7ef;
  color: inherit; transition: box-shadow 0.2s;
}
.blog-featured:hover { box-shadow: 0 8px 32px rgba(43,94,167,0.12); text-decoration: none; }
.blog-featured-img {
  height: 300px; overflow: hidden;
  background: #f0f4fb; display: flex; align-items: center; justify-content: center;
}
.blog-featured-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.blog-featured:hover .blog-featured-img img { transform: scale(1.04); }
.blog-featured-placeholder { font-size: 64px; }
.blog-featured-content { background: #fff; padding: 36px; display: flex; flex-direction: column; justify-content: center; }
.blog-featured-content h2 { font-family: 'DM Serif Display', Georgia, serif; font-size: 24px; margin: 10px 0 12px; font-weight: 400; }
.blog-featured-content p { font-size: 15px; color: #5a5d73; line-height: 1.65; margin-bottom: 16px; flex: 1; }

/* Card blog con foto corretta */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; align-items: start; }
.blog-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid #e5e7ef; border-radius: 12px;
  overflow: hidden; padding: 0; color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-decoration: none;
}
.blog-card:hover { border-color: #2b5ea7; box-shadow: 0 4px 20px rgba(43,94,167,0.1); text-decoration: none; }
.blog-card-img { width: 100%; height: 180px; overflow: hidden; flex-shrink: 0; display: block; }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.blog-card:hover .blog-card-img img { transform: scale(1.04); }
.blog-card-body { flex: 1; display: flex; flex-direction: column; padding: 20px 22px 22px; }
.blog-card-body h3 { margin: 6px 0 8px; font-size: 16px; color: #1a1a2e; }
.blog-card-body p { flex: 1; font-size: 14px; color: #5a5d73; margin-bottom: 8px; }

/* Breadcrumb e categorie articolo */
.breadcrumb a { color: #2b5ea7; }
.article-category { color: #2b5ea7; font-size: 12px; font-weight: 600; text-transform: uppercase; text-decoration: none; display: inline-block; }
.article-category:hover { text-decoration: underline; }

/* Article cover e CTA */
.article-cover { margin-bottom: 28px; border-radius: 12px; overflow: hidden; max-height: 420px; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-cta { margin-top: 48px; padding: 28px 32px; background: linear-gradient(135deg, #1a2a4a, #2b5ea7); border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.article-cta p { color: rgba(255,255,255,0.9); font-size: 16px; margin: 0; }
.article-cta-text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 220px; }
.article-cta .article-cta-desc { font-size: 14px; color: rgba(255,255,255,0.75); }
.article-cta .article-cta-kicker { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.6); }
.article-cta .article-cta-title { font-size: 19px; font-weight: 700; color: #fff; }

/* Responsive */
@media (max-width: 768px) {
  .gen-steps-row { flex-direction: column; }
  .gen-step-block:first-child { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.07); }
  .gen-step-divider { display: none; }
  .gen-engine-badge { display: none; }
  .gen-free-actions { flex-direction: column; }
  .blog-featured { grid-template-columns: 1fr; }
  .blog-featured-img { height: 220px; }
  .article-cta { flex-direction: column; text-align: center; }
}

/* Casella di consenso prima della generazione (generatore e pagina documento) */
.consent-check {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 18px 0 6px; font-size: 13px; line-height: 1.55;
  color: rgba(255,255,255,0.7); cursor: pointer; grid-column: 1 / -1;
}
.consent-check input { margin-top: 3px; width: 16px; height: 16px; flex-shrink: 0; accent-color: #4f7df9; }
.consent-check strong { color: rgba(255,255,255,0.9); }
.consent-check a { color: #7db8ff; text-decoration: underline; }

/* Consenso al recesso nel riquadro a pagamento e dati del titolare nel piè di pagina */
.consent-check--paywall { max-width: 360px; margin: 0 auto 14px; text-align: left; font-size: 12px; }
.footer-operator { margin-top: 4px; font-size: 12px; opacity: 0.75; }

/* ── "I nostri consigli per te": consigli sotto la lettera generata ─────── */
.next-steps {
  margin-top: 28px; padding: 26px 28px; border-radius: 14px; text-align: left;
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025));
  border: 1px solid rgba(255,255,255,0.10); color: rgba(255,255,255,0.86);
}
.next-steps-head { display: flex; gap: 16px; align-items: flex-start; }
.next-steps-icon {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 19px; background: rgba(79,125,249,0.14); border: 1px solid rgba(79,125,249,0.35);
}
.next-steps-head h4 { font-family: 'DM Serif Display', Georgia, serif; font-weight: 400; font-size: 23px; color: #fff; margin: 2px 0 4px; }
.next-steps-head p { font-size: 14px; color: rgba(255,255,255,0.62); margin: 0; }
.next-steps-group h5 {
  margin: 24px 0 12px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #8fb0ff;
}
.next-steps-list { list-style: none; margin: 0; padding: 0; counter-reset: passo; }
.next-steps-list li { position: relative; padding-left: 38px; margin-bottom: 12px; font-size: 14.5px; line-height: 1.6; }
.next-steps-list li:last-child { margin-bottom: 0; }
.next-steps-list strong { color: #fff; font-weight: 600; }
.next-steps-list.is-numbered li { counter-increment: passo; }
.next-steps-list.is-numbered li::before {
  content: counter(passo); position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
  background: rgba(79,125,249,0.20); color: #cfe0ff;
}
.next-steps-list.is-checks li::before {
  content: '✓'; position: absolute; left: 4px; top: 0; font-weight: 700; color: #5fd38d;
}
/* Consigli bloccati (documenti a pagamento): sfocati e sfumati verso il fondo,
   come l'anteprima della lettera. Il testo è finto: quello vero arriva col pagamento. */
.next-steps-locked {
  position: relative; max-height: 210px; overflow: hidden; margin-top: 4px;
  user-select: none; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,0.55) 45%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,0.55) 45%, transparent 100%);
}
.next-steps-locked-text { filter: blur(4px); }
.next-steps-lock { margin: -28px 0 0; position: relative; text-align: center; font-size: 14px; font-weight: 600; color: #7db8ff; }
.next-steps-note {
  margin: 22px 0 0; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px; line-height: 1.6; color: rgba(255,255,255,0.45);
}
@media (max-width: 768px) {
  .next-steps { padding: 20px 18px; }
  .next-steps-head h4 { font-size: 20px; }
}

/* ── "Cosa ti serve?": ricerca e aree del generatore in homepage ─────────── */
.finder-search { position: relative; }
.finder-input-wrap { position: relative; }
.finder-input-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.45); pointer-events: none; }
.finder-input {
  width: 100%; padding: 16px 18px 16px 48px; font-size: 16px; font-family: inherit;
  color: #fff; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px; outline: none; transition: border-color 0.2s, background 0.2s;
}
.finder-input::placeholder { color: rgba(255,255,255,0.4); }
.finder-input:focus { border-color: #4f86d8; background: rgba(255,255,255,0.09); }
.finder-hint { margin: 8px 2px 0; font-size: 13px; color: rgba(255,255,255,0.45); }
.finder-results {
  margin-top: 12px; padding: 8px; border-radius: 12px;
  background: rgba(13,17,23,0.92); border: 1px solid rgba(255,255,255,0.1);
}
.finder-empty { margin: 0; padding: 12px; font-size: 14px; color: rgba(255,255,255,0.7); }
.finder-empty a { color: #7db8ff; }

.finder-or { display: flex; align-items: center; gap: 14px; margin: 28px 0 18px; color: rgba(255,255,255,0.4); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.finder-or::before, .finder-or::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.08); }

.finder-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.finder-cat {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; text-decoration: none;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); color: #fff;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.finder-cat:hover { border-color: rgba(79,134,216,0.6); background: rgba(79,134,216,0.08); transform: translateY(-1px); }
.finder-cat.is-active { border-color: #4f86d8; background: rgba(79,134,216,0.16); }
.finder-cat-icon { font-size: 20px; }
.finder-cat-name { font-weight: 600; font-size: 15px; line-height: 1.3; }
.finder-cat-count { font-size: 12px; color: rgba(255,255,255,0.45); }

.finder-panel { margin-top: 18px; padding: 18px; border-radius: 12px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); }
.finder-panel-title { margin: 0 0 10px; font-size: 16px; color: #fff; }
.finder-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.finder-doc {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
  padding: 12px 14px; border-radius: 10px; text-decoration: none; color: #fff;
  background: rgba(255,255,255,0.03); transition: background 0.2s;
}
.finder-doc:hover, .finder-doc:focus-visible { background: rgba(79,134,216,0.18); outline: none; text-decoration: none; }
.finder-doc-title { font-weight: 600; font-size: 15px; }
.finder-doc-desc { grid-column: 1; font-size: 13px; color: rgba(255,255,255,0.55); line-height: 1.45; }
.finder-doc-go { grid-column: 2; grid-row: 1 / span 2; color: #7db8ff; font-size: 18px; }
.finder-all { display: inline-block; margin-top: 22px; color: #7db8ff; font-weight: 600; text-decoration: none; }
.finder-all:hover { text-decoration: underline; }

/* ── Pagina "Tutti i documenti" ─────────────────────────────────────────── */
.catalog-page { padding: 48px 0 64px; }
.catalog-head { max-width: 760px; margin: 0 auto 28px; text-align: center; }
.catalog-head h1 { font-family: 'DM Serif Display', Georgia, serif; font-weight: 400; font-size: 38px; margin-bottom: 8px; }
.catalog-head p { color: #5a5d73; }
.catalog-search { max-width: 640px; margin: 0 auto 36px; position: relative; }
.catalog-search .finder-input { color: #1a1a2e; background: #fff; border-color: #d9dceb; box-shadow: 0 2px 10px rgba(20,30,60,0.05); }
.catalog-search .finder-input::placeholder { color: #8a8ea6; }
.catalog-search .finder-input-icon { color: #8a8ea6; }
.catalog-group { margin-bottom: 32px; }
.catalog-group h2 { font-size: 20px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.catalog-group h2 a { color: inherit; text-decoration: none; }
.catalog-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.catalog-item {
  display: block; height: 100%; padding: 16px 18px; background: #fff; border: 1px solid #e5e7ef; border-radius: 12px;
  text-decoration: none; color: inherit; transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.catalog-item:hover { border-color: #2b5ea7; box-shadow: 0 6px 18px rgba(20,30,60,0.08); transform: translateY(-1px); }
.catalog-item strong { display: block; font-size: 15px; margin-bottom: 4px; color: #1a1a2e; }
.catalog-item span { font-size: 13.5px; color: #5a5d73; line-height: 1.5; }
.catalog-empty { text-align: center; color: #5a5d73; }

/* ── Pagina documento: altri documenti e "Ti serve un'altra lettera?" ────── */
.related-docs { padding: 8px 0 56px; }
.related-docs h2 { font-size: 20px; margin-bottom: 14px; }
.another-letter { margin-top: 18px; text-align: center; }
.another-letter a { color: #7db8ff; font-weight: 600; text-decoration: none; }
.another-letter a:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .finder-cats { grid-template-columns: 1fr 1fr; }
  .catalog-head h1 { font-size: 30px; }
  .catalog-list { grid-template-columns: 1fr; }
}

/* Testo letto dai lettori di schermo ma invisibile a video */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
