/* assets/css/free-quote-steps.css */
/* Optimized styles for 4-step wizard - Intelligent Version */

/* ============================================
   4-STEP NAVIGATION
   ============================================ */

.steps-navigation {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    gap: 10px;
}

.step-indicator {
    flex: 1;
    min-width: 90px;
    text-align: center;
    cursor: pointer;
    padding: 15px 5px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(30, 30, 30, 0.5);
    border: 1px solid rgba(142, 3, 3, 0.1);
    position: relative;
    overflow: hidden;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(142, 3, 3, 0.1), transparent);
    transition: left 0.5s ease;
}

.step-indicator:hover::before {
    left: 100%;
}

.step-indicator:hover {
    background: rgba(142, 3, 3, 0.08);
    border-color: rgba(142, 3, 3, 0.4);
    transform: translateY(-2px);
}

.step-indicator.active {
    background: rgba(142, 3, 3, 0.12);
    border-color: #8e0303;
    box-shadow: 0 5px 15px rgba(142, 3, 3, 0.15);
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, rgba(142, 3, 3, 0.2), rgba(196, 30, 58, 0.2));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: 700;
    color: #fff;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.step-indicator.active .step-number {
    background: linear-gradient(135deg, #8e0303, #c41e3a);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(142, 3, 3, 0.3);
}

.step-label {
    font-size: 0.8rem;
    color: #9c9da2;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.step-indicator.active .step-label {
    color: #fff;
    font-weight: 600;
}

/* Connection line between steps */
.step-indicator:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 45%;
    right: -5px;
    width: 10px;
    height: 2px;
    background: rgba(142, 3, 3, 0.2);
    z-index: -1;
}

.step-indicator.active:not(:last-child)::after {
    background: linear-gradient(90deg, #8e0303, rgba(142, 3, 3, 0.3));
}

/* ============================================
   STEP CONTENT
   ============================================ */

.form-step {
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Step titles */
.form-step h3 {
    color: #fff;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(142, 3, 3, 0.3);
    position: relative;
}

.form-step h3 span {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #8e0303, #c41e3a);
    border-radius: 10px;
    text-align: center;
    line-height: 40px;
    margin-right: 15px;
    font-weight: 700;
    font-size: 1rem;
}

/* ============================================
   PROJECT TYPE CARDS
   ============================================ */

.project-type-card {
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 25px 20px;
    border-radius: 16px;
    background: rgba(30, 30, 30, 0.6);
    border: 2px solid rgba(142, 3, 3, 0.15);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.project-type-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8e0303, #c41e3a);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.project-type-card:hover {
    border-color: #8e0303;
    background: rgba(142, 3, 3, 0.08);
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.project-type-card:hover::before {
    transform: scaleX(1);
}

.project-type-card.active {
    border-color: #8e0303;
    background: rgba(142, 3, 3, 0.12);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(142, 3, 3, 0.2);
}

.project-type-card.active::before {
    transform: scaleX(1);
}

/* Icons in cards */
.project-type-card .icon-wrapper {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(142, 3, 3, 0.1), rgba(196, 30, 58, 0.1));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border: 1px solid rgba(142, 3, 3, 0.2);
    transition: all 0.3s ease;
}

.project-type-card.active .icon-wrapper {
    background: linear-gradient(135deg, rgba(142, 3, 3, 0.2), rgba(196, 30, 58, 0.2));
    border-color: #8e0303;
    transform: scale(1.05);
}

.project-type-card .icon-wrapper span {
    font-size: 1.8rem;
    transition: all 0.3s ease;
}

.project-type-card.active .icon-wrapper span {
    transform: scale(1.1);
}

/* ============================================
   INTELLIGENT FIELD GROUPS
   ============================================ */

.field-group {
    margin-bottom: 25px;
    position: relative;
}

.field-group label {
    color: #fff;
    font-weight: 500;
    margin-bottom: 10px;
    display: block;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

/* Contextual help */
.field-help {
    font-size: 0.8rem;
    color: rgba(156, 157, 162, 0.7);
    margin-top: 6px;
    font-style: italic;
    line-height: 1.4;
}

/* Required field indicator */
.field-group label::after {
    content: ' *';
    color: #8e0303;
    opacity: 0.8;
    font-weight: 700;
}

.field-group label:has(+ :not([required]))::after {
    content: '';
}

/* ============================================
   SIMPLIFIED BUDGET OPTIONS
   ============================================ */

.budget-option {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 18px 20px;
    border-radius: 12px;
    background: rgba(30, 30, 30, 0.5);
    border: 2px solid rgba(142, 3, 3, 0.15);
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.budget-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #8e0303, #c41e3a);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s ease;
}

.budget-option:hover {
    border-color: rgba(142, 3, 3, 0.4);
    background: rgba(142, 3, 3, 0.05);
    transform: translateX(5px);
}

.budget-option:hover::before {
    transform: scaleY(1);
}

.budget-option.selected {
    border-color: #8e0303;
    background: rgba(142, 3, 3, 0.1);
    box-shadow: 0 5px 15px rgba(142, 3, 3, 0.1);
}

.budget-option.selected::before {
    transform: scaleY(1);
}

.budget-label {
    display: flex;
    align-items: center;
    color: #fff;
    font-weight: 500;
    font-size: 1rem;
}

.budget-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(142, 3, 3, 0.4);
    border-radius: 6px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.budget-option.selected .budget-checkbox {
    background: linear-gradient(135deg, #8e0303, #c41e3a);
    border-color: #8e0303;
    box-shadow: 0 3px 8px rgba(142, 3, 3, 0.3);
}

.budget-option.selected .budget-checkbox::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
    transform: scale(1.2);
}

.budget-description {
    font-size: 0.85rem;
    color: rgba(156, 157, 162, 0.8);
    margin-left: 37px;
    margin-top: 5px;
    line-height: 1.4;
}

/* ============================================
   OPTIONAL UPLOAD AREA
   ============================================ */

.upload-area {
    border: 2px dashed rgba(142, 3, 3, 0.3);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    background: rgba(20, 20, 20, 0.5);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(142, 3, 3, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-area:hover {
    border-color: #8e0303;
    background: rgba(142, 3, 3, 0.05);
}

.upload-area:hover::before {
    opacity: 1;
}

.upload-area span {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
    color: rgba(142, 3, 3, 0.6);
    transition: all 0.3s ease;
}

.upload-area:hover span {
    color: #8e0303;
    transform: scale(1.1);
}

/* ============================================
   NAVIGATION BUTTONS
   ============================================ */

.step-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 25px;
    border-top: 1px solid rgba(142, 3, 3, 0.2);
    position: relative;
}

.step-buttons::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(142, 3, 3, 0.5), transparent);
}

.btn-step {
    padding: 14px 32px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-step::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.btn-step:hover::before {
    left: 100%;
}

.btn-step-prev {
    background: transparent;
    color: #9c9da2;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-step-prev:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(-5px);
}

.btn-step-next {
    background: linear-gradient(135deg, #8e0303, #c41e3a);
    color: white;
    box-shadow: 0 4px 12px rgba(142, 3, 3, 0.2);
}

.btn-step-next:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(142, 3, 3, 0.3);
}

.btn-step-skip {
    background: transparent;
    color: #8e0303;
    border: 1px solid rgba(142, 3, 3, 0.3);
    padding: 10px 20px;
    font-size: 0.85rem;
}

.btn-step-skip:hover {
    background: rgba(142, 3, 3, 0.1);
    border-color: #8e0303;
    transform: translateY(-2px);
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: #9c9da2;
    font-size: 0.9rem;
    font-weight: 500;
}

.progress-percentage {
    color: #8e0303;
    font-weight: 700;
    font-size: 1.1rem;
}

.progress-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    margin-bottom: 40px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #8e0303, #c41e3a);
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: progressShimmer 1.5s infinite;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ============================================
   VALIDATION AND STATES
   ============================================ */

.field-valid {
    border-color: rgba(81, 207, 102, 0.4) !important;
    background: rgba(81, 207, 102, 0.05) !important;
}

.field-invalid {
    border-color: rgba(255, 107, 107, 0.6) !important;
    background: rgba(255, 107, 107, 0.05) !important;
}

.validation-message {
    font-size: 0.85rem;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.validation-success {
    background: rgba(81, 207, 102, 0.1);
    color: #51cf66;
    border-left: 3px solid #51cf66;
}

.validation-error {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    border-left: 3px solid #ff6b6b;
}

/* ============================================
   LOADING STATES
   ============================================ */

.step-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.step-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: loadingShimmer 1.5s infinite;
    border-radius: 12px;
    z-index: 1;
}

@keyframes loadingShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .steps-navigation {
        gap: 5px;
        margin-bottom: 30px;
        padding-bottom: 10px;
    }
    
    .step-indicator {
        min-width: 70px;
        padding: 12px 3px;
    }
    
    .step-number {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
        margin-bottom: 8px;
    }
    
    .step-label {
        font-size: 0.7rem;
        letter-spacing: 0.3px;
    }
    
    .project-type-card {
        padding: 20px 15px;
    }
    
    .project-type-card .icon-wrapper {
        width: 50px;
        height: 50px;
        margin-bottom: 15px;
    }
    
    .budget-option {
        padding: 15px;
    }
    
    .budget-label {
        font-size: 0.95rem;
    }
    
    .budget-checkbox {
        width: 20px;
        height: 20px;
        margin-right: 12px;
    }
    
    .budget-description {
        margin-left: 32px;
        font-size: 0.8rem;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-area span {
        font-size: 2.5rem;
        margin-bottom: 10px;
    }
    
    .step-buttons {
        flex-direction: column;
        gap: 15px;
        margin-top: 40px;
    }
    
    .btn-step {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
    }
    
    .btn-step-prev:hover {
        transform: translateY(-5px);
    }
    
    .progress-info {
        font-size: 0.85rem;
    }
    
    .progress-percentage {
        font-size: 1rem;
    }
    
    /* Hide connection line on mobile */
    .step-indicator:not(:last-child)::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .steps-navigation {
        gap: 3px;
    }
    
    .step-indicator {
        min-width: 65px;
        padding: 10px 2px;
        border-radius: 8px;
    }
    
    .step-number {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
        margin-bottom: 6px;
    }
    
    .step-label {
        font-size: 0.65rem;
        letter-spacing: 0.2px;
    }
    
    .form-step h3 {
        font-size: 1.3rem;
    }
    
    .form-step h3 span {
        width: 35px;
        height: 35px;
        line-height: 35px;
        font-size: 0.9rem;
        margin-right: 10px;
    }
}

/* ============================================
   ADDITIONAL ANIMATIONS
   ============================================ */

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Active element with pulse */
.active-pulse {
    animation: pulse 2s infinite;
}

/* Smooth transition for dynamic fields */
.dynamic-field {
    animation: fadeInScale 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .form-step {
        animation: none;
    }
    
    .progress-bar::after {
        animation: none;
    }
}

/* Focus states for accessibility */
.btn-step:focus,
.project-type-card:focus,
.budget-option:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid #8e0303;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .step-indicator.active {
        border-width: 3px;
    }
    
    .budget-option.selected {
        border-width: 3px;
    }
    
    .project-type-card.active {
        border-width: 3px;
    }
}