/**
 * AJAX Steps Widget Stylesheet
 * Premium Logistics Aesthetic
 */

/* General Container Styling */
.naizex-steps-widget {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 40px;
    max-width: 100%;
    width: 100%;
    margin: 40px auto;
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #f8fafc;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.naizex-steps-widget * {
    box-sizing: border-box;
}

/* Header & Progress Indicator */
.naizex-steps-indicator-wrapper {
    margin-bottom: 40px;
    position: relative;
}

.naizex-steps-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
    text-align: center;
    position: relative;
    cursor: default;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.step-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

/* Active & Checked States */
.step-item.active .step-icon {
    background: #06b6d4;
    border-color: #06b6d4;
    color: #0f172a;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.5);
    transform: scale(1.15);
}

.step-item.active .step-label {
    color: #f8fafc;
}

.step-item.completed .step-icon {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.step-item.completed .step-label {
    color: #10b981;
}

/* Indicator Step Connector Arrows */
.step-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    height: 40px;
    margin-top: -20px;
}

.step-arrow svg {
    fill: rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    animation: arrowPulse 2s infinite ease-in-out;
}

.step-item.active + .step-arrow svg,
.step-item.completed + .step-arrow svg {
    fill: #06b6d4;
    filter: drop-shadow(0 0 5px rgba(6, 182, 212, 0.4));
}

@keyframes arrowPulse {
    0%, 100% {
        transform: translateX(0);
        opacity: 0.5;
    }
    50% {
        transform: translateX(4px);
        opacity: 1;
    }
}

/* Progress Bar Track */
.step-progress-bar-container {
    position: absolute;
    top: 20px;
    left: 50px;
    right: 50px;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 1;
}

.step-progress-bar-fill {
    height: 100%;
    width: 25%;
    background: linear-gradient(90deg, #06b6d4, #3b82f6);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Form Steps Animating Wrapper */
.naizex-steps-form-wrapper {
    position: relative;
    min-height: 380px;
}

.naizex-step-content {
    display: none;
    opacity: 0;
    width: 100%;
}

.naizex-step-content.active {
    display: block;
    opacity: 1;
}

/* Title & Description */
.naizex-step-question {
    font-size: 26px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.naizex-step-description {
    font-size: 15px;
    color: #94a3b8;
    margin-top: 0;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Cards Grid Layout */
.naizex-step-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 30px;
}

@media(min-width: 600px) {
    .naizex-step-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .naizex-step-cards-grid.volume-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Questionnaire Cards */
.naizex-step-card {
    background: rgba(30, 41, 59, 0.35);
    border: 1.5px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    user-select: none;
}

.naizex-steps-widget .naizex-step-card:hover {
    background: rgba(30, 41, 59, 0.6) !important;
    border-color: #06b6d4 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15) !important;
}

.naizex-steps-widget .naizex-step-card.selected {
    background: rgba(6, 182, 212, 0.08) !important;
    border-color: #06b6d4 !important;
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.2) !important;
}

.card-icon {
    font-size: 28px;
    width: 54px;
    height: 54px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.naizex-step-card:hover .card-icon {
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
    transform: scale(1.05);
}

.naizex-step-card.selected .card-icon {
    background: rgba(6, 182, 212, 0.2);
    border-color: rgba(6, 182, 212, 0.4);
    color: #22d3ee;
}

.card-icon svg {
    width: 30px;
    height: 30px;
    fill: #94a3b8;
    transition: fill 0.3s ease;
}

.naizex-step-card:hover .card-icon svg {
    fill: #06b6d4;
}

.naizex-step-card.selected .card-icon svg {
    fill: #22d3ee;
}

.card-content {
    flex-grow: 1;
}

.card-title {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #f1f5f9;
}

.card-desc {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.naizex-step-card:hover .card-desc {
    color: #94a3b8;
}

/* Card Selection Arrow */
.card-arrow {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.naizex-step-card:hover .card-arrow {
    opacity: 0.6;
    transform: translateX(0);
}

.naizex-step-card.selected .card-arrow {
    opacity: 1;
    transform: translateX(0);
}

.card-arrow svg {
    fill: #64748b;
    transition: fill 0.3s ease, transform 0.3s ease;
}

.naizex-step-card:hover .card-arrow svg {
    fill: #06b6d4;
    transform: scale(1.1);
}

.naizex-step-card.selected .card-arrow svg {
    fill: #06b6d4;
}

/* Navigation Buttons */
.naizex-step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.naizex-step-actions.text-right {
    justify-content: flex-end;
}

.btn-step {
    background: transparent;
    border: none;
    outline: none;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    color: #f8fafc;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    user-select: none;
}

.btn-prev {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

.btn-prev:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-prev:active {
    transform: scale(0.98);
}

.btn-next, .btn-submit {
    background: #06b6d4;
    color: #0f172a;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.4);
}

.btn-next:hover, .btn-submit:hover {
    background: #22d3ee;
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.6);
    transform: translateY(-1px);
}

.btn-next:active, .btn-submit:active {
    transform: scale(0.98);
}

.btn-next.disabled, .btn-next:disabled {
    background: rgba(30, 41, 59, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.03) !important;
    color: #475569 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}

.btn-arrow {
    fill: currentColor;
    transition: transform 0.3s ease;
}

.btn-next:hover .btn-arrow,
.btn-submit:hover .btn-arrow {
    transform: translateX(4px);
}

.btn-arrow-back {
    fill: currentColor;
    transition: transform 0.3s ease;
}

.btn-prev:hover .btn-arrow-back {
    transform: translateX(-4px);
}

/* Contact Lead Form Styling */
.naizex-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media(min-width: 600px) {
    .naizex-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    background: rgba(15, 23, 42, 0.5) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.2) !important; /* more visible border */
    border-radius: 10px !important;
    padding: 14px 18px !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-family: inherit !important;
    outline: none !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5) !important; /* clearly visible placeholder */
    opacity: 1 !important;
}

.form-control::-webkit-input-placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.form-control::-moz-placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
    opacity: 1 !important;
}

.form-control:-ms-input-placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.form-control::-ms-input-placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.form-control:focus {
    border-color: #06b6d4 !important;
    background: rgba(15, 23, 42, 0.8) !important;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.15) !important;
}

.form-control.invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.15) !important;
}

/* Form Validation Alert Box */
.naizex-validation-error-alert {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

/* Completion step */
.completion-step {
    text-align: center;
}

/* Checkmark Success Animation */
.naizex-completion-animation {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.checkmark-circle {
    width: 80px;
    height: 80px;
    position: relative;
}

.checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #10b981;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #10b981;
    animation: fillCheckmark .4s ease-in-out .4s forwards, scaleCheckmark .3s ease-in-out .9s unique;
}

.checkmark-circle-stroke {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #10b981;
    fill: none;
    animation: strokeCheckmark 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke-width: 3;
    stroke: #ffffff;
    animation: strokeCheckmark 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes strokeCheckmark {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes fillCheckmark {
    100% {
        box-shadow: inset 0px 0px 0px 40px #10b981;
    }
}

/* Results Strategy Panel */
.naizex-results-panel {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 30px;
    text-align: left;
    margin: 25px 0 35px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.results-title {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 20px;
    color: #38bdf8;
    font-weight: 700;
}

.results-plan {
    color: #cbd5e1;
    font-size: 15px;
    line-height: 1.6;
    margin-top: 0;
    margin-bottom: 20px;
}

.results-action-box {
    background: rgba(6, 182, 212, 0.05);
    border-left: 3px solid #06b6d4;
    padding: 16px 20px;
    border-radius: 0 10px 10px 0;
}

.results-action-box strong {
    display: block;
    color: #f8fafc;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.results-action {
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.btn-restart {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    margin: 0 auto;
}

.btn-restart svg {
    fill: currentColor;
    transition: transform 0.5s ease;
}

.btn-restart:hover svg {
    transform: rotate(-180deg);
}

/* AJAX Spinner Loader */
.naizex-submit-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(15, 23, 42, 0.3);
    border-radius: 50%;
    border-top-color: currentColor;
    animation: spinLoader 0.8s linear infinite;
    margin-left: 5px;
}

@keyframes spinLoader {
    to {
        transform: rotate(360deg);
    }
}

/* Step transition keyframe animations (JS applied) */
.slide-out-left {
    animation: slideOutLeft 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-in-right {
    animation: slideInRight 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-out-right {
    animation: slideOutRight 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-in-left {
    animation: slideInLeft 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideOutLeft {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-40px);
    }
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(40px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(40px);
    }
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-40px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Step 1 Service Details (Contrast Fix) */
.naizex-step-content[data-step="1"] .card-desc,
.naizex-step-content[data-step="1"] .naizex-step-card:hover .card-desc {
    color: #ffffff;
}

/* Mobile Responsive Optimization */
@media (max-width: 600px) {
    .naizex-steps-widget {
        padding: 24px 16px;
        margin: 20px auto;
    }
    
    .naizex-steps-indicator-wrapper {
        margin-bottom: 30px;
    }
    
    .step-arrow {
        display: none !important;
    }
    
    .step-item {
        width: 25% !important;
    }
    
    .step-progress-bar-container {
        left: 12.5% !important;
        right: 12.5% !important;
        top: 20px;
    }
    
    .step-label {
        font-size: 10px;
        letter-spacing: 0;
        line-height: 1.2;
    }
    
    .naizex-step-question {
        font-size: 20px;
    }
    
    .naizex-step-description {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .naizex-step-card {
        padding: 16px;
        gap: 14px;
    }
    
    .card-icon {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }
    
    .card-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .card-title {
        font-size: 15px;
    }
    
    .card-desc {
        font-size: 12px;
    }
    
    .naizex-step-actions {
        flex-direction: column-reverse;
        gap: 12px;
        align-items: stretch;
    }
    
    .btn-step {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 14px;
    }
}

/* Accessibility: prefers-reduced-motion fallback override */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-delay: -1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        background-attachment: initial !important;
        scroll-behavior: auto !important;
        transition-duration: 0s !important;
        transition-delay: 0s !important;
    }
    
    .slide-out-left, .slide-in-right, .slide-out-right, .slide-in-left {
        animation: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
    
    .naizex-step-card:hover {
        transform: none !important;
    }
    
    .step-arrow svg, .btn-restart svg {
        animation: none !important;
        transform: none !important;
    }
}
