.sunstone-quiz {
    width: min(720px, 100%);
    margin: 32px auto;
    color: #17202a;
    font-family: inherit;
}

.sunstone-quiz-progress {
    position: relative;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--sunstone-progress-track, #e4e7eb);
    margin-bottom: 24px;
}

.sunstone-quiz-progress-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    border-radius: inherit;
    background: var(--sunstone-progress-fill, #1f7a6d);
    transition: width 180ms ease;
}

.sunstone-quiz-card {
    display: none;
    border: 1px solid #d9dee6;
    border-radius: 8px;
    padding: 32px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(23, 32, 42, 0.08);
}

.sunstone-quiz-card.is-active {
    display: block;
}

.sunstone-quiz-antibot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.sunstone-quiz-count {
    margin-bottom: 14px;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
}

.sunstone-quiz-card h3 {
    margin: 0 0 26px;
    font-size: 24px;
    line-height: 1.3;
}

.sunstone-quiz-answers {
    display: grid;
    gap: 14px;
}

.sunstone-quiz-answer {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 54px;
    padding: 16px;
    border: 1px solid var(--sunstone-answer-border, #cbd5e1);
    border-radius: 8px;
    background: var(--sunstone-answer-bg, #fff);
    color: var(--sunstone-answer-text, #17202a);
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.sunstone-quiz-answer:hover {
    border-color: var(--sunstone-answer-hover-border, #94a3b8);
    background: var(--sunstone-answer-hover-bg, #f8fafc);
    color: var(--sunstone-answer-hover-text, #17202a);
}

.sunstone-quiz-answer:has(input:checked) {
    border-color: var(--sunstone-answer-selected-border, #1f7a6d);
    background: var(--sunstone-answer-selected-bg, #eef8f6);
    color: var(--sunstone-answer-selected-text, #14554b);
}

.sunstone-quiz-answer input {
    margin-top: 3px;
}

/* --- LEAD CAPTURE FORM / FLOATING LABELS --- */
.sunstone-quiz-input-group {
    position: relative;
    margin-bottom: 20px;
}

.sunstone-quiz-input-group input {
    display: block;
    width: 100%;
    height: 56px;
    box-sizing: border-box;
    padding: 22px 20px 8px 44px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font: inherit;
    font-size: 14.5px;
    font-weight: 500;
    color: #17202a;
    background-color: #fff;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.sunstone-quiz-input-group input:focus {
    border-color: var(--sunstone-progress-fill, #1f7a6d);
    box-shadow: 0 0 0 3px rgba(31, 122, 109, 0.08);
}

/* Elegant CSS floating label mechanism */
.sunstone-quiz-input-group label {
    position: absolute;
    left: 44px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
    transition: all 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

.sunstone-quiz-input-group input:focus ~ label,
.sunstone-quiz-input-group input:not(:placeholder-shown) ~ label {
    top: 8px;
    transform: translateY(0);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--sunstone-progress-fill, #1f7a6d);
}

/* Inline icon styling */
.sunstone-quiz-input-group .sunstone-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: color 150ms ease;
}

.sunstone-quiz-input-group input:focus ~ .sunstone-input-icon {
    color: var(--sunstone-progress-fill, #1f7a6d);
}

/* Inline validation badge for Email */
.sunstone-quiz-input-group .sunstone-input-validation-badge {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transform-origin: center;
    transition: opacity 150ms ease, transform 150ms ease;
}

.sunstone-quiz-input-group.is-valid .sunstone-input-validation-badge {
    opacity: 1;
    color: #10b981; /* Emerald Green */
}

.sunstone-quiz-input-group.is-invalid .sunstone-input-validation-badge {
    opacity: 1;
    color: #f59e0b; /* Sophisticated Amber */
}

/* Trust / Privacy Reassurance Banner */
.sunstone-quiz-trust-banner {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 24px;
    padding: 12px 16px;
    background-color: #f8fafc;
    border-radius: 8px;
    border: 1px solid rgba(31, 122, 109, 0.05);
}

.sunstone-quiz-trust-banner .lock-icon {
    color: var(--sunstone-progress-fill, #1f7a6d);
    flex-shrink: 0;
    margin-top: 2px;
}

.sunstone-quiz-trust-banner span {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
    font-weight: 500;
}

/* Submission interactive state upgrades */
.sunstone-quiz-submit-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: sunstone-spin 0.6s linear infinite;
    margin-right: 8px;
    display: inline-block;
}

@keyframes sunstone-spin {
    to { transform: rotate(360deg); }
}

/* Disabled Submit button styling override */
.sunstone-quiz-actions button.sunstone-quiz-submit:disabled {
    cursor: not-allowed;
    background: #cbd5e1 !important;
    color: #94a3b8 !important;
    opacity: 0.8;
}

/* Style when processing submission */
.sunstone-quiz-actions button.sunstone-quiz-submit.is-submitting {
    cursor: wait;
    background: var(--sunstone-button-hover-bg, #1f7a6d) !important;
    color: #fff !important;
    opacity: 0.9;
}

.sunstone-quiz-actions {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 22px;
}

.sunstone-quiz-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border: 0;
    border-radius: 6px;
    background: var(--sunstone-button-bg, #17202a);
    color: var(--sunstone-button-text, #fff);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
}

.sunstone-quiz-actions button:hover {
    background: var(--sunstone-button-hover-bg, #1f7a6d);
    color: var(--sunstone-button-hover-text, #fff);
}

.sunstone-quiz-actions button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.sunstone-quiz-message {
    min-height: 22px;
    margin-top: 16px;
    color: #1f7a6d;
    font-weight: 600;
}

.sunstone-quiz-message.is-error {
    color: #b42318;
}

.sunstone-quiz-complete {
    border: 1px solid #b7e4d8;
    border-radius: 8px;
    padding: 32px;
    background: #eef8f6;
    color: #14554b;
    font-weight: 700;
}

@media (max-width: 600px) {
    .sunstone-quiz-card {
        padding: 22px;
    }

    .sunstone-quiz-card h3 {
        font-size: 20px;
    }

    .sunstone-quiz-actions {
        flex-wrap: wrap;
    }

    .sunstone-quiz-actions button {
        flex: 1 1 120px;
    }
}
