/**
 * Sales Tax Quiz - Frontend Styles
 * Based on Figma design specifications
 */

/* CSS Variables */
:root {
    --stq-primary-color: #E17100;
    --stq-primary-hover: #c96300;
    --stq-background: #F5F3F0;
    --stq-card-bg: #FFFFFF;
    --stq-info-box-bg: #F7F7F7;
    --stq-border-color: #E5E7EB;
    --stq-text-primary: #1A1A1A;
    --stq-text-secondary: #4B5563;
    --stq-text-muted: #9CA3AF;
    --stq-text-label: #6B7280;
    --stq-success: #22C55E;
    --stq-danger: #EF4444;
    --stq-warning: #F59E0B;
    --stq-radius-sm: 8px;
    --stq-radius-md: 12px;
    --stq-radius-lg: 16px;
    --stq-shadow: 0px 10px 15px -3px rgba(0, 0, 0, 0.1), 0px 4px 6px -4px rgba(0, 0, 0, 0.1);
    --stq-transition: all 0.3s ease;
}

/* Quiz Wrapper */
.stq-quiz-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--stq-background);
    padding: 48px 24px;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.5;
    color: var(--stq-text-primary);
}

.stq-quiz-wrapper * {
    box-sizing: border-box;
}

/* Progress Section */
.stq-progress-section {
    margin-bottom: 40px;
}

.stq-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stq-progress-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--stq-text-label);
}

.stq-progress-count {
    font-size: 14px;
    font-weight: 500;
    color: var(--stq-text-primary);
}

.stq-progress-bar {
    height: 8px;
    background-color: var(--stq-border-color);
    border-radius: 9999px;
    overflow: hidden;
}

.stq-progress-fill {
    height: 100%;
    background-color: var(--stq-primary-color);
    border-radius: 9999px;
    transition: width 0.5s ease;
}

/* Steps Container */
.stq-steps-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Step Card */
.stq-step-card {
    background: var(--stq-card-bg);
    border: 2px solid var(--stq-border-color);
    border-radius: var(--stq-radius-lg);
    overflow: hidden;
    transition: var(--stq-transition);
}

.stq-step-card.stq-active {
    border-color: var(--stq-primary-color);
    box-shadow: var(--stq-shadow);
}

.stq-step-card.stq-completed {
    border-color: var(--stq-border-color);
}

.stq-step-card.stq-completed .stq-step-badge {
    background-color: var(--stq-success);
}

.stq-step-card.stq-completed .stq-step-number {
    display: none;
}

.stq-step-card.stq-completed .stq-check-icon {
    display: block;
}

.stq-card-inner {
    padding: 36px;
}

/* Card Header */
.stq-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.stq-step-badge {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background-color: var(--stq-primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.stq-step-card:not(.stq-active):not(.stq-completed) .stq-step-badge {
    background-color: var(--stq-text-muted);
}

.stq-check-icon {
    display: none;
    width: 20px;
    height: 20px;
    stroke: white;
}

.stq-step-title-group {
    flex: 1;
}

.stq-test-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--stq-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 4px;
}

.stq-step-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--stq-text-primary);
    line-height: 1.4;
}

.stq-expand-btn {
    background: #FE9A00;
    border: none;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    color: white;
    transition: var(--stq-transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(254, 154, 0, 0.2);
    position: relative;
    z-index: 20;
    pointer-events: auto;
}

.stq-expand-btn:hover {
    background-color: #e68a00;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(254, 154, 0, 0.3);
}

.stq-expand-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    stroke: white;
    stroke-width: 2.5;
}

.stq-step-card.stq-active .stq-expand-btn svg,
.stq-step-card.stq-expanded .stq-expand-btn svg {
    transform: rotate(180deg);
}

/* Card Content */
.stq-card-content {
    display: none;
    margin-top: 24px;
}

.stq-step-card.stq-active .stq-card-content,
.stq-step-card.stq-expanded .stq-card-content {
    display: block;
}

/* Info Box */
.stq-info-box {
    background-color: var(--stq-info-box-bg);
    border-radius: var(--stq-radius-sm);
    padding: 20px;
    margin-bottom: 16px;
}

.stq-info-text {
    margin: 0 0 12px 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--stq-text-secondary);
}

.stq-info-text:last-child {
    margin-bottom: 0;
}

.stq-info-text strong {
    color: var(--stq-text-primary);
    font-weight: 700;
}

.stq-info-text.stq-danger strong {
    color: var(--stq-danger);
}

/* Triggers Box */
.stq-triggers-box {
    background-color: var(--stq-info-box-bg);
    border-radius: var(--stq-radius-sm);
    padding: 20px;
    margin-bottom: 16px;
}

.stq-triggers-label {
    margin: 0 0 8px 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--stq-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stq-triggers-list {
    margin: 0;
    padding-left: 20px;
    color: var(--stq-text-secondary);
    font-size: 14px;
}

.stq-triggers-list li {
    margin-bottom: 6px;
}

.stq-triggers-list li:last-child {
    margin-bottom: 0;
}

/* Assessment Box */
.stq-assessment-box {
    background-color: var(--stq-info-box-bg);
    border-radius: var(--stq-radius-sm);
    padding: 20px;
    margin-bottom: 24px;
}

.stq-assessment-label {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--stq-text-primary);
}

.stq-assessment-intro {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--stq-text-secondary);
    font-style: italic;
}

.stq-assessment-question {
    margin: 0;
    font-size: 14px;
    color: var(--stq-text-secondary);
    line-height: 1.6;
}

/* Answer Section */
.stq-answer-section {
    margin-bottom: 16px;
    position: relative;
    z-index: 15;
}

.stq-answer-buttons {
    display: flex;
    gap: 12px;
}

.stq-answer-btn {
    flex: 1;
    padding: 17px 32px;
    border: none;
    border-radius: var(--stq-radius-sm);
    background: #FE9A00;
    color: white;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--stq-transition);
    box-shadow: 0 10px 15px -3px rgba(254, 154, 0, 0.25);
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.stq-answer-btn:hover {
    background-color: #e68a00;
    transform: translateY(-1px);
    box-shadow: 0 12px 20px -3px rgba(254, 154, 0, 0.3);
}

.stq-answer-btn.stq-selected {
    background-color: #FE9A00;
    box-shadow: 0 10px 15px -3px rgba(254, 154, 0, 0.4);
}

.stq-answer-yes:hover {
    background-color: #e68a00;
}

.stq-answer-yes.stq-selected {
    background-color: #FE9A00;
}

.stq-answer-no:hover {
    background-color: #e68a00;
}

.stq-answer-no.stq-selected {
    background-color: #FE9A00;
}

/* Outcome Section */
.stq-outcome-section {
    padding-top: 16px;
}

.stq-outcome-divider {
    height: 1px;
    background-color: var(--stq-border-color);
    margin-bottom: 16px;
}

.stq-outcomes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stq-outcome {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.stq-outcome strong {
    font-weight: 700;
}

.stq-outcome-yes strong {
    color: var(--stq-success);
}

.stq-outcome-no strong {
    color: var(--stq-danger);
}

.stq-outcome span {
    color: var(--stq-text-secondary);
}

/* Highlight selected outcome */
.stq-step-card[data-answer="yes"] .stq-outcome-yes {
    background-color: rgba(34, 197, 94, 0.1);
    padding: 8px 12px;
    border-radius: var(--stq-radius-sm);
    margin: -8px -12px;
}

.stq-step-card[data-answer="no"] .stq-outcome-no {
    background-color: rgba(239, 68, 68, 0.1);
    padding: 8px 12px;
    border-radius: var(--stq-radius-sm);
    margin: -8px -12px;
}

/* Lead Capture Form */
.stq-lead-capture {
    margin-top: 40px;
}

.stq-lead-card {
    background: var(--stq-card-bg);
    border-radius: var(--stq-radius-lg);
    padding: 40px;
    box-shadow: var(--stq-shadow);
}

.stq-lead-header {
    text-align: center;
    margin-bottom: 32px;
}

.stq-lead-header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--stq-text-primary);
}

.stq-lead-header p {
    margin: 0;
    font-size: 14px;
    color: var(--stq-text-secondary);
}

.stq-lead-form {
    max-width: 500px;
    margin: 0 auto;
}

.stq-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stq-form-group {
    margin-bottom: 20px;
}

.stq-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--stq-text-primary);
    margin-bottom: 6px;
}

.stq-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--stq-border-color);
    border-radius: var(--stq-radius-sm);
    font-size: 16px;
    transition: var(--stq-transition);
}

.stq-form-group input:focus {
    outline: none;
    border-color: var(--stq-primary-color);
    box-shadow: 0 0 0 3px rgba(225, 113, 0, 0.1);
}

.stq-form-group input.stq-error {
    border-color: var(--stq-danger);
}

.stq-form-actions {
    margin-top: 24px;
}

.stq-submit-btn {
    width: 100%;
    padding: 17px 32px;
    background-color: #FE9A00;
    color: white;
    border: none;
    border-radius: var(--stq-radius-sm);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--stq-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 10px 15px -3px rgba(254, 154, 0, 0.25);
}

.stq-submit-btn:hover {
    background-color: #e68a00;
    transform: translateY(-1px);
    box-shadow: 0 12px 20px -3px rgba(254, 154, 0, 0.3);
}

.stq-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.stq-spinner {
    width: 20px;
    height: 20px;
    animation: stq-spin 1s linear infinite;
}

@keyframes stq-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.stq-privacy-note {
    margin-top: 16px;
    font-size: 12px;
    color: var(--stq-text-muted);
    text-align: center;
}

/* Results Section */
.stq-results-section {
    margin-top: 40px;
}

.stq-results-card {
    background: var(--stq-card-bg);
    border-radius: var(--stq-radius-lg);
    padding: 40px;
    box-shadow: var(--stq-shadow);
}

.stq-results-header {
    text-align: center;
    margin-bottom: 32px;
}

.stq-results-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--stq-text-primary);
}

/* Risk Indicator */
.stq-risk-indicator {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    border-radius: var(--stq-radius-md);
    margin-bottom: 24px;
}

.stq-risk-indicator.stq-risk-low {
    background-color: rgba(34, 197, 94, 0.1);
    border: 2px solid var(--stq-success);
}

.stq-risk-indicator.stq-risk-medium {
    background-color: rgba(245, 158, 11, 0.1);
    border: 2px solid var(--stq-warning);
}

.stq-risk-indicator.stq-risk-high {
    background-color: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--stq-danger);
}

.stq-risk-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stq-risk-low .stq-risk-icon {
    background-color: var(--stq-success);
}

.stq-risk-medium .stq-risk-icon {
    background-color: var(--stq-warning);
}

.stq-risk-high .stq-risk-icon {
    background-color: var(--stq-danger);
}

.stq-risk-icon::after {
    content: '';
    width: 30px;
    height: 30px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: brightness(0) invert(1);
}

.stq-risk-info {
    flex: 1;
}

.stq-risk-level {
    margin: 0 0 4px 0;
    font-size: 24px;
    font-weight: 700;
}

.stq-risk-low .stq-risk-level {
    color: var(--stq-success);
}

.stq-risk-medium .stq-risk-level {
    color: var(--stq-warning);
}

.stq-risk-high .stq-risk-level {
    color: var(--stq-danger);
}

.stq-risk-score {
    margin: 0;
    font-size: 14px;
    color: var(--stq-text-secondary);
}

.stq-risk-summary {
    font-size: 16px;
    line-height: 1.6;
    color: var(--stq-text-secondary);
    margin-bottom: 24px;
    padding: 20px;
    background-color: var(--stq-info-box-bg);
    border-radius: var(--stq-radius-sm);
}

.stq-risk-factors,
.stq-recommendations {
    margin-bottom: 24px;
}

.stq-risk-factors h4,
.stq-recommendations h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--stq-text-primary);
}

.stq-risk-factors ul,
.stq-recommendations ul {
    margin: 0;
    padding-left: 20px;
}

.stq-risk-factors li,
.stq-recommendations li {
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--stq-text-secondary);
    line-height: 1.5;
}

/* CTA Section */
.stq-cta-section {
    margin-top: 32px;
}

.stq-cta-card {
    background: linear-gradient(135deg, var(--stq-primary-color) 0%, #c96300 100%);
    border-radius: var(--stq-radius-lg);
    padding: 40px;
    text-align: center;
    color: white;
}

.stq-cta-card h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
}

.stq-cta-card p {
    margin: 0 0 24px 0;
    font-size: 16px;
    opacity: 0.9;
}

.stq-cta-btn {
    display: inline-block;
    padding: 16px 40px;
    background-color: white;
    color: var(--stq-primary-color);
    text-decoration: none;
    border-radius: var(--stq-radius-sm);
    font-size: 16px;
    font-weight: 700;
    transition: var(--stq-transition);
}

.stq-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 640px) {
    .stq-quiz-wrapper {
        padding: 24px 16px;
    }

    .stq-card-inner {
        padding: 24px;
    }

    .stq-card-header {
        flex-wrap: wrap;
    }

    .stq-step-title-group {
        flex: 1 1 calc(100% - 56px);
    }

    .stq-expand-btn {
        order: 3;
        margin-left: auto;
    }

    .stq-form-row {
        grid-template-columns: 1fr;
    }

    .stq-answer-buttons {
        flex-direction: column;
    }

    .stq-lead-card,
    .stq-results-card,
    .stq-cta-card {
        padding: 24px;
    }

    .stq-risk-indicator {
        flex-direction: column;
        text-align: center;
    }

    .stq-results-title {
        font-size: 22px;
    }
}

/* Dark Theme */
.stq-theme-dark {
    --stq-background: #0B1930;
    --stq-card-bg: #1D293D;
    --stq-info-box-bg: #0F172B;
    --stq-border-color: #2D3A4F;
    --stq-text-primary: #F8FAFC;
    --stq-text-secondary: #94A3B8;
    --stq-text-muted: #64748B;
    --stq-text-label: #94A3B8;
}

.stq-theme-dark .stq-form-group input {
    background-color: var(--stq-info-box-bg);
    color: var(--stq-text-primary);
}

/* Animation */
.stq-step-card {
    animation: stq-fadeIn 0.3s ease;
}

@keyframes stq-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stq-results-section,
.stq-lead-capture,
.stq-cta-section {
    animation: stq-slideUp 0.5s ease;
}

@keyframes stq-slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Results CTA Button */
.stq-results-cta {
    margin-top: 32px;
    text-align: center;
}

.stq-results-cta .stq-answer-btn,
.stq-contact-btn {
    display: inline-block;
    width: auto;
    min-width: 280px;
    padding: 17px 40px;
    text-decoration: none;
    text-align: center;
}

.stq-contact-btn:hover {
    text-decoration: none;
}
