/* ============================================================================
   Pagina del singolo documento (/documenti/...)
   ============================================================================
   Spostato da views/pages/document.ejs: stessi stili, ora in un file dedicato.
   ============================================================================ */
/* ── Hero ─────────────────────────────────────────────────────────────── */
.doc-hero {
  background: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #1a2332 100%);
  padding: 32px 0 36px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.doc-breadcrumb {
  font-size: 13px; margin-bottom: 20px; color: rgba(255,255,255,0.4);
}
.doc-breadcrumb a {
  color: rgba(255,255,255,0.5); text-decoration: none;
}
.doc-breadcrumb a:hover { color: rgba(255,255,255,0.8); }
.doc-breadcrumb span { margin: 0 6px; }

.doc-hero-content { max-width: 640px; }
.doc-hero-content h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 34px; font-weight: 400; color: #fff; margin-bottom: 10px;
  line-height: 1.2;
}
.doc-hero-sub {
  font-size: 15px; color: rgba(255,255,255,0.55); line-height: 1.6; margin-bottom: 16px;
}
.doc-hero-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.doc-badge {
  font-size: 12px; padding: 5px 12px; border-radius: 20px;
  background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.08);
}

/* ── Main layout ──────────────────────────────────────────────────────── */
.doc-main {
  padding: 36px 0 60px;
  background: linear-gradient(180deg, #0d1117 0%, #111720 100%);
  min-height: 80vh;
}
.doc-grid {
  display: grid; grid-template-columns: 1fr 520px;
  gap: 36px; align-items: start;
}

/* ── Guida (sinistra) ─────────────────────────────────────────────────── */
.doc-guide { position: sticky; top: 80px; }
.doc-guide-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px; padding: 24px; margin-bottom: 16px;
}
.doc-guide-card h2 {
  font-size: 17px; margin-bottom: 12px; color: rgba(255,255,255,0.9);
}
.doc-guide-card h3 {
  font-size: 15px; margin-bottom: 14px; color: rgba(255,255,255,0.85);
}
.doc-guide-text {
  font-size: 14px; line-height: 1.75; color: rgba(255,255,255,0.55);
}
.doc-guide-text strong { color: rgba(255,255,255,0.75); }
.doc-disclaimer-card {
  background: rgba(255,180,50,0.04);
  border-color: rgba(255,180,50,0.12);
}
.doc-disclaimer-card p {
  font-size: 13px; line-height: 1.6; color: rgba(255,255,255,0.5); margin: 0;
}
.doc-steps-card { }
.doc-mini-steps { display: flex; flex-direction: column; gap: 10px; }
.doc-mini-step {
  display: flex; align-items: center; gap: 12px;
  font-size: 13.5px; color: rgba(255,255,255,0.6);
}
.doc-mini-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(79,125,249,0.15); color: #7db8ff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}

/* ── Generatore (destra) ──────────────────────────────────────────────── */
.doc-generator { min-width: 0; }

/* ── Form ─────────────────────────────────────────────────────────────── */
.doc-form-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; padding: 32px;
}
.doc-form-header {
  display: flex; gap: 14px; align-items: flex-start; margin-bottom: 24px;
}
.doc-form-icon { font-size: 28px; line-height: 1; }
.doc-form-header h2 {
  font-size: 19px; color: #fff; margin-bottom: 4px;
}
.doc-form-header p {
  font-size: 13px; color: rgba(255,255,255,0.45); margin: 0;
}
.doc-form-header p strong { color: rgba(255,255,255,0.6); }

.doc-form-section {
  font-size: 12px; font-weight: 700; color: #7db8ff;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin: 24px 0 10px; padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.doc-form-section:first-of-type { margin-top: 0; }

.doc-form-group { margin-bottom: 16px; }
.doc-form-group label {
  display: block; font-size: 13.5px; font-weight: 500;
  margin-bottom: 5px; color: rgba(255,255,255,0.75);
}
.doc-req { color: #ff6b6b; margin-left: 2px; }

.doc-form-group input,
.doc-form-group select,
.doc-form-group textarea {
  width: 100%; padding: 11px 14px;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
  font-size: 14px; font-family: inherit;
  background: rgba(255,255,255,0.04); color: #fff;
  transition: border-color 0.2s, background 0.2s;
}
.doc-form-group input:focus,
.doc-form-group select:focus,
.doc-form-group textarea:focus {
  outline: none; border-color: rgba(79,125,249,0.5);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 3px rgba(79,125,249,0.1);
}
.doc-form-group input::placeholder,
.doc-form-group textarea::placeholder {
  color: rgba(255,255,255,0.25);
}
.doc-form-group textarea { resize: vertical; min-height: 80px; }
.doc-form-group select option { background: #1a1a2e; color: #fff; }

.doc-submit-btn {
  width: 100%; padding: 14px 24px; margin-top: 8px;
  border: none; border-radius: 10px; cursor: pointer;
  font-size: 15px; font-weight: 600; font-family: inherit;
  background: linear-gradient(135deg, #4f7df9, #3b6ce7);
  color: #fff; display: flex; align-items: center;
  justify-content: center; gap: 8px;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 12px rgba(79,125,249,0.25);
}
.doc-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(79,125,249,0.35);
}
.doc-submit-icon { font-size: 18px; }

.doc-secondary-btn {
  padding: 14px 24px; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px; cursor: pointer; font-size: 15px;
  font-weight: 500; font-family: inherit;
  background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.8);
  transition: background 0.15s;
}
.doc-secondary-btn:hover { background: rgba(255,255,255,0.1); }

/* ── Loading ──────────────────────────────────────────────────────────── */
.doc-loading {
  text-align: center; padding: 60px 20px; color: rgba(255,255,255,0.5);
}
.doc-loading p { margin-top: 16px; font-size: 14px; }
.doc-loading-bars {
  display: inline-flex; gap: 4px; align-items: flex-end; height: 32px;
}
.doc-loading-bars span {
  width: 5px; background: #4f7df9; border-radius: 3px;
  animation: docLoadBar 1s ease-in-out infinite;
}
.doc-loading-bars span:nth-child(1) { animation-delay: 0.0s; height: 12px; }
.doc-loading-bars span:nth-child(2) { animation-delay: 0.1s; height: 20px; }
.doc-loading-bars span:nth-child(3) { animation-delay: 0.2s; height: 28px; }
.doc-loading-bars span:nth-child(4) { animation-delay: 0.3s; height: 20px; }
.doc-loading-bars span:nth-child(5) { animation-delay: 0.4s; height: 12px; }
@keyframes docLoadBar {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ── Risultato ────────────────────────────────────────────────────────── */
.doc-result { }
.doc-result-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.doc-result-header h3 {
  font-size: 18px; color: rgba(255,255,255,0.9);
}
.doc-reset-btn {
  padding: 6px 14px; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px; font-size: 12px; cursor: pointer;
  background: transparent; color: rgba(255,255,255,0.5);
  font-family: inherit; transition: background 0.15s;
}
.doc-reset-btn:hover { background: rgba(255,255,255,0.06); }

/* ── Anteprima documento ──────────────────────────────────────────────── */
.doc-preview-wrap { position: relative; margin-bottom: 20px; }
/* Anteprima a pagamento: il testo non si seleziona né si stampa prima del pagamento */
.doc-preview-wrap.is-locked { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media print { .doc-preview-wrap.is-locked { display: none; } }

/* ── Paywall ──────────────────────────────────────────────────────────── */
.doc-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 3px 3px;
}
.doc-paywall-box { text-align: center; max-width: 380px; }
.doc-paywall-icon { font-size: 32px; margin-bottom: 10px; }
.doc-paywall-box h4 { font-size: 18px; color: #fff; margin-bottom: 8px; }
.doc-paywall-box p {
  font-size: 13px; color: rgba(255,255,255,0.5);
  margin-bottom: 16px; line-height: 1.6;
}
.doc-paywall-price {
  font-size: 32px; font-weight: 800; color: #7db8ff;
  margin-bottom: 18px; letter-spacing: -1px;
}

/* ── Azioni ───────────────────────────────────────────────────────────── */
.doc-actions { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.doc-actions .doc-submit-btn { flex: 1; }
.doc-actions .doc-secondary-btn { flex: 0 0 auto; }

.doc-disclaimer-text {
  font-size: 12px; color: rgba(255,255,255,0.28);
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .doc-grid { grid-template-columns: 1fr; }
  .doc-guide { position: static; order: 2; }
  .doc-generator { order: 1; }
  .doc-hero-content h1 { font-size: 26px; }
  .doc-form-card { padding: 24px; }
}

/* ── Altri documenti utili (sfondo scuro della pagina) ────────────────── */
.related-docs h2 { color: #fff; }

/* Controllo anti-robot (Turnstile): occupa spazio solo quando compare */
.doc-captcha { display: flex; justify-content: center; margin: 4px 0 14px; }
.doc-captcha:empty { margin: 0; }
