#sparkquiz-root {
    --sq-primary: #2a6b3c;
    --sq-primary-dark: color-mix(in srgb, var(--sq-primary) 80%, black);
    --sq-radius: 12px;
    --sq-shadow: 0 4px 24px rgba(0,0,0,.12);
    font-family: var(--sq-body-font, inherit);
    box-sizing: border-box;
}

#sparkquiz-root *, #sparkquiz-root *::before, #sparkquiz-root *::after {
    box-sizing: inherit;
}

.sq-logo { text-align: center; margin-bottom: 20px; }
.sq-logo img { display: inline-block; }

.sq-card {
    background: #fff;
    border-radius: var(--sq-radius);
    box-shadow: var(--sq-shadow);
    padding: 32px 40px;
    max-width: 640px;
    margin: 40px auto;
}

@media (max-width: 680px) {
    .sq-card { padding: 24px 20px; margin: 20px 16px; }
}

/* Screen visibility */
.sq-screen { display: none; }
.sq-screen.active { display: block; }

/* Intro screen */
.sq-intro-title { font-family: var(--sq-heading-font, inherit); font-size: 28px; font-weight: 700; color: #1a1a1a; margin-bottom: 10px; line-height: 1.2; }
.sq-intro-sub { font-size: 16px; color: #555; margin-bottom: 28px; line-height: 1.5; }
.sq-intro-badges { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.sq-badge { font-size: 12px; padding: 4px 12px; background: #f0f7f2; color: var(--sq-primary); border-radius: 20px; font-weight: 600; }

/* Progress bar */
.sq-progress-wrap { margin-bottom: 20px; }
.sq-progress-label { font-size: 12px; color: #888; margin-bottom: 6px; }
.sq-progress-bar { height: 6px; background: #e8e8e8; border-radius: 3px; overflow: hidden; }
.sq-progress-fill { height: 100%; background: var(--sq-primary); border-radius: 3px; transition: width .3s ease; }

/* Question screen */
.sq-question-text { font-family: var(--sq-heading-font, inherit); font-size: 22px; font-weight: 700; color: #1a1a1a; margin-bottom: 6px; line-height: 1.3; }
.sq-question-hint { font-size: 13px; color: #888; margin-bottom: 20px; }
.sq-choices { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.sq-choice {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    padding: 14px 18px;
    border: 2px solid #e0e0e0; border-radius: 8px;
    cursor: pointer; transition: border-color .15s, background .15s;
    font-size: 15px; color: #1a1a1a;
}
.sq-choice:hover { border-color: var(--sq-primary); background: #f5fbf7; }
.sq-choice.selected { border-color: var(--sq-primary); background: #f0f7f2; font-weight: 600; }
.sq-choice-indicator {
    width: 20px; height: 20px; flex-shrink: 0;
    border: 2px solid #ccc; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .15s, background .15s;
}
.sq-choice.multi .sq-choice-indicator { border-radius: 4px; }
.sq-choice.selected .sq-choice-indicator { border-color: var(--sq-primary); background: var(--sq-primary); }
.sq-choice.selected .sq-choice-indicator::after { content: '✓'; color: #fff; font-size: 11px; font-weight: 700; }
.sq-fill-input { display: none; flex: 0 0 calc(100% - 32px); margin-left: 32px; padding: 8px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; font-family: var(--sq-body-font, inherit); cursor: text; }
.sq-fill-input.visible { display: block; }

/* Result screen */
.sq-result-badge { display: inline-block; background: var(--sq-primary); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 14px; border-radius: 20px; margin-bottom: 14px; }
.sq-result-title { font-family: var(--sq-heading-font, inherit); font-size: 26px; font-weight: 700; color: #1a1a1a; margin-bottom: 10px; }
.sq-result-desc { font-size: 15px; color: #444; line-height: 1.6; margin-bottom: 28px; }

/* Contact form */
.sq-form-title { font-family: var(--sq-heading-font, inherit); font-size: 18px; font-weight: 700; color: #1a1a1a; margin-bottom: 20px; }
.sq-field { margin-bottom: 16px; }
.sq-field label { display: block; font-size: 13px; font-weight: 600; color: #444; margin-bottom: 5px; }
.sq-field label .sq-required { color: #d63638; }
.sq-field input, .sq-field textarea, .sq-field select {
    width: 100%; padding: 10px 14px;
    border: 1px solid #ccc; border-radius: 6px;
    font-size: 14px; font-family: var(--sq-body-font, inherit);
    transition: border-color .15s;
}
.sq-field input:focus, .sq-field textarea:focus, .sq-field select:focus {
    outline: none; border-color: var(--sq-primary);
}
.sq-field.sq-error input, .sq-field.sq-error textarea { border-color: #d63638; }
.sq-field-error { font-size: 12px; color: #d63638; margin-top: 4px; display: none; }
.sq-field.sq-error .sq-field-error { display: block; }

/* Buttons */
.sq-btn {
    display: inline-block; padding: 14px 32px;
    background: var(--sq-primary); color: #fff;
    border: none; border-radius: 8px; cursor: pointer;
    font-size: 16px; font-weight: 700; font-family: var(--sq-body-font, inherit);
    transition: background .15s;
    width: 100%;
}
.sq-btn:hover { background: var(--sq-primary-dark); }
.sq-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.sq-btn-outline { background: transparent; border: 2px solid var(--sq-primary); color: var(--sq-primary); margin-right: 10px; }
.sq-btn-outline:hover { background: var(--sq-primary); color: #fff; }
.sq-back-link,
button.sq-back-link { background: transparent; border: none; color: #888; font-size: 13px; cursor: pointer; padding: 0; margin-bottom: 16px; text-decoration: underline; }
.sq-back-link:hover,
button.sq-back-link:hover { background: transparent; color: #555; }

/* Disclaimer */
.sq-disclaimer { font-size: 11px; color: #aaa; line-height: 1.5; margin-top: 12px; text-align: center; }

/* CTA links below form */
.sq-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; justify-content: center; }
.sq-cta-btn {
    display: inline-block; padding: 10px 22px;
    border: 2px solid var(--sq-primary); border-radius: 8px;
    color: var(--sq-primary); background: transparent;
    font-size: 14px; font-weight: 600; font-family: var(--sq-body-font, inherit);
    text-decoration: none; transition: background .15s, color .15s;
}
.sq-cta-btn:hover, a.sq-cta-btn:hover { background: var(--sq-primary); color: #fff; }

/* Success screen */
.sq-success-icon { font-size: 48px; text-align: center; margin-bottom: 16px; }
.sq-success-title { font-family: var(--sq-heading-font, inherit); font-size: 26px; font-weight: 700; color: #1a1a1a; text-align: center; margin-bottom: 10px; }
.sq-success-msg { font-size: 15px; color: #555; text-align: center; line-height: 1.6; }

/* Spinner */
.sq-spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: sq-spin .6s linear infinite; margin-right: 8px; vertical-align: middle; }
@keyframes sq-spin { to { transform: rotate(360deg); } }

/* ── Popup overlay ── */
.sq-popup-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    display: none; align-items: flex-start; justify-content: center;
    z-index: 9999; padding: 20px; overflow-y: auto;
}
.sq-popup-overlay.sq-popup-active { display: flex; }
.sq-popup-inner { position: relative; width: 100%; max-width: 680px; margin: auto; }
.sq-popup-close {
    position: absolute; top: 12px; right: 12px; z-index: 1;
    background: rgba(0,0,0,.35); border: none; color: #fff;
    border-radius: 50%; width: 28px; height: 28px;
    font-size: 14px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.sq-popup-close:hover { background: rgba(0,0,0,.6); }
.sq-popup-close:focus-visible,
.sq-popup-btn:focus-visible {
    outline: 2px solid var(--sq-primary, #2a6b3c);
    outline-offset: 2px;
}

/* ── Popup trigger button ── */
.sq-popup-wrap { display: flex; }
.sq-popup-wrap.sq-popup-align-left   { justify-content: flex-start; }
.sq-popup-wrap.sq-popup-align-center { justify-content: center; }
.sq-popup-wrap.sq-popup-align-right  { justify-content: flex-end; }
.sq-popup-btn {
    display: inline-block;
    padding: 14px 32px; border-radius: 8px;
    font-size: 16px; font-weight: 700; font-family: var(--sq-body-font, inherit);
    cursor: pointer;
    background: var(--sq-primary, #2a6b3c); color: #fff;
    border: 2px solid var(--sq-primary, #2a6b3c);
    transition: background .15s, color .15s, border-color .15s, filter .15s;
}
.sq-popup-btn:hover { filter: brightness(.9); }
