/**
 * Premium Styling for Renovation Calculator
 * Colors are controlled via CSS custom properties injected by PHP.
 */

/* Default CSS custom properties (overridden by inline style from PHP) */
.rc-calculator-wrapper {
    --rc-primary: #3b82f6;
    --rc-secondary: #10b981;
    --rc-bg: #ffffff;
    --rc-text: #1e293b;
}

/* =====================================================
   BASE WRAPPER
   ===================================================== */
.rc-calculator-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 820px;
    margin: 40px auto;
    color: #333;
}

.rc-calculator-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.10);
    padding: 40px;
    position: relative;
    overflow: hidden;
}

/* =====================================================
   PROGRESS BAR
   ===================================================== */
.rc-wizard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.rc-wizard-progress::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 3px;
    background: #e2e8f0;
    z-index: 1;
    transform: translateY(-50%);
}

.rc-progress-step {
    background: #e2e8f0;
    border: 3px solid #e2e8f0;
    color: #64748b;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    z-index: 2;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.rc-progress-step.active {
    background: var(--rc-primary);
    border-color: var(--rc-primary);
    color: #fff;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--rc-primary) 35%, transparent);
}

.rc-progress-step.completed {
    background: var(--rc-secondary);
    border-color: var(--rc-secondary);
    color: #fff;
}

/* =====================================================
   WIZARD STEPS
   ===================================================== */
.rc-wizard-step {
    display: none;
    animation: rcFadeIn 0.35s ease forwards;
}

.rc-wizard-step.rc-active {
    display: block;
}

@keyframes rcFadeIn {
    from {
        opacity: 0;
        transform: translateX(16px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.rc-step-title {
    font-size: 22px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 6px;
    color: #1e293b;
}

.rc-step-desc {
    color: #64748b;
    margin-bottom: 24px;
    font-size: 15px;
}

/* =====================================================
   SERVICE / QUALITY CARDS
   ===================================================== */
.rc-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.rc-card-label {
    cursor: pointer;
    display: block;
}

.rc-card-label input[type="radio"],
.rc-card-label input[type="checkbox"] {
    display: none;
}

.rc-card-content {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 22px 14px;
    text-align: center;
    transition: all 0.2s ease;
    background: #f8fafc;
    height: 100%;
    box-sizing: border-box;
}

.rc-card-label:hover .rc-card-content {
    border-color: #93c5fd;
    background: #f0f9ff;
}

.rc-card-icon {
    color: #94a3b8;
    margin-bottom: 10px;
    transition: color 0.2s ease;
}

.rc-card-title {
    font-weight: 600;
    font-size: 15px;
    color: #475569;
    transition: color 0.2s ease;
}

/* Selected state */
.rc-card-label input:checked+.rc-card-content {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.18);
}

.rc-card-label input:checked+.rc-card-content .rc-card-icon,
.rc-card-label input:checked+.rc-card-content .rc-card-title {
    color: #2563eb;
}

/* =====================================================
   FORM INPUTS
   ===================================================== */
.rc-form-group {
    margin-bottom: 18px;
}

.rc-form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    margin-bottom: 7px;
}

.rc-form-group input[type="number"],
.rc-form-group input[type="text"],
.rc-form-group input[type="email"],
.rc-form-group input[type="tel"],
.rc-large-input input {
    width: 100%;
    padding: 13px 16px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #1e293b;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    outline: none;
    background: #fff;
}

.rc-large-input input {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    padding: 18px;
}

.rc-form-group input:focus,
.rc-large-input input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.rc-form-row {
    display: flex;
    gap: 16px;
}

.rc-half {
    flex: 1;
}

/* =====================================================
   EXTRAS CHECKBOXES
   ===================================================== */
.rc-step-extras {
    margin-top: 20px;
}

.rc-step-extras h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #374151;
}

.rc-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rc-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 11px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    color: #475569;
    transition: background 0.15s;
}

.rc-checkbox-label:hover {
    background: #f8fafc;
}

.rc-checkbox-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin-right: 10px;
    accent-color: #3b82f6;
    flex-shrink: 0;
}

/* =====================================================
   WIZARD NAVIGATION BUTTONS
   ===================================================== */
.rc-wizard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.rc-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rc-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
}

.rc-btn-primary {
    background: var(--rc-primary);
    color: #fff;
    margin-left: auto;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--rc-primary) 30%, transparent);
}

.rc-btn-primary:not(:disabled):hover {
    background: color-mix(in srgb, var(--rc-primary) 80%, black);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--rc-primary) 40%, transparent);
}

.rc-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.rc-btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.rc-btn-success {
    background: linear-gradient(135deg, var(--rc-secondary), color-mix(in srgb, var(--rc-secondary) 80%, black));
    color: #fff;
    margin-left: auto;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--rc-secondary) 30%, transparent);
}

.rc-btn-success:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--rc-secondary) 40%, transparent);
}

/* =====================================================
   RESULT STEP - PRICE BOX
   ===================================================== */
.rc-final-price-box {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 2px solid #bfdbfe;
    border-radius: 14px;
    padding: 30px;
    text-align: center;
    margin-bottom: 24px;
}

.rc-total-value {
    font-size: 52px;
    font-weight: 800;
    color: #1d4ed8;
    display: block;
    letter-spacing: -1px;
}

/* =====================================================
   PRICE BREAKDOWN
   ===================================================== */
.rc-price-breakdown {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 22px;
}

.rc-bd-item {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px dashed #e2e8f0;
    color: #475569;
    font-size: 14px;
}

.rc-bd-item:last-child {
    border-bottom: none;
}

.rc-bd-total {
    font-weight: 700;
    color: #1e293b;
    font-size: 16px;
    padding-top: 12px;
    margin-top: 4px;
    border-top: 2px solid #cbd5e1 !important;
    border-bottom: none !important;
}

/* =====================================================
   LOCKED PRICE VIEW
   ===================================================== */
.rc-locked-content {
    text-align: center;
    padding: 20px 0 10px;
}

.rc-lock-icon {
    color: #f59e0b;
    margin-bottom: 16px;
}

/* =====================================================
   LEAD FORM AREA
   ===================================================== */
.rc-lead-form {
    margin-top: 20px;
}

/* =====================================================
   MESSAGES
   ===================================================== */
.rc-message {
    margin-top: 18px;
    padding: 14px 18px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    font-size: 15px;
}

.rc-message.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.rc-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 640px) {
    .rc-calculator-box {
        padding: 24px 18px;
    }

    .rc-wizard-progress {
        gap: 6px;
    }

    .rc-progress-step {
        padding: 6px 10px;
        font-size: 11px;
    }

    .rc-form-row {
        flex-direction: column;
        gap: 0;
    }

    .rc-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .rc-total-value {
        font-size: 38px;
    }
}

/* =====================================================
   COMPACT LAYOUT MODE
   ===================================================== */
[data-layout="compact"] .rc-wizard-progress {
    display: none !important;
}

[data-layout="compact"] .rc-wizard-step.rc-compact-visible {
    margin-bottom: 35px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e2e8f0;
}

[data-layout="compact"] .rc-wizard-step.rc-compact-visible:last-of-type {
    border-bottom: none;
}

[data-layout="compact"] .rc-step-title {
    font-size: 20px;
}

[data-layout="compact"] .rc-calculate-btn {
    width: 100%;
    padding: 16px;
    font-size: 17px;
}

[data-layout="compact"] .rc-calculator-box {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

/* =====================================================
   MULTI-SERVICE DYNAMIC BLOCKS
   ===================================================== */
.rc-service-detail-block {
    margin-bottom: 25px;
    padding: 20px;
    background: #fdfdfd;
    border-radius: 12px;
    border: 1px solid #edf2f7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.rc-service-block-title {
    margin-top: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--rc-primary);
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 12px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rc-service-block-title::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 18px;
    background: var(--rc-primary);
    border-radius: 3px;
}

.rc-service-extras-sub {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #e2e8f0;
}

.rc-extras-label {
    font-size: 14px;
    color: #475569;
    margin-bottom: 10px;
}

.rc-service-sep {
    border: none;
    border-top: 2px solid #f1f5f9;
    margin: 30px 0;
}

.rc-service-sep:last-child {
    display: none;
}

.rc-bd-service-section {
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 15px;
}

.rc-bd-service-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.rc-bd-header {
    font-weight: 600;
    color: #1e293b;
    font-size: 15px;
}

.rc-bd-sub {
    font-size: 13px;
    color: #64748b;
    padding-left: 12px;
}

/* =====================================================
   LOGISTICS STEP
   ===================================================== */
.rc-logistics-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.rc-logistics-item {
    margin-bottom: 20px;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 15px;
}

.rc-logistics-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.rc-logistics-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Premium Radio Toggle */
.rc-logistics-choices {
    display: flex;
    gap: 12px;
}

.rc-choice-label {
    flex: 1;
    cursor: pointer;
    position: relative;
}

.rc-choice-label input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.rc-choice-text {
    display: block;
    padding: 12px;
    text-align: center;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-weight: 600;
    color: #475569;
    transition: all 0.2s ease;
}

.rc-choice-label input:checked+.rc-choice-text {
    background: var(--rc-primary);
    border-color: var(--rc-primary);
    color: #fff;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--rc-primary) 25%, transparent);
}

.rc-choice-label:hover .rc-choice-text {
    border-color: #93c5fd;
    background: #eef2f7;
}

/* Modern Toggle Switch (Legacy/Backup) */
.rc-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
}

.rc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.rc-switch-slider {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
    background-color: #e2e8f0;
    border-radius: 22px;
    transition: .3s;
}

.rc-switch-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: .3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rc-switch input:checked+.rc-switch-slider {
    background-color: var(--rc-primary);
}

.rc-switch input:checked+.rc-switch-slider:before {
    transform: translateX(22px);
}

/* Logistics Breakdown Styling */
.rc-bd-logistics-section {
    border-top: 1px solid #e2e8f0;
    margin-top: 25px;
    padding-top: 20px;
    margin-bottom: 20px;
}

.rc-bd-logistics-title {
    font-weight: 700;
    font-size: 13px;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.rc-bd-logistics {
    font-style: italic;
    color: #64748b;
    margin-bottom: 8px;
}

.rc-bd-logistics span:first-child {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rc-bd-logistics span:first-child::before {
    content: '•';
    color: var(--rc-primary);
}

.rc-input.widefat {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #fff;
    font-size: 15px;
}

.rc-input.widefat:focus {
    border-color: var(--rc-primary);
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--rc-primary) 15%, transparent);
}