body {
    font-family: 'Vazir', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #2b2b2b; /* Dark background as requested */
    color: #333333;
    direction: rtl; /* RTL */
}

.writr-container {
    display: flex;
    max-width: 1000px;
    margin: 40px auto;
    background-color: #ffffff; /* White section in the middle */
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
    min-height: 80vh;
}

/* Blue section on the right */
.writr-sidebar {
    width: 280px;
    background-color: #3498db; 
    color: #ffffff;
    padding: 50px 20px;
    text-align: center;
    flex-shrink: 0;
}

.site-logo {
    text-decoration: none;
    color: white;
    display: inline-block;
}

.sidebar-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px auto;
    display: block;
    background-color: transparent;
    filter: brightness(0) invert(1);
}

.site-title {
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 10px 0;
    color: white;
}

.site-description {
    font-size: 15px;
    font-weight: normal;
    margin: 0;
    opacity: 0.9;
    color: white;
    border-bottom: None;
}

/* White section in the middle */
.writr-main {
    flex-grow: 1;
    background-color: #ffffff;
    padding: 50px;
}

h2 {
    margin-top: 0;
    margin-bottom: 30px;
    font-weight: bold;
    color: #333333;
    font-size: 28px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 15px;
}

.error-message {
    color: #d9534f;
    font-size: 16px;
    margin-bottom: 20px;
    font-weight: bold;
    background-color: #fdf2f2;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #d9534f;
}

/* Form Styles */
form {
    margin-top: 30px;
}

.form-group {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.form-group label {
    flex: 0 0 160px;
    margin-bottom: 0;
    text-align: left;
    margin-left: 20px;
    color: #444;
    font-weight: bold;
    font-size: 14px;
}

.form-group .checkbox-group label {
    flex: 1;
    text-align: right;
    margin-left: 0;
    font-weight: normal;
    cursor: pointer;
}

.form-group .checkbox-group label input {
    margin-left: 8px;
    vertical-align: middle;
}

input[type="text"], 
input[type="email"], 
input[type="tel"], 
input[type="number"], 
select {
    flex: 1;
    max-width: 400px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 2px;
    box-sizing: border-box;
    font-family: 'Vazir', sans-serif;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fcfcfc;
}

input:focus, select:focus {
    border-color: #3498db;
    outline: none;
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}

#nc, #mobile, #birth_year {
    font-family: 'Vazir FD', 'Vazir', sans-serif;
    text-align: right;
    direction: ltr;
}

#email, #name_en, #family_en {
    text-align: left;
    direction: ltr;
}

input[readonly] {
    font-family: 'Vazir', sans-serif;
    background-color: #eee;
    color: #777;
    cursor: not-allowed;
}

/* Submit and Action Buttons */
.form-actions {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end; /* visual left in RTL */
}

.step2-actions {
    justify-content: left;
    gap: 15px;
}

.btn {
    padding: 12px 30px;
    background-color: #3498db;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: bold;
    font-family: 'Vazir', sans-serif;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* Step Progress Indicator */
.steps-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 20px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #999;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    transition: color 0.2s;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-family: 'Vazir FD', 'Vazir', sans-serif;
    transition: background-color 0.2s, color 0.2s;
}

.step-item.active {
    color: #3498db;
}

.step-item.active .step-number {
    background-color: #3498db;
    color: #ffffff;
}

.step-item.completed {
    color: #27ae60;
}

.step-item.completed .step-number {
    background-color: #27ae60;
    color: #ffffff;
}

.step-divider {
    flex: 1;
    max-width: 80px;
    height: 2px;
    background-color: #e0e0e0;
    margin: 0 15px;
}

.step-description {
    background-color: #f5f9fc;
    border-right: 4px solid #3498db;
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 4px;
    font-size: 14px;
    color: #444;
    line-height: 1.7;
}

.step-description ul {
    margin: 8px 0 0 0;
    padding-right: 20px;
}

.step-description li {
    margin-bottom: 4px;
}

.btn.loading {
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: button-loading-spinner 1s ease infinite;
}

@keyframes button-loading-spinner {
    from { transform: rotate(0turn); }
    to { transform: rotate(1turn); }
}

.amount-text {
    font-family: 'Vazir FD', 'Vazir', sans-serif;
    font-size: 18px;
    margin: 20px 0;
    color: #3498db;
    font-weight: bold;
    background-color: #f5f9fc;
    padding: 15px 40px;
    border-radius: 4px;
    display: block;
    box-sizing: border-box;
    text-align: center;
}

.price-old {
    color: #95a5a6;
    position: relative;
    display: inline-block;
    margin: 0 10px;
    font-size: 16px;
}

.price-old::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -5%;
    width: 110%;
    height: 1.5px;
    background-color: #e74c3c;
    transform: translateY(-50%) rotate(-12deg);
}

.price-new {
    margin: 0 5px;
}

.terms-label {
    display: block;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.8;
}

.terms-label input {
    margin-left: 8px;
    vertical-align: middle;
}

#submitBtn[data-enabled="false"] {
    opacity: 0.5;
    pointer-events: auto;
    cursor: not-allowed;
}

.course_img {
    width: 70%;
    height: auto;
    border-radius: 4px;
    margin: 0 auto 20px auto;
    display: block;
}

/* Success and Error page specific classes */
.result-box {
    text-align: center;
}

.ajax-result-box {
    display: none;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
}

.ajax-result-box.success {
    background-color: #f5f9fc;
    border-color: transparent;
    color: #3498db;
    font-weight: bold;
}

.ajax-result-box.error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.info-box {
    margin-bottom: 20px;
    padding: 15px;
    background: #e9ecef;
    border-radius: 8px;
    font-size: 0.9em;
    line-height: 1.5;
}

.logo-error, .logo-verify {
    height: 120px;
    margin-bottom: 30px;
}

.normal-text {
    font-size: 16px;
    color: #444;
    margin: 20px 0;
    line-height: 1.8;
}

.logo-main {
    height: 80px;
    margin-top: 40px;
    opacity: 0.8;
}

.footer-logos {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed #ddd;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .writr-container {
        flex-direction: column;
        margin: 0;
    }
    .writr-sidebar {
        width: 100%;
        padding: 30px 20px;
        box-sizing: border-box;
    }
    .writr-main {
        padding: 30px 20px;
    }
    .form-group {
        flex-direction: column;
        align-items: center;
    }
    .form-group label {
        width: 100%;
        max-width: 400px;
        text-align: right;
        margin-left: 0;
        margin-bottom: 8px;
        flex: none;
    }
    input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select {
        width: 100%;
    }
    .input-wrapper {
        width: 100%;
        max-width: 400px;
    }
    
    .amount-text {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
    }
    .amount-prices {
        display: flex;
        flex-direction: column;
        align-items: flex-end; /* Aligns to left in RTL */
    }
    .price-old {
        margin: 0 0 5px 0;
        display: inline-block; /* Keeps red line fitted to text */
    }
    .price-new {
        margin: 0;
    }
}

.input-wrapper {
    flex: 1;
    max-width: 400px;
    display: flex;
    flex-direction: column;
}

.input-wrapper input[type="text"],
.input-wrapper input[type="email"],
.input-wrapper input[type="tel"],
.input-wrapper input[type="number"],
.input-wrapper select {
    width: 100%;
    max-width: 100%;
}

.error-text {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: none;
    font-weight: bold;
}

.license-key-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #ffffff;
    border: 1px dashed #ccc;
    padding: 12px;
    border-radius: 4px;
    margin-top: 15px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    position: relative;
    direction: ltr;
}

.license-key-container:hover {
    background-color: #f9f9f9;
    border-color: #3498db;
}

.license-key {
    font-family: monospace;
    font-size: 1.2em;
    font-weight: bold;
    word-break: break-all;
    color: #333;
    margin: 0;
}

.copy-icon {
    flex-shrink: 0;
    color: #888;
    transition: color 0.2s;
}

.license-key-container:hover .copy-icon {
    color: #3498db;
}

.copy-tooltip {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
}

.license-key-container.copied .copy-tooltip {
    opacity: 1;
}
