/* 
 * Quote Funnel Styles
 * Scoped to .qf wrapper to prevent theme conflicts
 */

.qf {
    /* CSS Variables - can be overridden by funnel JSON theme config */
    --qf-primary: #2563eb;
    --qf-background: #ffffff;
    --qf-text: #1f2937;
    --qf-muted: #64748b;
    --qf-radius: 8px;
    --qf-panel: #ffffff;
    
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
}

/* Container */
.qf-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
}

/* Header */
.qf-header {
    text-align: center;
    margin-bottom: 40px;
}

.qf-headline {
    font-size: 32px;
    font-weight: 700;
    color: var(--qf-text);
    margin: 0 0 12px 0;
}

.qf-subheadline {
    font-size: 16px;
    color: var(--qf-muted);
    margin: 0;
}

/* Progress Bar */
.qf-progress-container {
    margin-bottom: 32px;
}

.qf-progress-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.qf-progress-fill {
    height: 100%;
    background: var(--qf-primary);
    transition: width 0.3s ease;
    border-radius: 999px;
}

.qf-progress-text {
    margin-top: 8px;
    font-size: 14px;
    color: var(--qf-muted);
    text-align: center;
}

/* Step Container */
.qf-step {
    display: none;
    animation: qfFadeIn 0.3s ease;
}

.qf-step.qf-active {
    display: block;
}

@keyframes qfFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qf-step-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--qf-text);
    margin: 0 0 8px 0;
}

.qf-step-description {
    font-size: 15px;
    color: var(--qf-muted);
    margin: 0 0 24px 0;
}

/* Form Fields */
.qf-question {
    margin-bottom: 28px;
}

.qf-question.qf-hidden {
    display: none;
}

.qf-label {
    display: block;
    font-weight: 500;
    color: var(--qf-text);
    margin-bottom: 8px;
    font-size: 15px;
}

.qf-label-required::after {
    content: " *";
    color: #dc2626;
}

.qf-help {
    display: block;
    font-size: 13px;
    color: var(--qf-muted);
    margin-top: 4px;
}

/* Text Inputs */
.qf-input,
.qf-select,
.qf-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: var(--qf-radius);
    font-size: 15px;
    color: var(--qf-text);
    background: var(--qf-panel);
    transition: all 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.qf-input:focus,
.qf-select:focus,
.qf-textarea:focus {
    outline: none;
    border-color: var(--qf-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.qf-textarea {
    min-height: 100px;
    resize: vertical;
}

.qf-input.qf-error,
.qf-select.qf-error,
.qf-textarea.qf-error {
    border-color: #dc2626;
}

.qf-error-message {
    display: block;
    color: #dc2626;
    font-size: 13px;
    margin-top: 6px;
}

/* Radio/Checkbox Options */
.qf-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qf-option {
    position: relative;
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: var(--qf-radius);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--qf-panel);
}

.qf-option:hover {
    border-color: var(--qf-primary);
    background: rgba(37, 99, 235, 0.02);
}

.qf-option input[type="radio"],
.qf-option input[type="checkbox"] {
    margin-right: 12px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--qf-primary);
}

.qf-option-label {
    flex: 1;
    font-size: 15px;
    color: var(--qf-text);
    cursor: pointer;
    user-select: none;
}

.qf-option.qf-selected {
    border-color: var(--qf-primary);
    background: rgba(37, 99, 235, 0.05);
}

/* Buttons */
.qf-buttons {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.qf-btn {
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--qf-radius);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
}

.qf-btn-primary {
    background: var(--qf-primary);
    color: white;
    flex: 1;
}

.qf-btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.qf-btn-secondary {
    background: transparent;
    color: var(--qf-text);
    border: 2px solid #e5e7eb;
}

.qf-btn-secondary:hover:not(:disabled) {
    border-color: var(--qf-primary);
    background: rgba(37, 99, 235, 0.05);
}

.qf-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Review Screen */
.qf-review-table {
    border: 2px solid #e5e7eb;
    border-radius: var(--qf-radius);
    overflow: hidden;
    margin-bottom: 24px;
}

.qf-review-row {
    display: flex;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.qf-review-row:last-child {
    border-bottom: none;
}

.qf-review-label {
    flex: 0 0 40%;
    font-weight: 500;
    color: var(--qf-muted);
    font-size: 14px;
}

.qf-review-value {
    flex: 1;
    color: var(--qf-text);
    font-size: 14px;
}

/* Price Display */
.qf-price-display {
    background: #f0f9ff;
    border: 2px solid #3b82f6;
    border-radius: var(--qf-radius);
    padding: 20px;
    margin: 24px 0;
    text-align: center;
}

.qf-price-label {
    font-size: 13px;
    color: #1e40af;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.qf-price-range {
    font-size: 28px;
    font-weight: 700;
    color: #1e3a8a;
}

.qf-price-note {
    font-size: 12px;
    color: #3b82f6;
    margin-top: 8px;
}

/* Success Screen */
.qf-success {
    text-align: center;
    padding: 40px 20px;
}

.qf-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
}

.qf-success-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--qf-text);
    margin: 0 0 12px 0;
}

.qf-success-body {
    font-size: 16px;
    color: var(--qf-muted);
    margin: 0;
}

/* Loading State */
.qf-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: qfSpin 0.8s linear infinite;
}

@keyframes qfSpin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 640px) {
    .qf-container {
        padding: 16px;
        margin: 20px auto;
    }
    
    .qf-headline {
        font-size: 24px;
    }
    
    .qf-step-title {
        font-size: 20px;
    }
    
    .qf-buttons {
        flex-direction: column-reverse;
    }
    
    .qf-review-row {
        flex-direction: column;
        gap: 4px;
    }
    
    .qf-review-label {
        flex: none;
    }
}
