/**
 * Brink Estimator - Quick Quote Wizard Styles
 * Matches Brink Design theme aesthetic
 */

/* CSS Variables - inherit from theme or set defaults */
:root {
    --estimator-primary: var(--color-accent, #4F46E5);
    --estimator-primary-dark: var(--color-accent-dark, #4338CA);
    --estimator-text: var(--color-text, #1f2937);
    --estimator-text-light: var(--color-text-light, #6b7280);
    --estimator-bg: var(--color-surface, #ffffff);
    --estimator-bg-alt: var(--color-surface-alt, #f9fafb);
    --estimator-border: var(--color-border, #e5e7eb);
    --estimator-success: #10b981;
    --estimator-error: #ef4444;
    --estimator-radius: var(--radius-lg, 12px);
    --estimator-radius-sm: var(--radius-sm, 6px);
    --estimator-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0,0,0,.1));
    --estimator-shadow-lg: var(--shadow-lg, 0 10px 15px -3px rgba(0,0,0,.1));
}

/* Main Container */
.brink-estimator {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--estimator-bg);
    border-radius: var(--estimator-radius);
    box-shadow: var(--estimator-shadow-lg);
}

@media (max-width: 640px) {
    .brink-estimator {
        padding: 1.25rem;
        border-radius: 0;
        margin: 0 -1rem;
    }
}

/* Progress Bar */
.estimator-progress {
    margin-bottom: 2rem;
}

.progress-bar {
    height: 4px;
    background: var(--estimator-border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: var(--estimator-primary);
    transition: width 0.3s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--estimator-bg-alt);
    border: 2px solid var(--estimator-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--estimator-text-light);
    transition: all 0.2s ease;
}

.step-dot.active {
    background: var(--estimator-primary);
    border-color: var(--estimator-primary);
    color: #fff;
}

.step-dot.completed {
    background: var(--estimator-primary);
    border-color: var(--estimator-primary);
    color: #fff;
}

/* Header */
.estimator-header {
    text-align: center;
    margin-bottom: 2rem;
}

.estimator-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--estimator-text);
    margin: 0 0 0.5rem;
}

.estimator-subtitle {
    font-size: 1rem;
    color: var(--estimator-text-light);
    margin: 0;
}

/* Step Titles */
.step-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--estimator-text);
    margin: 0 0 1.5rem;
}

.step-subtitle {
    font-size: 1rem;
    color: var(--estimator-text-light);
    margin: -1rem 0 1.5rem;
}

.section-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--estimator-text);
    margin: 2rem 0 0.5rem;
}

/* Back Button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: none;
    border: none;
    color: var(--estimator-text-light);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0;
    margin-bottom: 1rem;
    transition: color 0.2s ease;
}

.back-btn:hover {
    color: var(--estimator-text);
}

.back-btn svg {
    width: 18px;
    height: 18px;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 540px) {
    .category-grid {
        grid-template-columns: 1fr;
    }
}

.category-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--estimator-bg);
    border: 2px solid var(--estimator-border);
    border-radius: var(--estimator-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.category-card:hover {
    border-color: var(--estimator-primary);
    box-shadow: var(--estimator-shadow);
    transform: translateY(-2px);
}

.category-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--estimator-bg-alt);
    border-radius: var(--estimator-radius-sm);
    color: var(--estimator-primary);
}

.category-icon svg {
    width: 28px;
    height: 28px;
}

.category-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.category-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--estimator-text);
}

.category-desc {
    font-size: 0.8125rem;
    color: var(--estimator-text-light);
}

/* Field Groups */
.field-group {
    margin-bottom: 1.5rem;
}

.field-group > label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--estimator-text);
    margin-bottom: 0.5rem;
}

.field-hint {
    font-size: 0.8125rem;
    color: var(--estimator-text-light);
    margin: -0.25rem 0 0.75rem;
}

/* Inputs */
.field-group input[type="text"],
.field-group input[type="email"],
.field-group input[type="tel"],
.field-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--estimator-border);
    border-radius: var(--estimator-radius-sm);
    background: var(--estimator-bg);
    color: var(--estimator-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-group input:focus,
.field-group textarea:focus {
    outline: none;
    border-color: var(--estimator-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.field-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Field Rows */
.field-row {
    margin-bottom: 1rem;
}

.field-row.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 540px) {
    .field-row.two-col {
        grid-template-columns: 1fr;
    }
}

/* Range Slider */
.range-slider {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.range-slider input[type="range"] {
    flex: 1;
    height: 6px;
    background: var(--estimator-border);
    border-radius: 3px;
    -webkit-appearance: none;
    appearance: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--estimator-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.range-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

.range-slider output {
    min-width: 100px;
    padding: 0.375rem 0.75rem;
    background: var(--estimator-bg-alt);
    border-radius: var(--estimator-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--estimator-text);
    text-align: center;
}

/* Radio Cards */
.radio-cards {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.radio-cards.small .radio-card {
    min-width: 60px;
}

.radio-card {
    flex: 1;
    min-width: 120px;
}

.radio-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.radio-card .radio-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--estimator-bg);
    border: 2px solid var(--estimator-border);
    border-radius: var(--estimator-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.radio-card .radio-content strong {
    font-size: 0.9375rem;
    color: var(--estimator-text);
}

.radio-card .radio-content small {
    font-size: 0.75rem;
    color: var(--estimator-text-light);
}

.radio-card input:checked + .radio-content {
    border-color: var(--estimator-primary);
    background: rgba(79, 70, 229, 0.05);
}

.radio-card:hover .radio-content {
    border-color: var(--estimator-primary);
}

/* Checkbox Fields */
.checkbox-field {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 0;
}

.checkbox-field input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border: 2px solid var(--estimator-border);
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--estimator-primary);
}

.checkbox-label {
    font-size: 0.9375rem;
    color: var(--estimator-text);
}

.checkbox-label small {
    color: var(--estimator-success);
    font-weight: 600;
}

.checkbox-field.highlight {
    background: rgba(16, 185, 129, 0.08);
    padding: 0.75rem 1rem;
    border-radius: var(--estimator-radius-sm);
    margin-top: 0.5rem;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
}

@media (max-width: 540px) {
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}

/* Difficulty Section */
.difficulty-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--estimator-border);
}

/* Step Actions */
.step-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--estimator-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--estimator-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--estimator-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--estimator-shadow);
}

.btn-secondary {
    background: var(--estimator-bg-alt);
    color: var(--estimator-text);
    border: 2px solid var(--estimator-border);
}

.btn-secondary:hover {
    border-color: var(--estimator-primary);
    color: var(--estimator-primary);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* Package Grid */
.package-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .package-grid {
        grid-template-columns: 1fr;
    }
}

.package-card {
    position: relative;
    padding: 1.5rem;
    background: var(--estimator-bg);
    border: 2px solid var(--estimator-border);
    border-radius: var(--estimator-radius);
    text-align: center;
    transition: all 0.2s ease;
}

.package-card:hover {
    border-color: var(--estimator-primary);
    box-shadow: var(--estimator-shadow);
}

.package-card.recommended {
    border-color: var(--estimator-primary);
    transform: scale(1.02);
    box-shadow: var(--estimator-shadow-lg);
}

.package-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25rem 0.75rem;
    background: var(--estimator-bg-alt);
    border: 1px solid var(--estimator-border);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--estimator-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.package-badge.recommended-badge {
    background: var(--estimator-primary);
    border-color: var(--estimator-primary);
    color: #fff;
}

.package-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--estimator-text);
    margin: 0.75rem 0 0.5rem;
}

.package-price {
    margin-bottom: 1rem;
}

.price-range {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--estimator-primary);
}

.package-includes {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    text-align: left;
    font-size: 0.875rem;
    color: var(--estimator-text);
}

.package-includes li {
    position: relative;
    padding: 0.375rem 0 0.375rem 1.5rem;
    border-bottom: 1px solid var(--estimator-bg-alt);
}

.package-includes li:last-child {
    border-bottom: none;
}

.package-includes li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--estimator-success);
    font-weight: 600;
}

.package-card .select-tier-btn {
    width: 100%;
}

/* Disclaimer */
.disclaimer {
    font-size: 0.8125rem;
    color: var(--estimator-text-light);
    text-align: center;
    font-style: italic;
}

/* Estimate Summary (Step 4) */
.estimate-summary {
    text-align: center;
    margin-bottom: 2rem;
}

.summary-card {
    display: inline-flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem 2.5rem;
    background: var(--estimator-bg-alt);
    border-radius: var(--estimator-radius);
    margin: 1rem 0;
}

.summary-project {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.summary-category {
    font-weight: 600;
    color: var(--estimator-text);
}

.summary-tier {
    color: var(--estimator-text-light);
}

.summary-estimate {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.summary-label {
    font-size: 0.75rem;
    color: var(--estimator-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--estimator-primary);
}

.summary-note {
    font-size: 0.9375rem;
    color: var(--estimator-text-light);
    max-width: 400px;
    margin: 0 auto;
}

/* Contact Fields */
.contact-fields {
    margin-bottom: 1.5rem;
}

/* Privacy Note */
.privacy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    font-size: 0.8125rem;
    color: var(--estimator-text-light);
}

.privacy-note svg {
    color: var(--estimator-success);
}

/* Error Message */
.estimator-error {
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--estimator-error);
    border-radius: var(--estimator-radius-sm);
    color: var(--estimator-error);
    font-size: 0.9375rem;
    margin-bottom: 1rem;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Success State */
.estimator-success {
    text-align: center;
    padding: 2rem 1rem;
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    margin-bottom: 1.5rem;
}

.success-icon svg {
    color: var(--estimator-success);
}

.success-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--estimator-text);
    margin: 0 0 0.5rem;
}

.success-message {
    font-size: 1rem;
    color: var(--estimator-text-light);
    margin: 0 0 1.5rem;
}

.success-summary {
    display: inline-flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.25rem 2rem;
    background: var(--estimator-bg-alt);
    border-radius: var(--estimator-radius);
    margin-bottom: 1.5rem;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    font-size: 0.9375rem;
}

.summary-line span {
    color: var(--estimator-text-light);
}

.summary-line strong {
    color: var(--estimator-text);
}

.next-steps {
    font-size: 0.9375rem;
    color: var(--estimator-text-light);
    max-width: 400px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.next-steps strong {
    display: block;
    color: var(--estimator-text);
    margin-bottom: 0.5rem;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --estimator-text: #f3f4f6;
        --estimator-text-light: #9ca3af;
        --estimator-bg: #1f2937;
        --estimator-bg-alt: #111827;
        --estimator-border: #374151;
    }
}

/* If theme has dark class */
.dark .brink-estimator,
[data-theme="dark"] .brink-estimator {
    --estimator-text: #f3f4f6;
    --estimator-text-light: #9ca3af;
    --estimator-bg: #1f2937;
    --estimator-bg-alt: #111827;
    --estimator-border: #374151;
}
