* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}        

body {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 650px;
    margin: 0 auto;
    background: white;
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    direction: rtl;
    position: relative;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    animation: gradient-move 3s ease-in-out infinite;
}

@keyframes gradient-move {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 50px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    animation: float 20s linear infinite;
}

@keyframes float {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.header h1 {
    font-size: 2.8em;
    margin-bottom: 15px;
    font-weight: 700;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
    font-size: 1.2em;
    opacity: 0.95;
    position: relative;
    z-index: 2;
    font-weight: 400;
}

.form-container {
    padding: 50px 40px;
}

.form-section {
    background: linear-gradient(145deg, #f8f9ff 0%, #ffffff 100%);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    border: 1px solid #e8ecff;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.08);
    position: relative;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 0 20px 20px 0;
}

.section-title {
    font-size: 1.4em;
    color: #667eea;
    margin-bottom: 25px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

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

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.05em;
    transition: color 0.3s ease;
}

.required {
    color: #e74c3c;
    font-weight: 700;
    margin-right: 3px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 18px 20px;
    border: 2px solid #e8ecff;
    border-radius: 15px;
    font-size: 16px;
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(145deg, #fbfcff 0%, #ffffff 100%);
    direction: rtl;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.06);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #a0a6b8;
    font-weight: 400;
}

.radio-group {
    display: grid;
    gap: 12px;
    margin-top: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    border: 2px solid #e8ecff;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(145deg, #fbfcff 0%, #ffffff 100%);
    position: relative;
    overflow: hidden;
    flex-direction: row-reverse;
    gap: 10px;
}

.radio-option input[type="checkbox"] {
    flex: 0 0 20px; /* fixed width for alignment */
    margin: 0;
}

.radio-option label {
    flex: none;
    white-space: nowrap;
}

.radio-option::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: right 0.5s ease;
}

.radio-option:hover {
    border-color: #667eea;
    background: linear-gradient(145deg, #f0f4ff 0%, #ffffff 100%);
    transform: translateX(-5px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.15);
}

.radio-option:hover::before {
    right: 100%;
}

.radio-option input[type="radio"] {
    margin-left: 15px;
    transform: scale(1.3);
    accent-color: #667eea;
}

.radio-option.selected {
    border-color: #667eea;
    background: linear-gradient(145deg, #f0f4ff 0%, #ffffff 100%);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
    transform: translateX(-5px);
}

.radio-option label {
    flex: 1;
    cursor: pointer;
    font-weight: 500;
    margin: 0;
}

textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.validation-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 8px;
    display: none;
    font-weight: 500;
    padding: 8px 12px;
    background: #ffeaea;
    border-radius: 8px;
    border-right: 3px solid #e74c3c;
}

.validation-message.show {
    display: block;
    animation: slideIn 0.3s ease;
}

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

.field-hint {
    font-size: 13px;
    color: #7f8c8d;
    margin-top: 6px;
    display: block;
    font-weight: 400;
}

.form-group input.error,
.form-group textarea.error {
    border-color: #e74c3c;
    background: #ffeaea;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
}

.form-group input.valid,
.form-group textarea.valid {
    border-color: #27ae60;
    background: #eafaf1;
    box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 18px;
    font-weight: 600;
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

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

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(102, 126, 234, 0.4);
}

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

.submit-btn:active {
    transform: translateY(-1px);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

.success-message {
    display: none;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    border-right: 4px solid #28a745;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
}

.error-message {
    display: none;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    border-right: 4px solid #dc3545;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.15);
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 20px;
    }
    
    .header {
        padding: 40px 25px;
    }
    
    .form-container {
        padding: 30px 20px;
    }
    
    .form-section {
        padding: 25px 20px;
    }
    
    .header h1 {
        font-size: 2.2em;
    }

    .radio-group {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .header p {
        font-size: 1em;
    }

    .form-section {
        padding: 20px 15px;
    }
}