/* Stili condivisi per le pagine pubbliche del questionario (preview + compilazione). */

.q-page {
    width: 100%;
    min-height: 100%;
    padding: 40px 16px 80px;
    background: linear-gradient(135deg, #e8f3f2 0%, #f6fbfb 40%, #ffffff 100%);
    font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1f2937;
    box-sizing: border-box;
    counter-reset: q-domanda-counter;
}

.q-card {
    max-width: 860px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(15, 107, 102, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
    padding: 40px 48px;
}

.q-state {
    max-width: 860px;
    margin: 0 auto;
    text-align: center;
    padding: 64px 16px;
}

.q-state .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e7eb;
    border-top-color: #0f6b66;
    border-radius: 50%;
    animation: q-spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes q-spin { to { transform: rotate(360deg); } }

.q-header {
    margin-bottom: 32px;
}

.q-header h1 {
    margin: 0 0 12px;
    font-size: 28px;
    font-weight: 600;
    color: #111827;
}

.q-anteprima-badge {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.q-forn { color: #6b7280; font-size: 14px; }
.q-scad { color: #6b7280; font-size: 14px; margin-top: 4px; }
.q-intro { margin-top: 16px; color: #374151; line-height: 1.6; }

.q-obbligatoria-legend {
    color: #dc2626;
    font-size: 14px;
    margin-top: 16px;
}

.q-banner-warn {
    margin-top: 16px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
}

.q-sezione {
    border: none;
    padding: 0;
    margin: 0 0 32px;
    background: transparent;
}

.q-sezione legend {
    font-size: 20px;
    font-weight: 600;
    color: #0f6b66;
    padding: 0;
    margin-bottom: 8px;
}

.q-sezione-desc {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.q-domanda {
    margin-bottom: 28px;
}

.q-separatore {
    padding: 16px 0;
    border-top: 1px dashed #e5e7eb;
    margin-top: 16px;
}

.q-separatore h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.q-separatore p {
    margin: 4px 0 0;
    color: #6b7280;
}

.q-label {
    display: block;
    font-weight: 500;
    font-size: 15px;
    margin-bottom: 10px;
    color: #111827;
    line-height: 1.5;
}

.q-label::before {
    counter-increment: q-domanda-counter;
    content: counter(q-domanda-counter) ". ";
    font-weight: 500;
    color: #111827;
}

.q-req { color: #dc2626; margin-left: 2px; }

.q-hint {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 10px;
    line-height: 1.5;
}

.q-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.q-input::placeholder { color: #9ca3af; }

.q-input:focus {
    outline: none;
    border-color: #0f6b66;
    box-shadow: 0 0 0 3px rgba(15, 107, 102, 0.15);
}

.q-textarea {
    resize: vertical;
    min-height: 80px;
}

.q-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.q-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
}

.q-option:hover { background: #f3f4f6; }
.q-option input { margin: 0; accent-color: #0f6b66; }

.q-nota {
    margin-top: 8px;
    margin-left: 28px;
    max-width: 480px;
}

.q-err {
    color: #dc2626;
    font-size: 13px;
    margin-top: 6px;
}

.q-err-global {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.q-actions {
    margin-top: 32px;
    display: flex;
    justify-content: flex-end;
}

.q-actions-paged {
    justify-content: space-between;
    align-items: center;
}

.q-actions-right {
    display: flex;
    gap: 12px;
}

.q-btn-primary {
    background: #0f6b66;
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.q-btn-primary:hover:not(:disabled) { background: #0b524e; }
.q-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.q-btn-secondary {
    background: #ffffff;
    color: #0f6b66;
    border: 1px solid #0f6b66;
    padding: 11px 24px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.q-btn-secondary:hover:not(:disabled) { background: #f3f4f6; }
.q-btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

.q-progress {
    margin-bottom: 24px;
}

.q-progress-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}

.q-progress-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.q-progress-fill {
    height: 100%;
    background: #0f6b66;
    transition: width 0.25s ease;
}

.q-autosave {
    text-align: right;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 8px;
    min-height: 18px;
}

.q-confirm {
    max-width: 860px;
    margin: 0 auto;
    text-align: center;
    padding: 48px 16px;
}

.q-check {
    font-size: 64px;
    color: #10b981;
    margin-bottom: 16px;
}

.q-note-finale {
    margin-top: 16px;
    color: #4b5563;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .q-page { padding: 16px 8px 64px; }
    .q-card { padding: 24px 20px; border-radius: 8px; }
    .q-header h1 { font-size: 22px; }
}
