/**
 * Swarm Checklist Builder - Frontend Styles (Design A)
 */

/* Container */
.sqb-quiz-container {
    max-width: 800px;
    margin: 0 auto;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    color: #1e293b;
}

/* Header */
.sqb-quiz-header {
    text-align: center;
    margin-bottom: 32px;
}

.sqb-quiz-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.sqb-quiz-description {
    color: #64748b;
    font-size: 15px;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Step visibility */
.sqb-step {
    display: none;
}

.sqb-step.active {
    display: block;
}

/* Lead Capture Form */
.sqb-lead-form {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    max-width: 450px;
    margin: 0 auto;
}

.sqb-lead-form-inner h3 {
    font-size: 22px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 24px 0;
    text-align: center;
}

.sqb-form-field {
    margin-bottom: 20px;
}

.sqb-form-field label {
    display: block;
    font-weight: 500;
    color: #475569;
    margin-bottom: 8px;
    font-size: 14px;
}

.sqb-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.sqb-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Instructions Card */
.sqb-instructions-card {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 32px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.sqb-instructions-icon {
    background: #0ea5e9;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sqb-instructions-icon span {
    color: white;
    font-size: 14px;
    font-weight: 700;
}

.sqb-instructions-content {
    flex: 1;
}

.sqb-instructions-label {
    margin: 0 0 6px 0;
    color: #0c4a6e;
    font-weight: 600;
    font-size: 15px;
}

.sqb-instructions-text {
    margin: 0;
    color: #0369a1;
    font-size: 14px;
    line-height: 1.6;
}

.sqb-instructions-text p {
    margin: 0;
}

/* Section Cards */
.sqb-section-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
}

.sqb-section-header {
    padding: 20px 24px;
    /* Background set via inline style for customization */
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
}

.sqb-section-title {
    margin: 0;
    color: white;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.sqb-section-header .sqb-section-desc {
    margin: 8px 0 0 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    line-height: 1.5;
}

/* Statements */
.sqb-statements {
    padding: 8px 0;
}

.sqb-statement {
    display: flex;
    padding: 20px 24px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    align-items: flex-start;
    gap: 16px;
}

.sqb-statement:hover {
    background-color: #f8fafc;
}

.sqb-statement-bordered {
    border-bottom: 1px solid #f1f5f9;
}

.sqb-checkbox-wrapper {
    flex-shrink: 0;
    padding-top: 2px;
}

.sqb-checkbox {
    width: 22px;
    height: 22px;
    accent-color: #0ea5e9;
    cursor: pointer;
    margin: 0;
}

.sqb-statement-content {
    flex: 1;
    min-width: 0;
}

.sqb-statement-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.sqb-critical-badge {
    background: #fef2f2;
    color: #dc2626;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.sqb-statement-bold {
    font-weight: 600;
    color: #1e293b;
    font-size: 15px;
    line-height: 1.4;
}

.sqb-statement-desc {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

/* Progress Bar */
.sqb-progress-bar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sqb-progress-label {
    color: #64748b;
    font-size: 14px;
}

.sqb-progress-count {
    color: #1e293b;
    font-weight: 600;
    font-size: 14px;
}

/* Submit Section */
.sqb-submit-section {
    text-align: center;
}

/* Buttons */
.sqb-button {
    display: inline-block;
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    /* Background and box-shadow set via inline style */
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
    width: 100%;
    max-width: 300px;
}

.sqb-button:hover {
    transform: translateY(-1px);
}

.sqb-button:active {
    transform: translateY(0);
}

.sqb-loading {
    display: inline-block;
    margin-left: 12px;
    color: #64748b;
    font-size: 14px;
}

/* Results */
.sqb-results-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-align: center;
}

.sqb-results-heading {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 32px 0;
}

.sqb-score-display {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.sqb-score-item {
    text-align: center;
    min-width: 80px;
}

.sqb-score-value,
.sqb-unchecked-value,
.sqb-total-value {
    display: block;
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
}

.sqb-score-checked .sqb-score-value {
    color: #22c55e;
}

.sqb-score-unchecked .sqb-unchecked-value {
    color: #ef4444;
}

.sqb-score-total .sqb-total-value {
    color: #1e293b;
}

.sqb-score-label {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.sqb-result-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
}

.sqb-result-message {
    color: #475569;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 32px;
}

.sqb-result-message p {
    margin: 0 0 12px 0;
}

.sqb-result-message p:last-child {
    margin-bottom: 0;
}

/* Error messages */
.sqb-error {
    color: #dc2626;
    background: #fef2f2;
    padding: 16px 20px;
    border-radius: 10px;
    border: 1px solid #fecaca;
    font-size: 14px;
}

/* Form validation error message */
.sqb-error-message {
    color: #dc2626;
    background: #fef2f2;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

/* Error field styling */
.sqb-input.sqb-error-field {
    border-color: #dc2626 !important;
    background-color: #fef2f2;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.sqb-input.sqb-error-field:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

/* Responsive */
@media (max-width: 640px) {
    .sqb-quiz-container {
        padding: 0 16px;
    }
    
    .sqb-quiz-title {
        font-size: 24px;
    }
    
    .sqb-lead-form {
        padding: 28px 24px;
    }
    
    .sqb-section-header {
        padding: 16px 20px;
    }
    
    .sqb-section-title {
        font-size: 16px;
    }
    
    .sqb-statement {
        padding: 16px 20px;
        gap: 12px;
    }
    
    .sqb-statement-bold {
        font-size: 14px;
    }
    
    .sqb-statement-desc {
        font-size: 13px;
    }
    
    .sqb-score-display {
        gap: 24px;
    }
    
    .sqb-score-value,
    .sqb-unchecked-value,
    .sqb-total-value {
        font-size: 36px;
    }
    
    .sqb-instructions-card {
        padding: 16px;
        gap: 12px;
    }
    
    .sqb-progress-bar {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* All Results List */
.sqb-all-results {
    margin: 24px 0;
    text-align: left;
}

.sqb-results-list {
    list-style: decimal;
    margin: 0;
    padding: 0 0 0 24px;
}

.sqb-results-list .sqb-result-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.sqb-results-list .sqb-result-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sqb-results-list .sqb-result-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.sqb-results-list .sqb-result-message {
    color: #475569;
    font-size: 15px;
    line-height: 1.7;
}

.sqb-results-list .sqb-result-message p {
    margin: 0 0 10px 0;
}

.sqb-results-list .sqb-result-message p:last-child {
    margin-bottom: 0;
}

/* Attachment Download */
.sqb-attachment-download {
    margin: 24px 0;
    padding: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.sqb-download-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #0369a1;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: color 0.2s;
}

.sqb-download-link:hover {
    color: #0284c7;
}

.sqb-download-icon {
    font-size: 24px;
}

/* CTA Section */
.sqb-cta-section {
    margin: 32px 0;
}

.sqb-cta-button {
    display: inline-block;
    text-decoration: none;
    padding: 18px 40px;
    font-size: 17px;
}

/* Secondary restart button */
.sqb-restart-secondary {
    background: #f1f5f9 !important;
    color: #64748b !important;
    box-shadow: none !important;
    margin-top: 16px;
}

.sqb-restart-secondary:hover {
    background: #e2e8f0 !important;
}

/* All Results List */
.sqb-all-results {
    margin: 24px 0;
    text-align: left;
}

.sqb-results-list {
    list-style-type: decimal;
    margin: 0;
    padding: 0 0 0 24px;
}

.sqb-results-list .sqb-result-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.sqb-results-list .sqb-result-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sqb-results-list .sqb-result-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 16px;
    margin-bottom: 8px;
}

.sqb-results-list .sqb-result-message {
    color: #475569;
    font-size: 14px;
    line-height: 1.7;
}

.sqb-results-list .sqb-result-message p {
    margin: 0 0 10px 0;
}

.sqb-results-list .sqb-result-message p:last-child {
    margin-bottom: 0;
}

/* Attachment Download */
.sqb-attachment-download {
    margin: 24px 0;
    padding: 16px 20px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
}

.sqb-download-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    color: #0369a1;
    font-weight: 600;
    font-size: 15px;
    transition: color 0.15s;
}

.sqb-download-link:hover {
    color: #0c4a6e;
}

.sqb-download-icon {
    font-size: 20px;
}

/* CTA Section */
.sqb-cta-section {
    margin: 24px 0;
}

.sqb-cta-button {
    display: inline-block;
    width: auto;
    max-width: none;
}

/* Restart button secondary style */
.sqb-restart-secondary {
    background: #f1f5f9 !important;
    color: #475569 !important;
    box-shadow: none !important;
}

.sqb-restart-secondary:hover {
    background: #e2e8f0 !important;
}

/* Results Description Boxes */
.sqb-results-description-before,
.sqb-results-description-after {
    background: #f0fdf4;
    border: 2px solid #22c55e;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    text-align: center;
    color: #166534;
    font-size: 15px;
    line-height: 1.7;
}

.sqb-results-description-before p,
.sqb-results-description-after p {
    margin: 0 0 12px 0;
}

.sqb-results-description-before p:last-child,
.sqb-results-description-after p:last-child {
    margin-bottom: 0;
}

.sqb-results-description-after {
    margin-top: 24px;
}

/* Enhanced Download Link Styling */
.sqb-attachment-download .sqb-download-text {
    font-size: 16px;
}

/* Button Options with OR Divider */
.sqb-button-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.sqb-button-options .sqb-button {
    width: 100%;
    max-width: 300px;
}

.sqb-button-divider {
    display: inline-flex;
    align-items: center;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sqb-button-divider::before,
.sqb-button-divider::after {
    content: '';
    width: 40px;
    height: 1px;
    background: #cbd5e1;
    margin: 0 12px;
}

/* Secondary Button Style */
.sqb-button-secondary {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 2px solid #cbd5e1;
    box-shadow: none !important;
}

.sqb-button-secondary:hover {
    background: #e2e8f0 !important;
    border-color: #94a3b8;
}

/* PDF Download Page */
.sqb-download-page {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.sqb-download-card {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.sqb-download-icon-large {
    margin-bottom: 24px;
}

.sqb-download-icon-large svg {
    color: #0ea5e9;
}

.sqb-download-heading {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 20px 0;
}

.sqb-download-description {
    color: #475569;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 30px;
}

.sqb-download-description p {
    margin: 0 0 12px 0;
}

.sqb-download-description p:last-child {
    margin-bottom: 0;
}

.sqb-pdf-download-section {
    margin-bottom: 20px;
}

.sqb-pdf-download-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
}

.sqb-download-btn-icon {
    font-size: 20px;
}

.sqb-download-email-notice {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 30px;
}

