:root {
    --cw-primary: #6366f1; /* رنگ اصلی بنفش مدرن */
    --cw-secondary: #4f46e5;
    --cw-bg: #f3f4f6;
    --cw-white: #ffffff;
    --cw-text: #1f2937;
    --cw-text-light: #6b7280;
    --cw-radius: 16px;
    --cw-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* چیدمان دو ستونه فیلدها */
.cw-row-inputs {
    display: flex;
    gap: 15px;
}
.cw-input-group.half {
    flex: 1;
}
/* استایل باکس کد رهگیری */
.cw-tracking-box {
    margin: 20px 0;
    text-align: center;
}
.cw-tracking-box label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #6b7280;
}
.tracking-input-wrapper {
    display: flex;
    max-width: 250px;
    margin: 0 auto;
    border: 2px dashed #6366f1;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f3ff;
}
#final-tracking-code {
    border: none;
    background: transparent;
    width: 100%;
    text-align: center;
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: bold;
    color: #4338ca;
    padding: 10px;
}
#final-tracking-code:focus { outline: none; }
#btn-copy-code {
    background: #6366f1;
    color: #fff;
    border: none;
    padding: 0 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: 0.2s;
}
#btn-copy-code:hover { background: #4f46e5; }

/* باکس وضعیت در پیام موفقیت */
.cw-status-alert {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fcd34d;
    padding: 10px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 0.9rem;
    font-weight: 500;
}
.cw-wrapper {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
    font-family: inherit; /* ارث‌بری فونت قالب */
    direction: rtl;
}

.cw-card {
    background: var(--cw-white);
    width: 100%;
    max-width: 500px;
    border-radius: var(--cw-radius);
    box-shadow: var(--cw-shadow);
    padding: 30px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.5);
}
#cw-lottie-anim {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px auto; /* وسط چین و کمی فاصله از پایین */
}

/* Header & Steps */
.cw-header h3 {
    text-align: center;
    color: var(--cw-text);
    margin-bottom: 25px;
    font-weight: 800;
}

.cw-progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
    padding: 0 20px;
}

.cw-line {
    flex-grow: 1;
    height: 3px;
    background: #e5e7eb;
    margin: 0 10px;
    border-radius: 2px;
}

.cw-step {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #e5e7eb;
    color: var(--cw-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.4s ease;
    z-index: 2;
}

.cw-step.active {
    background: var(--cw-primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

/* Form Steps */
.cw-form-step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.cw-form-step.active {
    display: block;
}

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

.cw-form-step h4 {
    margin-bottom: 20px;
    color: var(--cw-primary);
    font-size: 1.1rem;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 10px;
}

/* Inputs */
.cw-input-group {
    margin-bottom: 20px;
}

.cw-input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--cw-text);
    font-weight: 500;
}

.cw-input-group input, 
.cw-input-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    background: #f9fafb;
    color: var(--cw-text);
}

.cw-input-group input:focus, 
.cw-input-group select:focus {
    border-color: var(--cw-primary);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Buttons */
.cw-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 10px;
}

.cw-btn {
    padding: 12px 24px;
    border-radius: 8px !important;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 1rem;
}

.cw-btn-next, .cw-btn-submit {
    background: linear-gradient(135deg, var(--cw-primary), var(--cw-secondary));
    color: white !important;
    flex-grow: 1;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4);
}

.cw-btn-next:hover, .cw-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.5);
}

.cw-btn-prev {
    background: transparent;
    color: var(--cw-text-light);
    border: 2px solid #e5e7eb;
}

.cw-btn-prev:hover {
    background: #f3f4f6;
    color: var(--cw-text);
}

/* Validation Error Styles */
.cw-input-error {
    border-color: #ef4444 !important;
    animation: shake 0.3s;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

/* Success Message */
.cw-success-message {
    text-align: center;
    padding: 40px 0;
    animation: zoomIn 0.5s ease;
}

.cw-icon-box {
    width: 80px;
    height: 80px;
    background: #10b981;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
}

.cw-success-message h4 {
    color: #10b981;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* Loader */
.cw-loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid #fff;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: rotation 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}
.cw-btn-submit.loading .cw-loader { display: inline-block; }
.cw-btn-submit.loading .btn-text { display: none; }

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