/* ============================================
   Front-End Form Styles - Full RTL
   ============================================ */
/* ============================================
   Captcha Box
   ============================================ */

.ploi-captcha-box {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin: 25px 0;
    text-align: center;
}

.ploi-captcha-box label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.ploi-captcha-question {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #2196F3;
    background: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    border: 2px dashed #2196F3;
}

.ploi-captcha-question span {
    min-width: 20px;
    text-align: center;
}

#ploi-captcha-num1,
#ploi-captcha-num2 {
    background: #e3f2fd;
    padding: 4px 12px;
    border-radius: 6px;
}

#ploi-captcha-answer {
    width: 150px;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

#ploi-captcha-answer:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

#ploi-captcha-answer.captcha-error {
    border-color: #f44336;
    background: #fff5f5;
}

#ploi-captcha-error {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 500;
}

.ploi-front-form {
    max-width: 800px;
    margin: 30px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 30px;
    font-family: 'IRANSans', 'Vazir', Tahoma, Arial, sans-serif;
    direction: rtl;
    text-align: right;
}

/* Progress Bar */
.ploi-progress {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
    direction: ltr;
}

.ploi-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #2196F3);
    transition: width 0.4s ease;
    border-radius: 3px;
}

/* Steps Indicator */
.ploi-steps-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
    direction: rtl;
}

.ploi-steps-indicator::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #e9ecef;
    z-index: 0;
}

.ploi-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    color: #999;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.ploi-step::before {
    content: attr(data-step);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
}

.ploi-step.active {
    color: #2196F3;
}

.ploi-step.active::before {
    background: #2196F3;
    color: white;
}

.ploi-step.completed {
    color: #4CAF50;
}

.ploi-step.completed::before {
    background: #4CAF50;
    color: white;
}

/* Headings */
.ploi-front-form h2 {
    text-align: right;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    color: #333;
}

.ploi-front-form h3 {
    text-align: right;
    margin: 20px 0 15px 0;
    color: #555;
}

/* Form Groups */
.ploi-form-group {
    margin-bottom: 20px;
    text-align: right;
}

.ploi-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    text-align: right;
}

.ploi-form-group .required {
    color: #f44336;
}

.ploi-form-group input[type="text"],
.ploi-form-group input[type="email"],
.ploi-form-group input[type="number"],
.ploi-form-group input[type="url"],
.ploi-form-group input[type="date"],
.ploi-form-group textarea,
.ploi-form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
    background: #fafafa;
    text-align: right;
    direction: rtl;
}

.ploi-form-group input:focus,
.ploi-form-group textarea:focus,
.ploi-form-group select:focus {
    outline: none;
    border-color: #2196F3;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.ploi-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Checkbox styling */
.ploi-form-group input[type="checkbox"] {
    margin-left: 8px;
    margin-right: 0;
    width: auto;
}

.ploi-form-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

/* Buttons Container */
.ploi-form-step {
    text-align: right;
}

/* Clearfix for buttons */
.ploi-form-step::after {
    content: '';
    display: table;
    clear: both;
}

/* Buttons */
.ploi-next-step,
.ploi-prev-step,
#ploi-submit-final,
#ploi-add-deliverable {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.ploi-next-step {
    background: #2196F3;
    color: white;
    float: left;
}

.ploi-next-step:hover {
    background: #1976D2;
}

.ploi-prev-step {
    background: #f5f5f5;
    color: #666;
    float: right;
}

.ploi-prev-step:hover {
    background: #e0e0e0;
}

#ploi-submit-final {
    background: #4CAF50;
    color: white;
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

#ploi-submit-final:hover {
    background: #388E3C;
}

/* Deliverables */
.ploi-deliverable-row {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    text-align: right;
}

.ploi-deliverable-row input,
.ploi-deliverable-row textarea {
    margin-bottom: 8px;
    text-align: right;
    direction: rtl;
}

#ploi-add-deliverable {
    background: #fff;
    color: #2196F3;
    border: 2px dashed #2196F3;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
    font-family: inherit;
}

#ploi-add-deliverable:hover {
    background: #e3f2fd;
}

/* Placeholder styling */
.ploi-form-group input::placeholder,
.ploi-form-group textarea::placeholder {
    text-align: right;
    direction: rtl;
    color: #aaa;
}

/* Datepicker input */
.ploi-datepicker {
    text-align: right;
    direction: rtl;
}

/* Success Message */
#ploi-success-message {
    text-align: center;
    padding: 40px 20px;
}

#ploi-success-message h2 {
    color: #4CAF50;
    margin-bottom: 20px;
}

/* Loading */
.ploi-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Error state */
.ploi-form-group input.error,
.ploi-form-group textarea.error {
    border-color: #f44336;
    background: #fff5f5;
}

/* Responsive */
@media (max-width: 768px) {
    .ploi-front-form {
        margin: 15px;
        padding: 20px;
    }
    
    .ploi-steps-indicator {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .ploi-step {
        font-size: 11px;
    }
    
    .ploi-step::before {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
    
    .ploi-form-group input[type="text"],
    .ploi-form-group input[type="email"],
    .ploi-form-group input[type="number"],
    .ploi-form-group input[type="url"],
    .ploi-form-group input[type="date"] {
        padding: 8px 10px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .ploi-form-group textarea {
        font-size: 16px;
    }
    
    .ploi-next-step,
    .ploi-prev-step {
        width: 100%;
        float: none;
        margin-bottom: 10px;
        text-align: center;
    }
    
    .ploi-prev-step {
        order: 2;
    }
    
    .ploi-next-step {
        order: 1;
    }
}

@media (max-width: 480px) {
    .ploi-front-form {
        margin: 10px;
        padding: 15px;
    }
    
    .ploi-steps-indicator {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .ploi-step {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .ploi-step::before {
        margin-bottom: 0;
    }
    
    .ploi-steps-indicator::before {
        display: none;
    }
}
