:root {
    --kcc-primary: #2563eb;
    --kcc-secondary: #1e40af;
    --kcc-accent: #3b82f6;
    --kcc-glass-bg: rgba(255, 255, 255, 0.95);
    /* Increased opacity for readability */
    --kcc-glass-border: rgba(255, 255, 255, 0.5);
    --kcc-text: #1f2937;
    --kcc-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

/* Base Reset for Wrapper to avoid Theme Conflicts */
#kcc-calculator-wrapper {
    background: var(--kcc-glass-bg) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--kcc-glass-border);
    border-radius: 16px;
    box-shadow: var(--kcc-shadow);
    padding: 2rem !important;
    max-width: 800px;
    margin: 2rem auto;
    font-family: 'Inter', sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial;
    color: var(--kcc-text) !important;
    box-sizing: border-box;
}

#kcc-calculator-wrapper * {
    box-sizing: border-box;
}

/* Progress Bar */
.kcc-progress-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    margin-bottom: 2rem;
    overflow: hidden;
    width: 100%;
}

.kcc-progress-fill {
    height: 100%;
    background: var(--kcc-primary) !important;
    width: 20%;
    transition: width 0.3s ease;
    display: block !important;
}

/* Steps - CRITICAL VISIBILITY FIXES */
.kcc-step {
    display: none !important;
    /* Force hide inactive */
}

.kcc-step.active {
    display: block !important;
    /* Force show active */
    opacity: 1 !important;
    visibility: visible !important;
    width: 100%;
}

/* Cards & Grids */
.kcc-grid-options {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.kcc-option-card {
    background: white !important;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.kcc-option-card:hover {
    transform: translateY(-2px);
    border-color: var(--kcc-accent);
}

.kcc-option-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.kcc-option-card:has(input:checked),
/* Modern browsers */
.kcc-option-card.checked

/* JS Fallback if needed */
    {
    border-color: var(--kcc-primary) !important;
    background: #eff6ff !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Legacy support for :has */
input:checked+.kcc-card-content {
    /* fallback logic usually handled by parent selector or JS */
}

.kcc-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.kcc-title {
    font-weight: 700;
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.kcc-desc {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Inputs */
.kcc-input-group {
    margin-bottom: 1.5rem;
}

.kcc-input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--kcc-text);
}

.kcc-input-group input,
.kcc-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db !important;
    border-radius: 8px;
    font-size: 1rem;
    background: white !important;
    color: #000 !important;
}

/* Buttons */
button.kcc-btn-next,
button.kcc-btn-submit {
    background: var(--kcc-primary) !important;
    color: white !important;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-block;
    font-size: 1rem;
}

button.kcc-btn-next:hover {
    background: var(--kcc-secondary) !important;
}

button.kcc-btn-prev {
    background: transparent !important;
    color: #6b7280 !important;
    border: 1px solid #d1d5db !important;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    margin-right: 1rem;
    cursor: pointer;
}

/* Results */
.kcc-result-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 1.5rem;
    border: 1px solid #e5e7eb;
}

.kcc-total-price {
    font-size: 3rem;
    font-weight: 800;
    color: var(--kcc-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.kcc-price-range {
    color: #6b7280;
    font-size: 1.125rem;
}

.kcc-finance-card {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 2rem;
}

.kcc-finance-amount {
    font-size: 1.75rem;
    font-weight: bold;
}

/* Breakdown & CTA */
.kcc-breakdown-list {
    text-align: left;
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    color: #374151;
}

.kcc-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.kcc-item:last-child {
    border-bottom: none;
    font-size: 1.1rem;
    margin-top: 1rem;
    color: #111827;
}

.kcc-cta-section {
    text-align: center;
    background: #eff6ff;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #bfdbfe;
}

.kcc-btn-primary-cta {
    display: inline-block;
    background: #16a34a !important;
    color: white !important;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    margin: 1rem 0;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 4px 6px rgba(22, 163, 74, 0.3);
    cursor: pointer;
    border: none;
}

.kcc-btn-primary-cta:hover {
    background: #15803d !important;
    transform: translateY(-2px);
}

.kcc-btn-secondary-cta {
    background: transparent !important;
    color: #4b5563 !important;
    border: 1px solid #9ca3af !important;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 0.5rem;
}